From 9193c9210998d7b665cd1efa2c883d05b1854f96 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 28 Jul 2021 20:20:18 +0100 Subject: [PATCH] Fixed: runas admin for processes --- Windows/Forms/TilePanel.cs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Windows/Forms/TilePanel.cs b/Windows/Forms/TilePanel.cs index 237b67d..d97d381 100644 --- a/Windows/Forms/TilePanel.cs +++ b/Windows/Forms/TilePanel.cs @@ -358,9 +358,22 @@ namespace FizzyLauncher.Windows.Forms ProcessStartInfo p = new ProcessStartInfo(); p.FileName = model.CleanProcessFilename; p.WindowStyle = model.ProcessWindowStyle; - if (!string.IsNullOrWhiteSpace(model.CleanProcessArgument)) p.Arguments = model.CleanProcessArgument; - if (!string.IsNullOrWhiteSpace(model.CleanProcessWorkingDirectory)) p.WorkingDirectory = model.CleanProcessWorkingDirectory; - if (model.ProcessAsAdmin) p.Verb = "runas"; + + if (!string.IsNullOrWhiteSpace(model.CleanProcessArgument)) + { + p.Arguments = model.CleanProcessArgument; + } + + if (!string.IsNullOrWhiteSpace(model.CleanProcessWorkingDirectory)) + { + p.WorkingDirectory = model.CleanProcessWorkingDirectory; + } + + if (model.ProcessAsAdmin) + { + p.UseShellExecute = true; + p.Verb = "runas"; + } MainForm parentForm = findMainForm(); if (parentForm != null)