From 7bef675ec32709928a984c534ce00ce4d31001ed Mon Sep 17 00:00:00 2001 From: Maroxy Date: Sat, 23 Oct 2021 14:17:08 +0200 Subject: [PATCH] Add check to make sure the patch gets applied --- src/ts/Genshinlib.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ts/Genshinlib.ts b/src/ts/Genshinlib.ts index 7c19d53..becd9b3 100644 --- a/src/ts/Genshinlib.ts +++ b/src/ts/Genshinlib.ts @@ -394,6 +394,16 @@ export class Genshinlib patcherProcess.stdout.on('data', (data: string) => onData(data)); patcherProcess.on('close', () => { + // Make sure that launcher.bat exists if not run patch.sh again. + if (!path.join(this.gameDir, 'launcher.bat')) + exec(`yes yes | ${path.join(patchDir, 'patch.sh')}`, { + cwd: this.gameDir, + env: { + ...process.env, + WINEPREFIX: this.prefixDir + } + }); + // Execute the patch file with "yes" in the beginning to agree to the choice. let patcherAntiCrashProcess = exec(`yes | ${path.join(patchDir, 'patch_anti_logincrash.sh')}`, { cwd: this.gameDir,