mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2024-12-29 21:18:17 +03:00
Several changes
- added slashes to the Download Stream curl command - fixed game pre-installation scripts
This commit is contained in:
parent
7088842f53
commit
df9d2f8a33
5 changed files with 19 additions and 10 deletions
|
@ -40,4 +40,4 @@
|
|||
"binaryVersion": "4.0.0",
|
||||
"clientVersion": "3.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import Process from '../neutralino/Process';
|
||||
import { DebugThread } from './Debug';
|
||||
import fetch from './Fetch';
|
||||
|
||||
|
@ -48,7 +49,7 @@ class Stream
|
|||
if (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, {
|
||||
background: true
|
||||
|
|
|
@ -65,17 +65,20 @@ export default class State
|
|||
this.predownloadButton.style['display'] = 'none';
|
||||
this.settingsButton.style['display'] = 'none';
|
||||
|
||||
const module = this._state === 'game-pre-installation-available' ?
|
||||
'Predownload' : 'PredownloadVoice';
|
||||
// We must specify this files here directly
|
||||
// because otherwise Vite will not bundle 'em
|
||||
const predownloadModule = import('./states/Predownload');
|
||||
const predownloadVoiceModule = import('./states/PredownloadVoice');
|
||||
|
||||
import(`./states/${module}`).then((module) => {
|
||||
module.default(this.launcher).then(() => {
|
||||
this.update().then(() => {
|
||||
this.launchButton.style['display'] = 'block';
|
||||
this.settingsButton.style['display'] = 'block';
|
||||
(this._state === 'game-pre-installation-available' ? predownloadModule : predownloadVoiceModule)
|
||||
.then((module) => {
|
||||
module.default(this.launcher).then(() => {
|
||||
this.update().then(() => {
|
||||
this.launchButton.style['display'] = 'block';
|
||||
this.settingsButton.style['display'] = 'block';
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
this.update().then(() => {
|
||||
|
|
|
@ -12,6 +12,8 @@ export default (launcher: Launcher): Promise<void> => {
|
|||
module.default(launcher).then(() => updateGame());
|
||||
});
|
||||
}
|
||||
|
||||
else updateGame();
|
||||
});
|
||||
|
||||
const updateGame = async () => {
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
import type Launcher from '../../Launcher';
|
||||
|
||||
import Voice from '../../Voice';
|
||||
import Game from '../../Game';
|
||||
|
||||
export default (launcher: Launcher, prevGameVersion: string|null = null): Promise<void> => {
|
||||
return new Promise(async (resolve) => {
|
||||
prevGameVersion ??= await Game.current;
|
||||
|
||||
Voice.predownloadUpdate(await Voice.selected, prevGameVersion).then((stream) => {
|
||||
launcher.progressBar?.init({
|
||||
label: 'Downloading voice package...',
|
||||
|
|
Loading…
Reference in a new issue