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:
Yevhenii Holovachov
2020-05-14 12:36:27 +03:00
committed by GitHub
parent 3dc61962de
commit a13c8cb71e
7 changed files with 52 additions and 9 deletions

View File

@@ -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();