Page 1 of 1

UAC-prompt for Setup.exe - Finally a solution!

Posted: Sat Jan 19, 2008 8:18 am
by ivssys
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.

Web installs and elevation

Posted: Mon Feb 11, 2008 6:38 am
by SimonL
The ShellExec method doesn't really work that well for Web hosted setup programs.

Posted: Mon Feb 11, 2008 6:46 am
by ivssys
Sorry. My setup.exe is local, not web-based.