View Full Version : UAC and custom action IS_LAUNCH_MY_PROGRAM_PLEASE

02-26-2008, 05:43 AM
I have a Basic MSI project;and set Game.exe as the main executable to launch after installation。But I have found the Game.exe run with a elevated privilege! And my question is :
How to config the project so that Game.exe can run as orign user context?

02-26-2008, 10:34 AM
For this to work, you must either launch the MSI directly, or launch it from a non-elevated context. In practice this means you should change the release setting for setup.exe to "Invoker" instead of either "Highest Available" or "Administrator", as the non-Invoker options will elevate setup.exe and the MSI.

Note that you may have previously selected the higher privileges to work around other permissions problems in, e.g., the custom actions in your install, so double-check those if you make this change.

02-27-2008, 12:50 AM
If Game.exe still needs a orign user context, there's no way to show an UAC prompt when user click Setup.exe,right?

02-27-2008, 04:18 AM
:confused: Nobody knows?

02-27-2008, 02:15 PM
Correct. To avoid launching Game in the administrator context, you either need to delay the UAC prompt until the execute sequence beings (what it will do if launched with the setting Invoker), or to just not launch Game from the install.

02-28-2008, 11:12 PM
I think Problems During Installation in Teach Your Apps To Play Nicely With Windows Vista User Account Control (http://msdn.microsoft.com/msdnmag/issues/07/01/UAC/default.aspx?loc=en) may give a solution, that is to add a property msidbCustomActionTypeNoImpersonate into CustomAction IS_LAUNCH_MY_PROGRAM_PLEASE.But I don't know how to do this?

02-29-2008, 11:52 AM
The msidbCustomActionTypeNoImpersonate flag is only relevant to deferred custom actions, and it's represented in the IDE as the "in System Context" part of "Deferred in System Context". It won't help for this, nor would impersonation, as Windows Installer would only be able to impersonate its launching user. When setup.exe is set to require Administrator, the launching user of Windows Installer is the administrator.