Reputation: 3273
We have an application written in both C++ and .NET that installs for all users in the Program Files folder. This application downloads new versions of itself (as MSI installers) and spawns the new installer process to replace itself.
The newly installed app is running in an elevated state. This causes problems I won't enumerate here.
Ideally, the launch of the newly installed app would be run with the permissions of the original user.
I can't figure out how to demote the app back to being the standard user after elevation.
(yeah, yeah, this whole process is inelegant anyway)
Is there a better way to do this?
(I've left out a bunch of other details before and after these steps that make the process smoother for the user, but this should be enough to understand the core of the problem I'm trying to solve.)
Upvotes: 0
Views: 792
Reputation: 7135
One way: http://www.codeproject.com/KB/vista-security/VistaElevator.aspx
Another way (mentioned in most recent comment in previous article): http://brandonlive.com/2008/04/27/getting-the-shell-to-run-an-application-for-you-part-2-how/
Upvotes: 1