do not require elevation for install and ps scripts

This commit is contained in:
SpikeHD 2022-04-25 17:21:35 -07:00
parent 72ac08d0bd
commit 07ec74c5b3
2 changed files with 11 additions and 5 deletions

View File

@ -399,7 +399,7 @@ async function launchPrivate() {
Neutralino.storage.setData('config', JSON.stringify(config))
// Pass IP and game folder to the private server launcher
Neutralino.os.execCommand(`${NL_CWD}/scripts/private_server_launch.cmd ${ip} ${port} ${config.useHttps} "${config.gamefolder}/${await getGameExecName()}" "${NL_CWD}" ${config.enableKillswitch}`).catch(e => console.log(e))
Neutralino.os.execCommand(`${NL_CWD}/scripts/private_server_launch.cmd ${ip} ${port} ${config.useHttps} "${config.gamefolder}/${await getGameExecName()}" "${NL_CWD}" ${config.enableKillswitch} true`).catch(e => console.log(e))
}
async function launchLocalServer() {

View File

@ -1,9 +1,15 @@
@echo off
:: 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 %2 %3 "%4" ""%cd%"" %6", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B )
@REM >nul 2>&1 reg query "HKU\S-1-5-19" || (
@REM set params = %*:"="""%
@REM 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 %2 %3 "%4" ""%cd%"" %6", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B )
@REM )
set OPEN_CONCUR=%7
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 %2 %3 "%4" ""%cd%"" %6", "", "", 1 >> "%temp%\start.vbs" && "%temp%\start.vbs" && exit /B )
)
:: Use to force task kill
@ -70,7 +76,7 @@ reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v Pr
:: Kill proxy server
taskkill /f /im mitmdump.exe
echo Done! See you next time!
echo Done, see you next time
timeout /t 2 /nobreak >nul