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

Got a problem you cannot solve? Try here.
Post Reply
ivssys
Posts: 5
Joined: Tue Jan 15, 2008 8:03 am

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

Post 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.
SimonL
Posts: 3
Joined: Wed Feb 06, 2008 9:43 pm

Web installs and elevation

Post by SimonL »

The ShellExec method doesn't really work that well for Web hosted setup programs.
ivssys
Posts: 5
Joined: Tue Jan 15, 2008 8:03 am

Post by ivssys »

Sorry. My setup.exe is local, not web-based.
Post Reply