Several changes

- added slashes to the Download Stream curl command
- fixed game pre-installation scripts
This commit is contained in:
Observer KRypt0n_ 2021-12-31 11:21:26 +02:00
parent 7088842f53
commit df9d2f8a33
No known key found for this signature in database
GPG key ID: DC5D4EC1303465DA
5 changed files with 19 additions and 10 deletions

View file

@ -40,4 +40,4 @@
"binaryVersion": "4.0.0", "binaryVersion": "4.0.0",
"clientVersion": "3.0.0" "clientVersion": "3.0.0"
} }
} }

View file

@ -1,3 +1,4 @@
import Process from '../neutralino/Process';
import { DebugThread } from './Debug'; import { DebugThread } from './Debug';
import fetch from './Fetch'; import fetch from './Fetch';
@ -48,7 +49,7 @@ class Stream
if (this.onStart) if (this.onStart)
this.onStart(); this.onStart();
const command = `curl -s -L -N -o "${output}" "${uri}"`; const command = `curl -s -L -N -o '${Process.addSlashes(output)}' '${uri}'`;
Neutralino.os.execCommand(command, { Neutralino.os.execCommand(command, {
background: true background: true

View file

@ -65,17 +65,20 @@ export default class State
this.predownloadButton.style['display'] = 'none'; this.predownloadButton.style['display'] = 'none';
this.settingsButton.style['display'] = 'none'; this.settingsButton.style['display'] = 'none';
const module = this._state === 'game-pre-installation-available' ? // We must specify this files here directly
'Predownload' : 'PredownloadVoice'; // because otherwise Vite will not bundle 'em
const predownloadModule = import('./states/Predownload');
const predownloadVoiceModule = import('./states/PredownloadVoice');
import(`./states/${module}`).then((module) => { (this._state === 'game-pre-installation-available' ? predownloadModule : predownloadVoiceModule)
module.default(this.launcher).then(() => { .then((module) => {
this.update().then(() => { module.default(this.launcher).then(() => {
this.launchButton.style['display'] = 'block'; this.update().then(() => {
this.settingsButton.style['display'] = 'block'; this.launchButton.style['display'] = 'block';
this.settingsButton.style['display'] = 'block';
});
}); });
}); });
});
}; };
this.update().then(() => { this.update().then(() => {

View file

@ -12,6 +12,8 @@ export default (launcher: Launcher): Promise<void> => {
module.default(launcher).then(() => updateGame()); module.default(launcher).then(() => updateGame());
}); });
} }
else updateGame();
}); });
const updateGame = async () => { const updateGame = async () => {

View file

@ -1,9 +1,12 @@
import type Launcher from '../../Launcher'; import type Launcher from '../../Launcher';
import Voice from '../../Voice'; import Voice from '../../Voice';
import Game from '../../Game';
export default (launcher: Launcher, prevGameVersion: string|null = null): Promise<void> => { export default (launcher: Launcher, prevGameVersion: string|null = null): Promise<void> => {
return new Promise(async (resolve) => { return new Promise(async (resolve) => {
prevGameVersion ??= await Game.current;
Voice.predownloadUpdate(await Voice.selected, prevGameVersion).then((stream) => { Voice.predownloadUpdate(await Voice.selected, prevGameVersion).then((stream) => {
launcher.progressBar?.init({ launcher.progressBar?.init({
label: 'Downloading voice package...', label: 'Downloading voice package...',