views:

303

answers:

2

Hi there

I want to launch an application with admin rights after I have completed an installation using a WiX based MSI. I can launch the application just fine, on XP but with Windows 7, it's an issue.

The application has a manifest embedded in it that says it should run as administrator and I've changed the impersonate attribute in the Custom Action to "no". I can't change the execute attribute to deferred, as this only works before the InstallFinalize action and I need it after the user has clicked Finish in the MSI.

This is my Custom Action:

<CustomAction Id="LaunchApp" FileKey="App" ExeCommand="[Command Line Args]" Execute="immediate" Impersonate="no" Return="asyncNoWait" />

Any help on this would be appreciated. Thanks

A: 

This is effectively a duplicate of Executing a custom action that requires elevation after install so look into WixShellExec.

Michael Urman
+1  A: 

I couldn't use WixShellExec as I needed to pass in command line arguments if certain conditions were true. So I just created a custom action that launched the exe through cmd prompt. Hacky, but a viable workaround and it works without a hitch.

ray dey
Huh, I hadn't used it so didn't realize WixShellExec didn't handle arguments. How odd! Well you can always create your own C++ DLL custom action which calls ShellExecute...
Michael Urman

related questions