mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
Autoupdate option visible only for administrators group (#2945)
* Added isAdmin value to Settings.UI. Changed elevation check to user group check for AutoDownload toggle
This commit is contained in:
committed by
GitHub
parent
3dc61962de
commit
a13c8cb71e
@@ -11,11 +11,16 @@ namespace Microsoft.PowerToys.Settings.UI.Runner
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
// Quantity of arguments
|
||||
private const int ArgumentsQty = 5;
|
||||
|
||||
// Create an instance of the IPC wrapper.
|
||||
private static TwoWayPipeMessageIPCManaged ipcmanager;
|
||||
|
||||
public static bool IsElevated { get; set; }
|
||||
|
||||
public static bool IsUserAnAdmin { get; set; }
|
||||
|
||||
[STAThread]
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
@@ -24,7 +29,7 @@ namespace Microsoft.PowerToys.Settings.UI.Runner
|
||||
App app = new App();
|
||||
app.InitializeComponent();
|
||||
|
||||
if (args.Length > 3)
|
||||
if (args.Length >= ArgumentsQty)
|
||||
{
|
||||
if (args[4] == "true")
|
||||
{
|
||||
@@ -35,6 +40,15 @@ namespace Microsoft.PowerToys.Settings.UI.Runner
|
||||
IsElevated = false;
|
||||
}
|
||||
|
||||
if (args[5] == "true")
|
||||
{
|
||||
IsUserAnAdmin = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
IsUserAnAdmin = false;
|
||||
}
|
||||
|
||||
ipcmanager = new TwoWayPipeMessageIPCManaged(args[1], args[0], null);
|
||||
ipcmanager.Start();
|
||||
app.Run();
|
||||
|
||||
Reference in New Issue
Block a user