From 405997de3ecf8af501b63e793f2f6565cf71a8a2 Mon Sep 17 00:00:00 2001 From: xavierchanth Date: Thu, 10 Oct 2024 23:57:05 -0400 Subject: [PATCH] feat: add access group dialog --- .../NoPortsInstaller/Controller.cs | 4 +++- .../Pages/Device/DeviceConfig1.xaml.cs | 17 +++-------------- .../Pages/Device/DeviceConfig2.xaml | 2 +- .../NoPortsInstaller/Pages/Setup.xaml | 2 ++ .../NoPortsInstaller/Pages/Setup.xaml.cs | 19 ++++++++++++++----- 5 files changed, 23 insertions(+), 21 deletions(-) diff --git a/tools/windows-installer/NoPortsInstaller/Controller.cs b/tools/windows-installer/NoPortsInstaller/Controller.cs index 17477ce87..fa0597bc2 100644 --- a/tools/windows-installer/NoPortsInstaller/Controller.cs +++ b/tools/windows-installer/NoPortsInstaller/Controller.cs @@ -21,6 +21,7 @@ public class Controller public string DeviceName { get; set; } public string RegionAtsign { get; set; } public string AdditionalArgs { get; set; } + public string AccessGroup { get; set; } public bool IsInstalled { get { return Directory.Exists(InstallDirectory); } @@ -61,6 +62,7 @@ public Controller() AdditionalArgs = ""; Pages = []; IsInstalled = false; + AccessGroup = "Users"; LogEnvironment(); } @@ -214,7 +216,7 @@ private void CreateDirectories(string userHome) DirectorySecurity securityRules = new(); DirectoryInfo di; securityRules.AddAccessRule( - new FileSystemAccessRule("Users", FileSystemRights.Modify, AccessControlType.Allow) + new FileSystemAccessRule(AccessGroup, FileSystemRights.ExecuteFile, AccessControlType.Allow) ); List directories = [ diff --git a/tools/windows-installer/NoPortsInstaller/Pages/Device/DeviceConfig1.xaml.cs b/tools/windows-installer/NoPortsInstaller/Pages/Device/DeviceConfig1.xaml.cs index 11725bd1a..4fabb7672 100644 --- a/tools/windows-installer/NoPortsInstaller/Pages/Device/DeviceConfig1.xaml.cs +++ b/tools/windows-installer/NoPortsInstaller/Pages/Device/DeviceConfig1.xaml.cs @@ -41,21 +41,10 @@ private void DeviceCombo_Initialized(object sender, EventArgs e) _controller.PopulateAtsigns(comboBox); } - private void ValidateInputs(object sender, SelectionChangedEventArgs e) - { - if (ClientCombo.Text == "" || DeviceCombo.Text == "") - { - NextPageButton.IsEnabled = false; - } - else - { - NextPageButton.IsEnabled = true; - } - } - private void ValidateInputs(object sender, TextChangedEventArgs e) - { - if (ClientCombo.Text == "" || DeviceCombo.Text == "" || DeviceNameText.ToString() == "" ) + private void ValidateInputs(object sender, dynamic e) + { + if (ClientCombo.Text == "" || DeviceCombo.Text == "" || DeviceNameText.Text == "") { NextPageButton.IsEnabled = false; } diff --git a/tools/windows-installer/NoPortsInstaller/Pages/Device/DeviceConfig2.xaml b/tools/windows-installer/NoPortsInstaller/Pages/Device/DeviceConfig2.xaml index 6e3467770..212b1410c 100644 --- a/tools/windows-installer/NoPortsInstaller/Pages/Device/DeviceConfig2.xaml +++ b/tools/windows-installer/NoPortsInstaller/Pages/Device/DeviceConfig2.xaml @@ -58,7 +58,7 @@ -