Skip to content

Commit

Permalink
disable FirewallRules by default
Browse files Browse the repository at this point in the history
  • Loading branch information
S74nk0 committed Jul 12, 2019
1 parent 1700366 commit abd010a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@
using NiceHashMiner.Configs;
using NiceHashMiner.Devices;
using NiceHashMiner.Forms.Components;
using NiceHashMiner.Miners;
using NiceHashMiner.Miners.IntegratedPlugins;
using NiceHashMiner.Plugin;
using NiceHashMiner.Stats;
using NiceHashMiner.Utils;
using NHM.Common;
using NHM.Common.Enums;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using NHM.DeviceDetection;
Expand Down Expand Up @@ -194,12 +191,19 @@ public static async Task InitializeManagersAndMiners(StartupLoadingControl loadi
VC_REDIST_x64_2015_DEPENDENCY_PLUGIN.Instance.InstallVcRedist();

// STEP
progress?.Report((Tr("Checking Firewall Rules..."), nextProgPerc()));
if (FirewallRules.IsFirewallRulesOutdated())
if (FirewallRules.RunFirewallRulesOnStartup)
{
// requires UAC
// TODO show message box
FirewallRules.UpdateFirewallRules();
progress?.Report((Tr("Checking Firewall Rules..."), nextProgPerc()));
if (FirewallRules.IsFirewallRulesOutdated())
{
// requires UAC
// TODO show message box
FirewallRules.UpdateFirewallRules();
}
}
else
{
progress?.Report((Tr("Skipping Firewall Rules..."), nextProgPerc()));
}

// STEP
Expand Down
7 changes: 7 additions & 0 deletions src/NiceHashMiner/Configs/Data/GeneralConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using NiceHashMiner.Miners;
using NiceHashMiner.Switching;
using NHM.Common.Enums;
using NiceHashMiner.Utils;

namespace NiceHashMiner.Configs.Data
{
Expand Down Expand Up @@ -190,6 +191,12 @@ public bool CoolDownCheckEnabled

public Point MainFormSize = new Point(1000, 400);

public bool RunFirewallRulesOnStartup
{
get => FirewallRules.RunFirewallRulesOnStartup;
set => FirewallRules.RunFirewallRulesOnStartup = value;
}

public bool UseEthlargement
{
get => NiceHashMiner.Configs.ThirdPartyMinerSettings.Instance.UseEthlargement;
Expand Down
1 change: 1 addition & 0 deletions src/NiceHashMiner/Utils/FirewallRules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace NiceHashMiner.Utils
{
public static class FirewallRules
{
public static bool RunFirewallRulesOnStartup { get; set; } = false;
static string _firewallRulesAddedFilePath => Path.Combine("internals", "firewall_rules_added.json");
private static List<string> _pluginsUUIDsWithVersions = new List<string>();

Expand Down

0 comments on commit abd010a

Please sign in to comment.