UAC-prompt for Setup.exe - Finally a solution!
Posted: Sat Jan 19, 2008 8:18 am
Hello,
I've seen a lot of questions like this in the forum, and I had the same problem:
We have InstallAware 7 Express. Our application installs program files in the C:\\Program Files directory. So Setup.exe needs Elevated Privileges.
How can I make sure that Setup.exe will present the user with the UAC prompt to obtain the proper admin privileges?
I want to user to double click on the icon, not to right click and select "Run as administrator" or something.
Now finally I found a solution that works. I create a program that launches the Setup.exe in elevated mode using the ShellExecuteEx() call with verb RunAs. See:
http://blogs.msdn.com/vistacompatteam/a ... 71232.aspx
One note: In this program you must first check if the user is running Vista, otherwise use the "Open" verb. If you use RunAs under XP, you also have to select a user, very uncommon behaviour.
I've seen a lot of questions like this in the forum, and I had the same problem:
We have InstallAware 7 Express. Our application installs program files in the C:\\Program Files directory. So Setup.exe needs Elevated Privileges.
How can I make sure that Setup.exe will present the user with the UAC prompt to obtain the proper admin privileges?
I want to user to double click on the icon, not to right click and select "Run as administrator" or something.
Now finally I found a solution that works. I create a program that launches the Setup.exe in elevated mode using the ShellExecuteEx() call with verb RunAs. See:
http://blogs.msdn.com/vistacompatteam/a ... 71232.aspx
One note: In this program you must first check if the user is running Vista, otherwise use the "Open" verb. If you use RunAs under XP, you also have to select a user, very uncommon behaviour.