diff --git a/resources/js/index.js b/resources/js/index.js index 8135997..8f6415a 100644 --- a/resources/js/index.js +++ b/resources/js/index.js @@ -3,7 +3,7 @@ Neutralino.init(); let localeObj; const filesystem = Neutralino.filesystem const createCmdWindow = async (command) => { - Neutralino.os.execCommand(`cmd.exe /c start ${command}`, { background: true }) + Neutralino.os.execCommand(`cmd.exe /c start "" ${command}`, { background: true }) } /** @@ -286,7 +286,7 @@ async function closeFirstTimePopup() { } async function runInstallScript() { - createCmdWindow(`${NL_CWD}/scripts/install.cmd "${NL_CWD}" true`) + createCmdWindow(`.\\scripts\\install.cmd "${NL_CWD}" true`) // Create an interval that will check for the proxy server installation finish const interval = setInterval(async () => { @@ -398,11 +398,11 @@ async function launchPrivate() { Neutralino.storage.setData('config', JSON.stringify(config)) // Pass IP and game folder to the private server launcher - createCmdWindow(`${NL_CWD}/scripts/private_server_launch.cmd ${ip} ${port} ${config.useHttps} "${config.gameexe}" "${NL_CWD}" ${config.enableKillswitch} true`).catch(e => console.log(e)) + createCmdWindow(`.\\scripts\\private_server_launch.cmd ${ip} ${port} ${config.useHttps} "${config.gameexe}" "${NL_CWD}" ${config.enableKillswitch} true`).catch(e => console.log(e)) } async function launchLocalServer() { const config = await getCfg() - createCmdWindow(`${NL_CWD}/scripts/local_server_launch.cmd "${config.serverFolder}"`).catch(e => console.log(e)) + createCmdWindow(`.\\scripts\\local_server_launch.cmd "${config.serverFolder}"`).catch(e => console.log(e)) } diff --git a/scripts/install.cmd b/scripts/install.cmd index 178f1a7..f023540 100644 --- a/scripts/install.cmd +++ b/scripts/install.cmd @@ -9,22 +9,22 @@ echo Downloading proxy server... cd "%ORIGIN%" if not exist "%ORIGIN%/ext" mkdir "%ORIGIN%/ext" -if not exist "%ORIGIN%/temp" mkdir "%ORIGIN%/temp" +if not exist "%ORIGIN%/temp" mkdir "%ORIGIN%/temp :: Begin by retrieving mitmproxy 7.0.4 -powershell Invoke-WebRequest -Uri https://snapshots.mitmproxy.org/7.0.4/mitmproxy-7.0.4-windows.zip -OutFile "%ORIGIN%/temp/mitmproxy-7.0.4-windows.zip" +powershell Invoke-WebRequest -Uri https://snapshots.mitmproxy.org/7.0.4/mitmproxy-7.0.4-windows.zip -OutFile "'%ORIGIN%/temp/mitmproxy-7.0.4-windows.zip'" echo Extracting... :: Extract from temp/ to ext/ with powershell -powershell Expand-Archive -Path "%ORIGIN%/temp/mitmproxy-7.0.4-windows.zip" -DestinationPath "%ORIGIN%/ext/" -Force +powershell Expand-Archive -Path "'%ORIGIN%/temp/mitmproxy-7.0.4-windows.zip'" -DestinationPath "'%ORIGIN%/ext/'" -Force del /s /q "%ORIGIN%/temp" echo Running proxy server in order to generate certificates... :: Start proxy server -start "Proxy Server" %ORIGIN%/ext/mitmdump.exe --ssl-insecure --set ip=%ip% +start "Proxy Server" "%ORIGIN%/ext/mitmdump.exe" --ssl-insecure --set ip=%ip% :: Allow the proxy server to create the certificates ping 127.0.0.1 -n 6 > nul diff --git a/scripts/private_server_launch.cmd b/scripts/private_server_launch.cmd index 787e5a0..ae0b3e6 100644 --- a/scripts/private_server_launch.cmd +++ b/scripts/private_server_launch.cmd @@ -38,7 +38,7 @@ reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v Pr reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "127.0.0.1:8080" /f >nul 2>nul :: Start proxy server -start "Proxy Server" %ORIGIN%/ext/mitmdump.exe -s "%ORIGIN%/proxy/proxy.py" --ssl-insecure --set ip=%IP% --set port=%PORT% --set use_https=%USE_HTTPS% +start "Proxy Server" "%ORIGIN%/ext/mitmdump.exe" -s "%ORIGIN%/proxy/proxy.py" --ssl-insecure --set ip=%IP% --set port=%PORT% --set use_https=%USE_HTTPS% echo Opening %GAME_PATH%