0
votes

I tried this question on the InstallShield forum and it hasn't gotten any love. My company has an InstallScript project (non-MSI), and we need to run RegAsm /codebase on one of our DLLs. I found some tutorials online for doing this, but they don't seem to apply to our project type. That is, the options I need simply do not exist in the UI. That includes both suggestions here (https://www.iwasdot.com/installshield-execute-a-batch-script/) as well as anything involving custom actions (as I interpret from the docs that custom actions do not apply to InstallScript projects). How can I accomplish this with InstallScript? I am using InstallShield 2013 and I know extremely little about it.

2
Any reason to not switch to Windows Installer project types?Christopher Painter

2 Answers

0
votes

I haven't used InstallScript projects in almost 20 years but I imaging you'd write an InstallScript function to call LaunchAppAndWait to invoke Regasm.

If I recall correctly, InstallScript project types have events like After File Copy that you can use to put the code into.

0
votes

Christopher Painter is correct. I came to the same conclusion and was able to get this to work. If it helps anyone in the future, here's more specifically what I did:

I went to the "Behavior and Logic" folder of the "Installation Designer" tab and selected "InstallScript". Then on the right-hand pane I selected the feature my DLL is associated with and then selected the "Installed" event handler. The following script registered my DLL for COM interop:

LaunchApplication("C:/Windows/Microsoft.NET/Framework/v4.0.30319/RegAsm.exe", "../path/to/my.dll /codebase", "", SW_HIDE, 0, LAAW_OPTION_NOWAIT);

And then I did something similar for the "Uninstalled" event handler:

LaunchApplication("C:/Windows/Microsoft.NET/Framework/v4.0.30319/RegAsm.exe", "/unregister ../path/to/my.dll", "", SW_HIDE, 0, LAAW_OPTION_NOWAIT);