I am creating a deployment project in Visual Studio 2010, and at the end of the install it needs to start a process as the user who began the install.
Since the install process requires elevated privileges to run, the process is being launched as the System user.
Is there any way to force a process to run during an install as the user who started the install? Is this information available?
Visual Studio deployment projects are MSI, or Windows Installer based. The installer usually elevates only when it needs to apply the modifications to the system, the steps when it collects data and the completion page are run as the current user, non-elevated.
Is the application at the end of install really started elevated?
If so, you would need a wrapper. The simplest way to start something unelevated is to keep the context of the current user. The wrapper firstly starts the install, which elevates at start; and after install finishes, it starts your application as the current non-elevated user.
Trying to start a non-elevated process from an elevated one is a tough and error-prone task. If you still want to follow this road, read the blog post How do I start a program as the desktop user from an elevated app?