ElevatedManagedAction scheduled before RemoveExistingProducts alternative #1704
-
Hi, So what are my options then? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You can always run an elevated process from the unelevated CA: [CustomAction]
public static ActionResult InvokeRemoveFiles(Session session)
{
try
{
var startInfo = new ProcessStartInfo();
startInfo.UseShellExecute = true;
startInfo.FileName = "sc";
startInfo.Arguments = "stop <ServiceName>";
startInfo.Verb = "runas";
Process.Start(startInfo);
return ActionResult.Success;
}
catch(Exception e)
{
// handle the error here
}
} |
Beta Was this translation helpful? Give feedback.
You can always run an elevated process from the unelevated CA: