reorg and install script

This commit is contained in:
SpikeHD 2022-04-19 22:16:56 -07:00
parent 803feb116e
commit b018da2572
5 changed files with 32 additions and 3 deletions

1
.gitignore vendored
View File

@ -4,6 +4,7 @@ bin/
dist/
ext/
resources/js/neutralino.js
resources/bg
.storage/
.tmp/

26
install.cmd Normal file
View File

@ -0,0 +1,26 @@
@echo off
:: Ensure we are elevated for certs
>nul 2>&1 reg query "HKU\S-1-5-19" || (
echo Currently running with non Administrator privileges, raising...
echo set UAC = CreateObject^("Shell.Application"^) > "%temp%\UAC.vbs"
echo UAC.ShellExecute "%~f0", "%1", "", "runas", 1 >> "%temp%\UAC.vbs"
"%temp%\UAC.vbs"
del /f /q "%temp%\UAC.vbs" >nul 2>nul
exit /b
)
certutil -addstore root %USERPROFILE%\.mitmproxy\mitmproxy-ca-cert.cer
echo Downloading proxy server...
if not exist "./ext" mkdir "ext"
if not exist "./temp" mkdir "temp"
:: Begin by retrieving mitmproxy 8.0.0
powershell Invoke-WebRequest -Uri https://snapshots.mitmproxy.org/8.0.0/mitmproxy-8.0.0-windows.zip -OutFile "./temp/mitmproxy-8.0.0-windows.zip"
:: Extract from temp/ to ext/ with powershell
powershell Expand-Archive -Path "./temp/mitmproxy-8.0.0-windows.zip" -DestinationPath "./ext/" -Force
echo Done! You can now open

View File

@ -6,7 +6,9 @@
"license": "Apache-2.0",
"scripts": {
"dev": "neu run",
"build": "neu build && npm run move_files",
"move_files": "cp -r ./ext ./dist/GrassClipper && cp -r ./proxy ./dist/GrassClipper"
"build": "npm run clean_dist && neu build && npm run move_files && npm run rename_exe",
"move_files": "cp -r ./ext ./dist/GrassClipper && cp -r ./proxy ./dist/GrassClipper && cp install.cmd ./dist/GrassClipper && cp -r ./scripts ./dist/GrassClipper",
"rename_exe": "mv ./dist/GrassClipper/GrassClipper-win_x64.exe ./dist/GrassClipper/GrassClipper.exe",
"clean_dist": "rm -rf ./dist"
}
}

View File

@ -100,5 +100,5 @@ async function launchPrivate() {
console.log('connecting to ' + ip)
// Pass IP and game folder to the private server launcher
Neutralino.os.execCommand(`${NL_CWD}/private_server_launch.cmd ${ip} "${config.genshinImpactFolder}/Genshin Impact Game/${await getGenshinExecName()}"`).catch(e => console.log(e))
Neutralino.os.execCommand(`${NL_CWD}/scripts/private_server_launch.cmd ${ip} "${config.genshinImpactFolder}/Genshin Impact Game/${await getGenshinExecName()}"`).catch(e => console.log(e))
}