7

Using a custom action in InstallShield, I'm trying to run a .exe file during the installation to register a third party service. The .exe needs to run in admin mode. This will need to run in either UI mode or silent mode. This is a set of third party files that get deployed through our installer but I need to execute one during the process.

I've tried executing it from "Install Exec Sequence" "After Install Files" (and also tried "After Publish Features"). In this case I get the following dialog:

enter image description here

I've also tried it from "Admin Exec Sequence" "After InstallFiles" but this appears not to run at all. The program will install, but I need to manually run the command to get things working.

I also have In-Script execution set to "Deferred Execution" and Return Processing set to "Synchronous (Check exit code)".

So, I could use some guidance on where this should execute? Install Exec Sequence? Admin Exec Sequence? After which stage?
At which point is the program written out and available to execute?

k_g
  • 4,333
  • 2
  • 25
  • 40
doobop
  • 4,465
  • 2
  • 28
  • 39

1 Answers1

12

I got this working. The key was to set the value to "Deferred Execution in System Context". If just set to "Deferred Execution", it runs in user mode.

enter image description here

Also, the "Admin Exec Sequence" is not called in this case. The .msi need to be run with /a to run this path. It is useful for administrators to manage installations over many machines. (Microsoft's Description)

doobop
  • 4,465
  • 2
  • 28
  • 39
  • 3
    Note that actions planned for Deferred Execution in System Context need to be placed after InstallInitialize in the Install Exec Sequence [[source](https://msdn.microsoft.com/en-us/library/windows/desktop/aa368268%28v=vs.85%29.aspx)]. They will will run with full privileges, but they can't access most MSI properties. You can pass them the info they need through the special property CustomActionData [[source](http://helpnet.flexerasoftware.com/installshield22helplib/helplibrary/AccessingProps-DeferredCAs.htm)]. – Agostino Nov 23 '16 at 14:48