I have a program that copies a number of DLL files and I want to register all the DLL files using regsvr. Is there any easy way to do this in IA? I know about the Register Library under the MSI Code but when I drag it over I have to select the files one by one (which is a pain since there are a lot of files).
Thanks in advance.
Register all DLL's in a directory
Register all DLL's in a directory
--
Chuck Haines
Software Developer
Recorded Books, LLC
http://www.recordedbooks.com
Chuck Haines
Software Developer
Recorded Books, LLC
http://www.recordedbooks.com
Chuck,
I'm only recent to IA myself but the following worked for me with differences to the folder name as appropriate to your case:
Set Variable STUFF to
Set Variable EOF to
Run Program dir "C:\\Wherever\\*.dll" /b > C:\\Temp\\dlls.txt , startup in folder C:\\Temp
label: ReadFilename
Read from Text File C:\\Temp\\dlls.txt into Variable STUFF (get EOF into EOF)
if Variable EOF Equals FALSE
MessageBox: Filename, $STUFF$
Register assembly $STUFF$
GoTo Label: ReadFilename
end
However, I had cheated by creating the dlls.txt file manually as there was something about the Run Program statement which did not create the dlls.txt file when I tried to debug it. It's probably tied up to the way IA executes black statements in the MSI code window. In the absence of a better answer my half-baked solution might get you started. Be aware though, that you can't use a label statement inside another conditional. Where you place my example in the MSI code sequence is something I'll leave you to pontificate. Apologies in advance if my solution teaches you the wrong dance. Someone more skilled with IA will teach you the tango much better.
EDIT: As you probably know regsvr32 can accept any number of pathnames on the command line so you don't need to execute Register Assembly on each one but that's a matter of choice. Where I used a hard-coded pathname, you'd probably use the $TARGETDIR$ value or something more runtime specific for the folder containing the assemblies you install.
I'm only recent to IA myself but the following worked for me with differences to the folder name as appropriate to your case:
Set Variable STUFF to
Set Variable EOF to
Run Program dir "C:\\Wherever\\*.dll" /b > C:\\Temp\\dlls.txt , startup in folder C:\\Temp
label: ReadFilename
Read from Text File C:\\Temp\\dlls.txt into Variable STUFF (get EOF into EOF)
if Variable EOF Equals FALSE
MessageBox: Filename, $STUFF$
Register assembly $STUFF$
GoTo Label: ReadFilename
end
However, I had cheated by creating the dlls.txt file manually as there was something about the Run Program statement which did not create the dlls.txt file when I tried to debug it. It's probably tied up to the way IA executes black statements in the MSI code window. In the absence of a better answer my half-baked solution might get you started. Be aware though, that you can't use a label statement inside another conditional. Where you place my example in the MSI code sequence is something I'll leave you to pontificate. Apologies in advance if my solution teaches you the wrong dance. Someone more skilled with IA will teach you the tango much better.
EDIT: As you probably know regsvr32 can accept any number of pathnames on the command line so you don't need to execute Register Assembly on each one but that's a matter of choice. Where I used a hard-coded pathname, you'd probably use the $TARGETDIR$ value or something more runtime specific for the folder containing the assemblies you install.
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
InstallAware MVP

