As far as I understood it is not possible to rise privileges within the running process. Hence - as suggested here - from my MainApp
(deployed through ClickOnce) I'm currently launching a separate Process (a signed exe let's call it Foo.exe) used to run activities requiring admin privileges:
Process p = new Process();
p.StartInfo.FileName = "Foo.exe";
p.StartInfo.Arguments = "args...";
p.StartInfo.UseShellExecute = true;
p.StartInfo.Verb= "runas";
p.Start();
p.WaitForExit();
Now I would like to make this procedure as friendly as possible for the user. I've two main concerns.
The user is prompted with the UAC window showing:
Program Name: Foo
Publisher: OurCompany
File Origin: Hard drive on this computer
Program Location: %path% + %arguments%I need to hide the arguments (there is some sensible information not so crucial but showing it so easily is not good) and possibly I would like also to change the Program Name to
MainApp
so that the user recognize the app name he is used to.- I would like to make the main form in
Foo
the child of the main form inMainApp
so that for instance I can easily display the main form inFoo
in the center of its parent