diff --git a/Knossos.NET/Classes/FsoBuild.cs b/Knossos.NET/Classes/FsoBuild.cs index d2f4fd9c..ab28fdff 100644 --- a/Knossos.NET/Classes/FsoBuild.cs +++ b/Knossos.NET/Classes/FsoBuild.cs @@ -445,22 +445,6 @@ public async Task RunFSO(FsoExecType executableType, string cmdline, return null; } - /// - /// Gets a all valid executables for the OS/Cpu arch - /// - /// List or null - public List? GetExecutables() - { - if (directExec != null) - { - return null; - } - - var validExecs = executables.Where(b => b.isValid); - - return validExecs?.ToList(); - } - /// /// Return the fsofile executable fullpath /// diff --git a/Knossos.NET/Classes/KnUtils.cs b/Knossos.NET/Classes/KnUtils.cs index b5ac6772..a97a435a 100644 --- a/Knossos.NET/Classes/KnUtils.cs +++ b/Knossos.NET/Classes/KnUtils.cs @@ -1252,51 +1252,5 @@ public static void CreateDesktopShortcut(string shortcutName, string destFileFul Log.Add(Log.LogSeverity.Error, "KnUtils.CreateDesktopShortcut()", ex); } } - - /// - /// Add windows firewall exception for a executable - /// - /// - /// - /// true/false - public static bool AddFirewallException(string programPath, string ruleName) - { - if (!isWindows) - { - Log.Add(Log.LogSeverity.Error, "KnUtils.AddFirewallExceptions()", "This function is only supported on Windows."); - return false; - } - try - { - var startInfo = new ProcessStartInfo - { - FileName = "netsh", - Arguments = $"advfirewall firewall add rule name=\"{ruleName}\" dir=in action=allow program=\"{programPath.Replace("/", "\\")}\" enable=yes", - UseShellExecute = true, - Verb = "runas", - WindowStyle = ProcessWindowStyle.Hidden - }; - - using (var process = Process.Start(startInfo)) - { - process?.WaitForExit(); - if (process?.ExitCode == 0) - { - Log.Add(Log.LogSeverity.Information, "KnUtils.AddFirewallExceptions()", "Added new Firewall Rules for : " + ruleName); - return true; - } - else - { - Log.Add(Log.LogSeverity.Error, "KnUtils.AddFirewallExceptions()", "Failed to add Firewall Rules for : " + ruleName + ". Error code was: " + process?.ExitCode); - return false; - } - } - } - catch (Exception ex) - { - Log.Add(Log.LogSeverity.Error, "KnUtils.AddFirewallExceptions()", ex); - return false; - } - } } } diff --git a/Knossos.NET/ViewModels/Templates/Tasks/InstallBuild.cs b/Knossos.NET/ViewModels/Templates/Tasks/InstallBuild.cs index ed316712..0462e205 100644 --- a/Knossos.NET/ViewModels/Templates/Tasks/InstallBuild.cs +++ b/Knossos.NET/ViewModels/Templates/Tasks/InstallBuild.cs @@ -436,21 +436,6 @@ public partial class TaskItemViewModel : ViewModelBase IsCompleted = true; CancelButtonVisible = false; - //Add firewall rules (windows) - if (KnUtils.IsWindows) - { - var executables = newBuild.GetExecutables(); - if (executables != null && executables.Any()) - { - foreach (var executable in executables) - { - var fp = newBuild.GetExecutablePath(executable); - if (fp != null) - _ = Task.Factory.StartNew(() => KnUtils.AddFirewallException(fp, "Knossos " + newBuild.ToString())); - } - } - } - //Re-run Dependencies checks MainWindowViewModel.Instance?.RunModStatusChecks();