[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:
Markus Hofknecht 2023-08-28 14:35:21 +02:00
parent b270637b73
commit 7858b3dc7a
3 changed files with 20 additions and 4 deletions

View file

@ -100,8 +100,6 @@ FAQ
SystemTrayMenu is portable, so it does not need to be installed. After downloading e.g. SystemTrayMenu-1.2.6.0.zip, **unzip the folder**, then **start SystemTrayMenu.exe**. If you prefer an installation there is the possibility to install SystemTrayMenu via the [Microsoft Store](https://www.microsoft.com/store/apps/9N24F8ZBJMT1).
If not already installed, download and install .Net 6 [https://dotnet.microsoft.com](https://dotnet.microsoft.com/download/dotnet/6.0) (e.g. dotnet-sdk-6.0.100-win-x64.exe).
1. Step: After starting the application the first time you have to **choose the root directory**.
In this directory you should put shortcuts, files and folders (App, Game, Script, URL, Network),
which you are often using and especially when you can not find them over the windows start menu search.
@ -294,7 +292,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
@ -353,3 +353,4 @@ PayPal/GitHub Sponsors - Thank you!
* [Traditional_Tap3954](https://www.reddit.com/user/Traditional_Tap3954/)
* Maximilian H.
* Jens B.
* [spitzlbergerj](https://github.com/spitzlbergerj)

View file

@ -149,6 +149,7 @@ namespace SystemTrayMenu.UserInterface
"#488 DailenG, " +
"#490 TrampiPW, " +
"#497 Aziz, " +
"#499 spitzlbergerj, " +
Environment.NewLine +
Environment.NewLine;
moreInfo += "Sponsors - Thank you!" + Environment.NewLine;
@ -167,6 +168,7 @@ namespace SystemTrayMenu.UserInterface
"Traditional_Tap3954, " +
"Maximilian H., " +
"Jens B., " +
"spitzlbergerj, " +
Environment.NewLine;
AboutBox aboutBox = new()
{

View file

@ -13,6 +13,8 @@ namespace SystemTrayMenu.Utilities
using System.Threading;
using System.Windows;
using Clearcove.Logging;
using IWshRuntimeLibrary;
using File = System.IO.File;
internal static class Log
{
@ -163,7 +165,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()