mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-04-29 10:03:29 +12:00
[BUG] In v1.3.3 introduced a issue that always asking for admin, but should only ask if shortcut requires run as admin (#499), version 1.3.4.0
This commit is contained in:
parent
851c0917ec
commit
effaa6a79e
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue