cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
PaulFake
Level 2

How to run RegAsm /codebase with an InstallScript project?

Jump to solution

I tried to post this question a few days ago, but when I went back to check on it, my post did not exist in the forum.  So I'm trying it again.

 

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.

Labels (1)
0 Kudos
(1) Solution
PaulFake
Level 2

If it helps anyone in the future, this actually turned out to be really easy to accomplish.  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 are 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);

View solution in original post

0 Kudos
(1) Reply
PaulFake
Level 2

If it helps anyone in the future, this actually turned out to be really easy to accomplish.  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 are 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);

0 Kudos