mirror of
https://github.com/Grasscutters/GrassClipper.git
synced 2024-08-14 13:11:48 +08:00
get genshin exe regardless of name
This commit is contained in:
parent
4cf3575374
commit
803feb116e
@ -1 +0,0 @@
|
|||||||
{"accessToken":"5MwsrKLchb8OnvKTd7b00-wJDz6E-6MQbmre-TC7jiEs6mJs","port":57800}
|
|
@ -18,10 +18,10 @@ reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v Pr
|
|||||||
:: Start proxy server
|
:: Start proxy server
|
||||||
start "Proxy Server" ./ext/mitmdump.exe -s "./proxy/proxy.py" --ssl-insecure --set ip=%ip%
|
start "Proxy Server" ./ext/mitmdump.exe -s "./proxy/proxy.py" --ssl-insecure --set ip=%ip%
|
||||||
|
|
||||||
echo Opening %gamePath%/Genshin Impact Game/GenshinImpact.exe
|
echo Opening %gamePath%
|
||||||
|
|
||||||
:: Launch game
|
:: Launch game
|
||||||
"%gamePath%/Genshin Impact Game/GenshinImpact.exe"
|
"%gamePath%"
|
||||||
|
|
||||||
:: On exit clean proxy stuff
|
:: On exit clean proxy stuff
|
||||||
:EXIT
|
:EXIT
|
||||||
|
@ -75,10 +75,21 @@ async function setGenshinImpactFolder() {
|
|||||||
setBackgroundImage()
|
setBackgroundImage()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function getGenshinExecName() {
|
||||||
|
// Scan genshin dir
|
||||||
|
const config = await getCfg()
|
||||||
|
const genshinDir = await Neutralino.filesystem.readDirectory(config.genshinImpactFolder + '/Genshin Impact Game')
|
||||||
|
|
||||||
|
// Find the executable
|
||||||
|
const genshinExec = genshinDir.find(file => file.entry.endsWith('.exe'))
|
||||||
|
|
||||||
|
return genshinExec.entry
|
||||||
|
}
|
||||||
|
|
||||||
async function launchOfficial() {
|
async function launchOfficial() {
|
||||||
const config = await getCfg()
|
const config = await getCfg()
|
||||||
|
|
||||||
Neutralino.os.execCommand(config.genshinImpactFolder + '/Genshin Impact Game/GenshinImpact.exe')
|
Neutralino.os.execCommand(config.genshinImpactFolder + '/Genshin Impact Game/' + await getGenshinExecName())
|
||||||
}
|
}
|
||||||
|
|
||||||
async function launchPrivate() {
|
async function launchPrivate() {
|
||||||
@ -89,5 +100,5 @@ async function launchPrivate() {
|
|||||||
console.log('connecting to ' + ip)
|
console.log('connecting to ' + ip)
|
||||||
|
|
||||||
// Pass IP and game folder to the private server launcher
|
// Pass IP and game folder to the private server launcher
|
||||||
Neutralino.os.execCommand(`${NL_CWD}/private_server_launch.cmd ${ip} "${config.genshinImpactFolder}"`).catch(e => console.log(e))
|
Neutralino.os.execCommand(`${NL_CWD}/private_server_launch.cmd ${ip} "${config.genshinImpactFolder}/Genshin Impact Game/${await getGenshinExecName()}"`).catch(e => console.log(e))
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user