cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sean_larkin
Level 4

launch exe after install with admin privileges

I would like to be able to launch an installed executable after installation is complete. I've tried to use IS_LAUNCH_MY_PROGRAM_PLEASE as a custom action when the finish button is pressed in the SetupCompleteSuccess dialog, but it doesn't work. I get error 1721: There is a problem with the Windows Intsaller package, etc. This link explains my situation fairly closely:
http://www.tipandtrick.net/2008/error-1721-there-is-a-problem-with-this-windows-installer-package-when-install-or-uninstall-on-vista/

Basically, my installed exe must be run as an administrator, which the custom action does not provide. I know that you can run an exe from within the installer with elevated privileges using deferred execution in system context. However, this will not work in my case because the SetupCompleteSuccess dialog occurs after the InstallFinalize action. If I change the manifest for my exe to have "AsInvoker" privileges it runs after the dialog, but crashes soon after because it needs write access within the ProgramFiles folder(I cannot change its need for write access). Is there any other way to get my exe to be run as administrator the way that I'd like to?
Labels (1)
0 Kudos
(1) Reply
Cary_R
Level 11

Hi There,

You could wrap the execution of the custom action in script code to call it via ShellExecute() -- this would trigger another UAC prompt.

That's the only clean solution, anyways. If you're curious about this, my recommendation is to use InstallScript's LaunchApplication function with the LAAW_USE_SHELLEXECUTE flag passed in as an option flag.
0 Kudos