From 7088842f53236fd03555a8e2cb866e1eab82a321 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Thu, 30 Dec 2021 15:04:09 +0200 Subject: [PATCH] Fixed prefix creation - `Prefix.getWinetricks()` now makes `winetricks.sh` executable - added test patch hint - fixed `Install` script error with game updating - fixed `InstallWine` and `InstallDXVK` scripts work now they select installed things in config file --- src/index.svelte | 2 +- src/ts/core/Prefix.ts | 6 +++++- src/ts/launcher/State.ts | 3 ++- src/ts/launcher/states/Install.ts | 7 ++++++- src/ts/launcher/states/InstallDXVK.ts | 4 ++++ src/ts/launcher/states/InstallWine.ts | 5 ++++- 6 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/index.svelte b/src/index.svelte index 92a3909..95f4fd5 100644 --- a/src/index.svelte +++ b/src/index.svelte @@ -92,5 +92,5 @@ Download - + diff --git a/src/ts/core/Prefix.ts b/src/ts/core/Prefix.ts index 2ec01ed..74f2605 100644 --- a/src/ts/core/Prefix.ts +++ b/src/ts/core/Prefix.ts @@ -51,7 +51,11 @@ export default class Prefix .then(() => resolve(winetricksPath)) .catch(() => { Downloader.download(constants.uri.winetricks, winetricksPath).then((stream) => { - stream.finish(() => resolve(winetricksPath)); + stream.finish(async () => { + await Neutralino.os.execCommand(`chmod +x '${Process.addSlashes(winetricksPath)}'`); + + resolve(winetricksPath); + }); }); }); }); diff --git a/src/ts/launcher/State.ts b/src/ts/launcher/State.ts index 36cef7b..b98f719 100644 --- a/src/ts/launcher/State.ts +++ b/src/ts/launcher/State.ts @@ -145,9 +145,10 @@ export default class State break; case 'test-patch-available': - // todo some warning message this.launchButton.textContent = 'Apply test patch'; + this.launchButton.setAttribute('aria-label', 'This game version has an anti-cheat patch, but it is in the testing phase. You can wait a few days until it is stable or apply it at your own risk'); + break; case 'patch-unavailable': diff --git a/src/ts/launcher/states/Install.ts b/src/ts/launcher/states/Install.ts index c48492a..34480e9 100644 --- a/src/ts/launcher/states/Install.ts +++ b/src/ts/launcher/states/Install.ts @@ -2,16 +2,21 @@ import type Launcher from '../../Launcher'; import Game from '../../Game'; import Prefix from '../../core/Prefix'; +import constants from '../../Constants'; export default (launcher: Launcher): Promise => { return new Promise(async (resolve) => { - Prefix.exists().then((exists) => { + const prefixDir = await constants.paths.prefix.current; + + Prefix.exists(prefixDir).then((exists) => { if (!exists) { import('./CreatePrefix').then((module) => { module.default(launcher).then(() => updateGame()); }); } + + else updateGame(); }); const updateGame = async () => { diff --git a/src/ts/launcher/states/InstallDXVK.ts b/src/ts/launcher/states/InstallDXVK.ts index 59adb0f..5123975 100644 --- a/src/ts/launcher/states/InstallDXVK.ts +++ b/src/ts/launcher/states/InstallDXVK.ts @@ -43,6 +43,10 @@ export default (launcher: Launcher): Promise => { stream?.unpackFinish(async () => { unpacking = true; + // Select this DXVK + await DXVK.current('1.9.2'); + + // And apply it DXVK.apply(await constants.paths.prefix.current, '1.9.2').then(() => { launcher.progressBar?.hide(); diff --git a/src/ts/launcher/states/InstallWine.ts b/src/ts/launcher/states/InstallWine.ts index 36cb190..2f2557b 100644 --- a/src/ts/launcher/states/InstallWine.ts +++ b/src/ts/launcher/states/InstallWine.ts @@ -34,7 +34,10 @@ export default (launcher: Launcher): Promise => { launcher.progressBar?.update(current, total, difference); }); - stream?.unpackFinish(() => { + stream?.unpackFinish(async () => { + // Select this runner + await Runners.current('lutris-ge-6.21-1-x86_64'); + // Create prefix if it is not created import('./CreatePrefix').then((module) => { module.default(launcher).then(() => {