Call as non-admin if gksudo and kdesu aren't available.
This commit is contained in:
@@ -80,7 +80,7 @@ namespace OpenRA.Utility
|
|||||||
else if (File.Exists("/usr/bin/kdesudo"))
|
else if (File.Exists("/usr/bin/kdesudo"))
|
||||||
CallWithAdminKDE(command);
|
CallWithAdminKDE(command);
|
||||||
else
|
else
|
||||||
CallWithAdminWindows(command);
|
CallWithoutAdmin(command);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
CallWithAdminWindows(command);
|
CallWithAdminWindows(command);
|
||||||
@@ -160,5 +160,23 @@ namespace OpenRA.Utility
|
|||||||
Console.Write(reader.ReadLine());
|
Console.Write(reader.ReadLine());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void CallWithoutAdmin(string command)
|
||||||
|
{
|
||||||
|
var p = new Process();
|
||||||
|
p.StartInfo.FileName = "mono";
|
||||||
|
p.StartInfo.Arguments = "OpenRA.Utility.exe " + command;
|
||||||
|
p.StartInfo.UseShellExecute = false;
|
||||||
|
p.StartInfo.RedirectStandardOutput = true;
|
||||||
|
p.Start();
|
||||||
|
|
||||||
|
using (var reader = p.StandardOutput)
|
||||||
|
{
|
||||||
|
while(!p.HasExited)
|
||||||
|
{
|
||||||
|
Console.WriteLine(reader.ReadLine());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user