diff --git a/app/renderer-process/left-menu.js b/app/renderer-process/left-menu.js
index 4ff7848..dfa27ef 100644
--- a/app/renderer-process/left-menu.js
+++ b/app/renderer-process/left-menu.js
@@ -88,6 +88,10 @@ ipcRenderer.on('version', (event, arg) => {
document.getElementById('version').textContent = arg[0];
});
+ipcRenderer.on('disableFirewallMessage', (event, arg) => {
+ document.getElementById('firewallMessage').textContent = "";
+});
+
function resetListOfServers() {
const span = document.getElementById('servers-list');
span.innerHTML = ``;
diff --git a/index.html b/index.html
index 00fafbc..d5cef62 100644
--- a/index.html
+++ b/index.html
@@ -20,7 +20,8 @@
CS:GO MM server picker
- You must enable Windows Firewall for the
+
You must enable
+ Windows Firewall for the
app to work
diff --git a/main.js b/main.js
index 9565ca9..2526249 100644
--- a/main.js
+++ b/main.js
@@ -32,6 +32,7 @@ function initialize() {
getServersFile();
getUpdate();
getMessage();
+ getFirewallStatusOnWindows();
win.webContents.send('version', [app.getVersion()]);
});
}
@@ -125,4 +126,20 @@ async function getMessage() {
}
}
+function getFirewallStatusOnWindows() {
+ var cmd = "Invoke-Command -ScriptBlock {[Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey(\"LocalMachine\",$env:COMPUTERNAME).OpenSubKey(\"System\\CurrentControlSet\\Services\\SharedAccess\\Parameters\\FirewallPolicy\\StandardProfile\").GetValue(\"EnableFirewall\")}";
+
+ if (process.platform !== 'win32') {
+ return;
+ }
+
+ const { exec } = require('child_process');
+ exec(cmd, { 'shell': 'powershell.exe' }, (error, stdout, stderr) => {
+ if (stdout == 1) {
+ win.webContents.send('disableFirewallMessage');
+ }
+ })
+
+}
+
initialize();
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index cfebbfd..4e96e11 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "csgo-mm-server-picker",
- "version": "v1.1.7",
+ "version": "v1.1.8",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "csgo-mm-server-picker",
- "version": "v1.1.7",
+ "version": "v1.1.8",
"license": "CC-BY-NC-ND-4.0",
"dependencies": {
"axios": "^0.21.2",
diff --git a/package.json b/package.json
index b1a9708..85d7171 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "csgo-mm-server-picker",
- "version": "v1.1.7",
+ "version": "v1.1.8",
"description": "Server picker for CS:GO matchmaking",
"main": "main.js",
"scripts": {