From 72ac08d0bd6ac7a0fb3706bb35e1433cea5de292 Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Mon, 25 Apr 2022 17:09:28 -0700 Subject: [PATCH] do not require admin for install script --- resources/js/index.js | 2 +- scripts/install.cmd | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/js/index.js b/resources/js/index.js index 999614e..0e9d8ae 100644 --- a/resources/js/index.js +++ b/resources/js/index.js @@ -283,7 +283,7 @@ async function closeFirstTimePopup() { } async function runInstallScript() { - Neutralino.os.execCommand(`${NL_CWD}/scripts/install.cmd "${NL_CWD}"`) + Neutralino.os.execCommand(`${NL_CWD}/scripts/install.cmd "${NL_CWD}" true`) // Create an interval that will check for the proxy server installation finish const interval = setInterval(async () => { diff --git a/scripts/install.cmd b/scripts/install.cmd index df02932..71d6c5c 100644 --- a/scripts/install.cmd +++ b/scripts/install.cmd @@ -2,11 +2,10 @@ set ORIGIN=%1 set ORIGIN=%ORIGIN:"=% +set OPEN_CONCUR=%2 -:: Ensure admin ->nul 2>&1 reg query "HKU\S-1-5-19" || ( - set params = %*:"="""% - cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && fsutil dirty query %systemdrive% 1>nul 2>nul || ( echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && %~s0 "%1" ", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B ) +if "%OPEN_CONCUR%" EQU "true" ( + cd /d "%~dp0" && ( if exist "%temp%\start.vbs" del "%temp%\start.vbs" ) && fsutil dirty query %systemdrive% 1>nul 2>nul || ( echo Set SHELL = CreateObject^("Shell.Application"^) : SHELL.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && %~s0 "%1" false", "", "", 1 >> "%temp%\start.vbs" && "%temp%\start.vbs" && exit /B ) ) echo Downloading proxy server... @@ -42,7 +41,8 @@ echo Adding ceritifcate... :: Ensure we are elevated for certs >nul 2>&1 certutil -addstore root %USERPROFILE%\.mitmproxy\mitmproxy-ca-cert.cer || ( - echo Certificate install failed, ensure the script is running as Administrator and that the path "%USERPROFILE%\.mitmproxy" exists, + echo Certificate install failed, ensure the script is running as Administrator and that the path "%USERPROFILE%\.mitmproxy" exists, + echo You can also manually run this command: certutil -addstore root %USERPROFILE%\.mitmproxy\mitmproxy-ca-cert.cer ) echo Done! You can now open GrassClipper.exe!