mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-05-16 10:22:34 +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),
|
#466 [Dean-Corso](https://github.com/Dean-Corso),
|
||||||
#488 [DailenG](https://github.com/DailenG),
|
#488 [DailenG](https://github.com/DailenG),
|
||||||
#490 [TrampiPW](https://github.com/TrampiPW),
|
#490 [TrampiPW](https://github.com/TrampiPW),
|
||||||
#497 Aziz
|
#497 Aziz,
|
||||||
|
#499 [spitzlbergerj](https://github.com/spitzlbergerj),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Donations
|
Donations
|
||||||
|
|
|
@ -139,6 +139,7 @@ namespace SystemTrayMenu.Helper
|
||||||
"#488 DailenG, " +
|
"#488 DailenG, " +
|
||||||
"#490 TrampiPW, " +
|
"#490 TrampiPW, " +
|
||||||
"#497 Aziz, " +
|
"#497 Aziz, " +
|
||||||
|
"#499 spitzlbergerj, " +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
Environment.NewLine;
|
Environment.NewLine;
|
||||||
aboutBox.AppMoreInfo += "Sponsors - Thank you!" + Environment.NewLine;
|
aboutBox.AppMoreInfo += "Sponsors - Thank you!" + Environment.NewLine;
|
||||||
|
@ -157,6 +158,7 @@ namespace SystemTrayMenu.Helper
|
||||||
"Traditional_Tap3954, " +
|
"Traditional_Tap3954, " +
|
||||||
"Maximilian H., " +
|
"Maximilian H., " +
|
||||||
"Jens B., " +
|
"Jens B., " +
|
||||||
|
"spitzlbergerj, " +
|
||||||
Environment.NewLine;
|
Environment.NewLine;
|
||||||
aboutBox.AppDetailsButton = true;
|
aboutBox.AppDetailsButton = true;
|
||||||
aboutBox.ShowDialog();
|
aboutBox.ShowDialog();
|
||||||
|
|
|
@ -13,6 +13,8 @@ namespace SystemTrayMenu.Utilities
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Clearcove.Logging;
|
using Clearcove.Logging;
|
||||||
|
using IWshRuntimeLibrary;
|
||||||
|
using File = System.IO.File;
|
||||||
|
|
||||||
internal static class Log
|
internal static class Log
|
||||||
{
|
{
|
||||||
|
@ -162,7 +164,18 @@ namespace SystemTrayMenu.Utilities
|
||||||
string verb = string.Empty;
|
string verb = string.Empty;
|
||||||
if (!PrivilegeChecker.IsCurrentUserInAdminGroup)
|
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()
|
using Process p = new()
|
||||||
|
|
Loading…
Reference in a new issue