Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 3

Launch MSI with Elevated Access Permission


We used to create Single MSI and single EXE for installtion.

The package required administrator privilege to install. Now the situation is that

Project type : Basic MSI
Required Administrative Privilege = Yes
Required Execution Level = Yes
Install Condition is set to = AdminUsers

To check the administrative access i create a key in HKEY_LOCAL_MACHINE... if key get created successfully then i assume that installation is running in admin mode else i aborted the installation.

When i run setup.exe by double click on Windows7, 64 bit machine with admin user than installation success,

When i run setup.msi by double click on Windows7, 64 bit machine with admin user than i am not able to create the registry and installation fails.

When i run setup.msi by double click on WindowsXP machine with admin user than installation success

When i run setup.msi by double click on WindowsXP, 64 bit machine with non admin user than it prompt that user need admin access and doesn't even goes to script.


Now as per my knowledge setup.exe launches the msi with admin privileged but on directly trying to install with msi the msi get launched with non elevated access.

If i create a batch file and then right click and run as admin then installation is successful.

I have gone through some threads which tell to set MSIDEPLOYMENTCOMPLIANT=1. But i didn't get when, where and how to set this property value to one.

In the first custom action i tried to set this value but that doesn't work and in the same function i am checking for admin privilege.

Labels (1)
0 Kudos
2 Replies
Level 7

Your testing shows the correct behaviour.
The setup.exe is used to elevate the privileges - this is why the installation is pass.

When you double click the msi directly, there is no elevation of privileges.

You custom action is probably 'immediate' hence you can not make changes to the secure regsitry part, as immediate actions always run in user context mode.

Try to set a value in the registry using a deferred in system context action.
0 Kudos
Level 3

Thanks for fast reply !

This helped a lot...
0 Kudos