InstallShield Professional Edition - Custom Action - Setup.exe vs MSI

850 views Asked by At

I have a windows forms application (Add-In Express Solution) for which I have created an InstallShield setup project which uses custom actions (Auto generated by Add-In Express). The custom actions are launching executable files (The executable files are used to register the Add In).

When I generate a setup.exe file for the project, everything works well. The custom actions are running and the add-in is being correctly installed.

When I generate an msi file (Uncheck "Create installation launcher" option in the Release Wizard of Installshield) then the custom actions aren't running (add-in not installed but the program shows up in the list of programs in the Control Panel) when I try installing the product.

Am I required to use the setup.exe version when using custom actions or am I not configuring my project correctly when trying to generate an msi file?

2

There are 2 answers

0
weberik On BEST ANSWER

The difference between running the MSI directly or using a Setup.exe is the point in the sequence the user rights get elevated.

if you run the Exe, you will probably recieve a UAC Popup requesting more rights, you click OK and everything will run elevated(with admin rights).

if you run it from an already elevated command prompt also everything will run elevated.

if you run the msi normally(e.g. doubleclick it) it will run through the whole installUIsequence then it will run through the installexecute sequence and when it reaches the InstallInitialize Action it will request elevated rights.

and as soon as the InstallFinalize action is run the rights are dropped.

so you need to place the custom actions which need admin rights after the InstallInitialize and before InstallFinalize action

0
DDA On

What I ended up doing to solve my issue is set the custom actions to run in the System Context.

In-Script Execution: Deferred Execution in System Context