From 16504a499aec69179176e7728e73aeb43be44cb3 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Fri, 26 Nov 2021 21:41:56 +0200 Subject: [PATCH] Preparations to 1.6.1 release (part 3) - added roadmap goal (issue #35) - fixed issue with incorrect wine version unpacking --- README.md | 1 + src/ts/index.ts | 55 ++++++++++++++++++++++++++++--------------------- 2 files changed, 33 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 4f1cba9..a94947e 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,7 @@ npm start * Add winetricks auto-downloading when new prefix creates so it is no longer required *(1.6.0)* * DXVK logs auto-deletion option *(1.6.0)* * Add default wine version to download (Proton-6.20-GE-1) *(1.6.0)* +* Add winetricks and winecfg buttons to settings * Add dark theme support for settings menu * Fix button flickering at start when the launcher's state updates * Wine prefix folder selection *(symlinks?)* diff --git a/src/ts/index.ts b/src/ts/index.ts index d1eb501..3208308 100644 --- a/src/ts/index.ts +++ b/src/ts/index.ts @@ -95,34 +95,43 @@ $(() => { }); }); + /** + * Download wine version + */ LauncherUI.initProgressBar(); await Tools.downloadFile(defaultRunner.uri, path.join(constants.launcherDir, defaultRunner.name), (current: number, total: number, difference: number) => { LauncherUI.updateProgressBar(LauncherUI.i18n.translate('Downloading'), current, total, difference); - }).then(async () => { - const unpacker = defaultRunner.archive === 'tar' ? - Tools.untar : Tools.unzip; - - LauncherUI.initProgressBar(); - - await unpacker( - path.join(constants.launcherDir, defaultRunner.name), - defaultRunner.makeFolder ? - path.join(constants.runnersDir, defaultRunner.folder) : - constants.runnersDir, - (current: number, total: number, difference: number) => { - LauncherUI.updateProgressBar(LauncherUI.i18n.translate('Unpacking'), current, total, difference); - } - ).then(() => { - fs.unlinkSync(path.join(constants.launcherDir, defaultRunner.name)); - - LauncherLib.updateConfig('runner.name', defaultRunner.name); - LauncherLib.updateConfig('runner.folder', defaultRunner.folder); - LauncherLib.updateConfig('runner.executable', defaultRunner.executable); - - LauncherUI.clearProgressBar(); - }); }); + + /** + * Unpack it to the runners folder + */ + const unpacker = defaultRunner.archive === 'tar' ? + Tools.untar : Tools.unzip; + + LauncherUI.initProgressBar(); + + await unpacker( + path.join(constants.launcherDir, defaultRunner.name), + defaultRunner.makeFolder ? + path.join(constants.runnersDir, defaultRunner.folder) : + constants.runnersDir, + (current: number, total: number, difference: number) => { + LauncherUI.updateProgressBar(LauncherUI.i18n.translate('Unpacking'), current, total, difference); + } + ); + + /** + * And update config file with this runner + */ + fs.unlinkSync(path.join(constants.launcherDir, defaultRunner.name)); + + LauncherLib.updateConfig('runner.name', defaultRunner.name); + LauncherLib.updateConfig('runner.folder', defaultRunner.folder); + LauncherLib.updateConfig('runner.executable', defaultRunner.executable); + + LauncherUI.clearProgressBar(); } // Creating wine prefix