I am windows user. I am able to execute process as admin on windows like that
public void ExecuteAsAdmin(string fileName, string args)
{
Process proc = new Process();
proc.StartInfo.FileName = fileName;
proc.StartInfo.UseShellExecute = true;
proc.StartInfo.Verb = "runas";
proc.StartInfo.Arguments = args;
proc.Start();
}
Wit this code, UAC is triggered and everything is working as it should. Unfortunatelly, i am not able to achieve it on MAC. Do you know, whether/how can i achieve it?
Do i run SUDO app there with parameter?
Yes. I don’t know how it’s handled on macOS but on Linux there will be a prompt that appears asking for a password. I don’t know if you can supply the password ahead of time to sudo.
Out of interest what do you need admin rights for your app? Sounds a bit, well sketchy? Could be legit OC. People get a bit unsure when the app needs to run a process under admin.