Elevating a process to run as admin doesn't work. If I run that application from an elevated command prompt it runs fine. But my code below doesn't.
Process setupws = new Process();
setupws.StartInfo.FileName = @"setupws.exe";
setupws.StartInfo.Verb = "runas";
setupws.StartInfo.UseShellExecute = true;
setupws.Start();
setupws.WaitForExit();
The setupws.exe file runs fine, just not as an admin.
What am I doing wrong?
Thanks
PS. I've also used highestAvailable and requireAdministrator in my app.manifest file
You need to mark your installer as requestedExecutionLevel level=requireAdministrator in the manifest, see Create and Embed an Application Manifest (UAC).
PS. The requireAdministrator should be in the setupws.exe's manifest.