Launch application after installation complete, with UAC turned on

Christopher Roy picture Christopher Roy · Feb 17, 2010 · Viewed 9.9k times · Source

Good day.

I've been building an installer for our product using the WIX(Windows Installer XML) technology. The expected behavior is that the product is launched, if the check box is checked after installation.

This has been working for some time now, but we found out recently that UAC of Win 7, and Vista is stopping the application from launching. I've done some research and it has been suggested to me that I should add the attributes

Execute='deferred' and Impersonate='no'.

Which I did, but then found out that to execute deferred, the CustomAction has to be performed, between the InstallInitialize, and IntallFinalize phases; which is not what I need. I need the product to launch AFTER install finalize, IF the launch checkbox is checked. Is there any other way to elevate permissions?

Any and all answers, suggestions, or resonings will be appreciated.

Answer

Ray Dey picture Ray Dey · May 7, 2010

Unfortunately, the topic that Rob mentioned doesn't really help for Windows Vista or 7 as I have found. Especially with UAC turned on.

The way I have got around this is to use a CustomAction that launches the command prompt and launches the application you want.

<CustomAction 
    Id="LaunchApp" 
    Directory="YourDirectory" 
    ExeCommand="[SystemFolder]cmd.exe /C app.exe" />

Hope that helps.

Ray