mirror of
https://github.com/Grasscutters/GrassClipper.git
synced 2024-11-22 07:08:11 +00:00
fix some script related issues
This commit is contained in:
parent
ea1cdd76e1
commit
82b667b83b
@ -2,6 +2,9 @@ Neutralino.init();
|
||||
|
||||
let localeObj;
|
||||
const filesystem = Neutralino.filesystem
|
||||
const createCmdWindow = async (command) => {
|
||||
Neutralino.os.execCommand(`cmd.exe /c start ${command}`, { background: true })
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable play buttons
|
||||
@ -283,7 +286,7 @@ async function closeFirstTimePopup() {
|
||||
}
|
||||
|
||||
async function runInstallScript() {
|
||||
Neutralino.os.execCommand(`${NL_CWD}/scripts/install.cmd "${NL_CWD}" true`)
|
||||
createCmdWindow(`${NL_CWD}/scripts/install.cmd "${NL_CWD}" true`)
|
||||
|
||||
// Create an interval that will check for the proxy server installation finish
|
||||
const interval = setInterval(async () => {
|
||||
@ -380,7 +383,7 @@ async function setGrasscutterFolder() {
|
||||
async function launchOfficial() {
|
||||
const config = await getCfg()
|
||||
|
||||
Neutralino.os.execCommand(config.gamefolder + '/' + await getGameExecName())
|
||||
createCmdWindow(config.gamefolder + '/' + await getGameExecName())
|
||||
}
|
||||
|
||||
/**
|
||||
@ -399,11 +402,11 @@ 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} true`).catch(e => console.log(e))
|
||||
createCmdWindow(`${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() {
|
||||
const config = await getCfg()
|
||||
|
||||
Neutralino.os.execCommand(`${NL_CWD}/scripts/local_server_launch.cmd "${config.serverFolder}"`).catch(e => console.log(e))
|
||||
createCmdWindow(`${NL_CWD}/scripts/local_server_launch.cmd "${config.serverFolder}"`).catch(e => console.log(e))
|
||||
}
|
||||
|
@ -2,11 +2,6 @@
|
||||
|
||||
set ORIGIN=%1
|
||||
set ORIGIN=%ORIGIN:"=%
|
||||
set OPEN_CONCUR=%2
|
||||
|
||||
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...
|
||||
|
||||
|
@ -6,12 +6,6 @@
|
||||
@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
|
||||
title PS Launcher Script
|
||||
|
||||
@ -86,7 +80,7 @@ taskkill /f /im mitmdump.exe
|
||||
|
||||
echo Done, see you next time
|
||||
|
||||
timeout /t 2 /nobreak >nul
|
||||
timeout.exe /t 2 /nobreak >nul
|
||||
|
||||
taskkill /f /fi "WINDOWTITLE eq Administrator: PS Launcher Script" || taskkill /f /fi "WINDOWTITLE eq PS Launcher Script"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user