I'm a little lost here.
I have an App, let's call it App1.
App1 works fine. In some cases, App1 needs to execute another program, App2.
The code is simple:
/*call app2*/
ProcessStartInfo startInfo = new ProcessStartInfo(Convert.ToString(ConfigurationManager.AppSettings["pathActualizador"]));
startInfo.UseShellExecute = false;
try
{
System.Diagnostics.Process.Start(startInfo);
}
catch (ArgumentException)
{
MessageBox.Show("Error en parármetros enviados al Actualizador..", Properties.Resources.txtTituloAplicacion, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
/*close app1 and letting app2 do its work*/
Application.ExitThread();
In some cases, I've problem with the authorization for calling app2. App1 is a simple system, app2 needs to create, move and delete some files and folders (that's why is giving me trouble) At least, we solve it executing as an administrator de app2, by right click --> properties --> execute as administrator.
I'm trying to solve this. I've read many posts, about creating a manifest file here in SO. So, I created one. I added the new item from Application project --> add new item --> app.manifest
And by the default created, only changed this
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
THIS MANIFEST is for App1. We have both apps in like 100 computers, and we can't change it one by one (most of them are in another country) But we have an application to modify, sending some commands throw Internet, the app1. So, I've read that if a process create another one, this new process will have the same ExecutionLevel that its parent. So, adding the manifest in App1, when it creates Process for App2, should execute as Administrator
I'm right or not?
By the other hand, I've added the manifest, compiled, and sent the .exe and .manifest to a client, run, and I still have the same problem: The app2 cannot access to folders to modify them, returning a problem of privileges.
Is there something wrong ? I've to create a manifest for the App2 instead? This is kinda difficult, also is difficult to configure windows for each machine..
I've read that I can also do something like
startInfo.Verb = "runas";
but also read that in the future (said this in 2008) that this could be ignored, and the only way will be using manifest. So I want to avoid this option
edit: Using Visual Studio 2010, .NET 3.5
edit2: I've tried "runas", also not working. The user is no administrator, so has no rights of administrator