cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Simon_Yang
Level 6

How to let msi file Require Administrative Privileges

I built a basic msi project with installshield2008. My install package has both a setup.exe and msi file. I wanna force user giving administrative privileges when my package is installing to Vista.

I set the option "Require Administrative Privileges" to "Yes", therefore, when user dobule clicks setup.exe, Vista UAC will force he give the installation adiminstrative privileges, otherwise the installation will be quited. But the problem is if user double-click msi, msiexec will execute automatically, therefore, I have no chance to give the installation admin privilege.

Anyone know how to let msi require admin privilege in vista? I think maybe I should modify some sittings of msi file.

Thanks!
Labels (1)
0 Kudos
(6) Replies
Happy_Days
Level 7

Hi,

Windows Installer by default doesn't elevate to higher privileges until it is about to actually start doing work in the install sequence. Hence your setup will prompt for RunAs dialog if the msi need admin rights to be installed.

Or, you can wrap the msi into Exe so that user have no choice but to execute the exe.
0 Kudos
Simon_Yang
Level 6

Hi Happy Days,

Thanks for reply. But I need leave msi out, since users will use it depoly by active dircectory.

Can I do sth that let msi prompt out a RunAs dilog just like setup.exe did while installing?

Thanks!


Happy Days wrote:
Hi,

Windows Installer by default doesn't elevate to higher privileges until it is about to actually start doing work in the install sequence. Hence your setup will prompt for RunAs dialog if the msi need admin rights to be installed.

Or, you can wrap the msi into Exe so that user have no choice but to execute the exe.
0 Kudos
Happy_Days
Level 7

You can write a vbscript custom action which checks for AdminUser MSI property and sequence it right on top. If you are not sure how to do it, please refer Session object in Windows Installer help.
0 Kudos
RobertDickau
Flexera Alumni

You might look into the AdminUser, Privileged, and possibly MSIUSEREALADMINDETECTION properties...
0 Kudos
MichaelU
Level 12 Flexeran
Level 12 Flexeran

Robert's suggestion should allow you to abort the install when it's not elevated; another option would be to document use of the setup.exe /a parameter to create an administrative installation point, potentially enabling Happy's suggestion. The two suggestions can be used together as well for further safety.

But ideally I would suggest removing the requirement for administrator privileges outside of the Deferred portion of the Execute sequence, as it makes for a cleaner install.
0 Kudos
Simon_Yang
Level 6

Thanks for all replies!
0 Kudos