Getting your application ware of Vista’s UAC

If your application does anything “bad” like writing to program files directory or the local machine part of the registry then its unlikely to run as expected on Vista (dont use the virtual stores).

If your app really needs to write to these forbidden lands your users will need to escalate it to admin privileges via the UAC dialog. Visual Studio 2008 makes this pretty simple, just right click on your solution and select at Add New item, then select Application Manifest File. Open the app.manifest file and change the “requestedExecutionLevel” level to “requireAdministrator”. If, like me, you package the setup.exe bootstrapper and setup.msi in to a self extracting zip, make sure you include the word setup in your exe name. Vista automatically shows the UAC dialog when any executables named *setup*.exe are ran.

Also see http://channel9.msdn.com/Showpost.aspx?postid=334866

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: