cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Paulaner
Level 2

Detecting admin in Vista when Privileged = 1 (always)

I have an older installshield msi with a bunch of vbscript custom actions, many needing elevation. These should be rewritten to work as deferred in system context, but I just don't have time now.

To make this installer work correctly, the user needs to open a command prompt via "Run as Administrator" and use msiexec /I.

If they don't use an admistrator:cmd window, I need to give an error message. From my testing, the Privileged property is always set to 1, no matter how I launch the msi.

How can I detect if the msi is running with elevated privileges?
Labels (1)
0 Kudos
2 Replies
thepeter
Level 7

you can use MSIUSEREALADMINDETECTION to check if the user has administrative rights. http://msdn.microsoft.com/en-us/library/aa816403(VS.85).aspx
0 Kudos
Paulaner
Level 2

Thanks, that's exactly what I needed.
0 Kudos