diff --git a/README.md b/README.md index 3b1fbc4..0886f1b 100644 --- a/README.md +++ b/README.md @@ -294,7 +294,9 @@ Thanks for ideas, reporting issues and contributing! #466 [Dean-Corso](https://github.com/Dean-Corso), #488 [DailenG](https://github.com/DailenG), #490 [TrampiPW](https://github.com/TrampiPW), -#497 Aziz +#497 Aziz, +#499 [spitzlbergerj](https://github.com/spitzlbergerj), + Donations diff --git a/UserInterface/AppContextMenu.cs b/UserInterface/AppContextMenu.cs index ff68836..cbe912f 100644 --- a/UserInterface/AppContextMenu.cs +++ b/UserInterface/AppContextMenu.cs @@ -139,6 +139,7 @@ namespace SystemTrayMenu.Helper "#488 DailenG, " + "#490 TrampiPW, " + "#497 Aziz, " + + "#499 spitzlbergerj, " + Environment.NewLine + Environment.NewLine; aboutBox.AppMoreInfo += "Sponsors - Thank you!" + Environment.NewLine; @@ -157,6 +158,7 @@ namespace SystemTrayMenu.Helper "Traditional_Tap3954, " + "Maximilian H., " + "Jens B., " + + "spitzlbergerj, " + Environment.NewLine; aboutBox.AppDetailsButton = true; aboutBox.ShowDialog(); diff --git a/Utilities/Log.cs b/Utilities/Log.cs index cefeba1..acf928e 100644 --- a/Utilities/Log.cs +++ b/Utilities/Log.cs @@ -13,6 +13,8 @@ namespace SystemTrayMenu.Utilities using System.Threading; using System.Windows.Forms; using Clearcove.Logging; + using IWshRuntimeLibrary; + using File = System.IO.File; internal static class Log { @@ -162,7 +164,18 @@ namespace SystemTrayMenu.Utilities string verb = string.Empty; if (!PrivilegeChecker.IsCurrentUserInAdminGroup) { - verb = "runas"; + bool isLink = Path.GetExtension(fileName) + .Equals(".lnk", StringComparison.InvariantCultureIgnoreCase); + if (isLink) + { + WshShell shell = new(); + IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(fileName); + bool startAsAdmin = shortcut.WindowStyle == 3; + if (startAsAdmin) + { + verb = "runas"; + } + } } using Process p = new()