InstallShield - Need to run custom action .exe in admin mode
Asked Answered
A

1

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?

Asafetida answered 25/2, 2015 at 0:30 Comment(0)
A
13

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)

Asafetida answered 25/2, 2015 at 17:31 Comment(2)
Note that actions planned for Deferred Execution in System Context need to be placed after InstallInitialize in the Install Exec Sequence [source]. 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].Gamecock
The answer was too old but saved me a day. Thank youUnwrap

© 2022 - 2024 — McMap. All rights reserved.