Preparations to 1.6.1 release

- fixed default runner installation
- disabled dxvk cache auto-deletion
This commit is contained in:
Observer KRypt0n_ 2021-11-26 19:53:37 +02:00
parent 22acf02f01
commit 0bc5910543
No known key found for this signature in database
GPG key ID: DC5D4EC1303465DA
18 changed files with 89 additions and 83 deletions

View file

@ -71,7 +71,7 @@ sudo pacman -Syu unzip tar git xdelta3
| --- | --- | | --- | --- |
| [MangoHud](https://github.com/flightlessmango/MangoHud) | To use MangoHud | | [MangoHud](https://github.com/flightlessmango/MangoHud) | To use MangoHud |
| [vkBasalt](https://github.com/DadSchoorse/vkBasalt) | To use shaders | | [vkBasalt](https://github.com/DadSchoorse/vkBasalt) | To use shaders |
| [GameMode](https://github.com/FeralInteractive/gamemode) | To use GameMode (performance optimisation) | | [GameMode](https://github.com/FeralInteractive/gamemode) | To use GameMode (performance optimization) |
| [switcheroo-control](https://gitlab.freedesktop.org/hadess/switcheroo-control/) | To select the GPU launcher should use to run the game | | [switcheroo-control](https://gitlab.freedesktop.org/hadess/switcheroo-control/) | To select the GPU launcher should use to run the game |
These requirements can't be easily installed so you should do it manually These requirements can't be easily installed so you should do it manually
@ -127,6 +127,7 @@ npm start
* <s>Add winetricks auto-downloading when new prefix creates so it is no longer required</s> *(1.6.0)* * <s>Add winetricks auto-downloading when new prefix creates so it is no longer required</s> *(1.6.0)*
* <s>DXVK logs auto-deletion option</s> *(1.6.0)* * <s>DXVK logs auto-deletion option</s> *(1.6.0)*
* <s>Add default wine version to download</s> (Proton-6.20-GE-1) *(1.6.0)* * <s>Add default wine version to download</s> (Proton-6.20-GE-1) *(1.6.0)*
* Add dark theme support for settings menu
* Fix button flickering at start when the launcher's state updates * Fix button flickering at start when the launcher's state updates
* Wine prefix folder selection *(symlinks?)* * Wine prefix folder selection *(symlinks?)*
* Game's update pre-installation * Game's update pre-installation

View file

@ -31,7 +31,7 @@
"hours": "Stunden und", "hours": "Stunden und",
"minutes": "Minuten gespielt", "minutes": "Minuten gespielt",
"Downloading": "wird Heruntergeladen", "Downloading": "wird Heruntergeladen",
"Unpack": "wird Entpackt", "Unpacking": "wird Entpackt",
"GameDownloaded": "Spiel würde erfolgreich heruntergeladen", "GameDownloaded": "Spiel würde erfolgreich heruntergeladen",
"ApplyPatch": "Patch wird angewendet", "ApplyPatch": "Patch wird angewendet",
"PatchRequired": "Patch nicht verfügbar", "PatchRequired": "Patch nicht verfügbar",

View file

@ -31,7 +31,7 @@
"YouPlayedFor": "You've played for", "YouPlayedFor": "You've played for",
"hours": "hours", "hours": "hours",
"minutes": "minutes", "minutes": "minutes",
"Unpack": "Unpacking", "Unpacking": "Unpacking",
"GameDownloaded": "Game was successfully installed", "GameDownloaded": "Game was successfully installed",
"ApplyPatch": "Applying patch...", "ApplyPatch": "Applying patch...",
"PatchRequired": "Patch required", "PatchRequired": "Patch required",

View file

@ -31,7 +31,7 @@
"hours": "hours", "hours": "hours",
"minutes": "minutes", "minutes": "minutes",
"Downloading": "Downloading", "Downloading": "Downloading",
"Unpack": "Unpacking", "Unpacking": "Unpacking",
"GameDownloaded": "Game was successfully installed", "GameDownloaded": "Game was successfully installed",
"ApplyPatch": "Applying patch...", "ApplyPatch": "Applying patch...",
"PatchRequired": "Patch required", "PatchRequired": "Patch required",

View file

@ -31,7 +31,7 @@
"hours": "hours", "hours": "hours",
"minutes": "minutes", "minutes": "minutes",
"Downloading": "Downloading", "Downloading": "Downloading",
"Unpack": "Unpacking", "Unpacking": "Unpacking",
"GameDownloaded": "Game was successfully installed", "GameDownloaded": "Game was successfully installed",
"ApplyPatch": "Applying patch...", "ApplyPatch": "Applying patch...",
"PatchRequired": "Patch required", "PatchRequired": "Patch required",

View file

@ -31,7 +31,7 @@
"hours": "hours", "hours": "hours",
"minutes": "minutes", "minutes": "minutes",
"Downloading": "Downloading", "Downloading": "Downloading",
"Unpack": "Unpacking", "Unpacking": "Unpacking",
"GameDownloaded": "Game was successfully installed", "GameDownloaded": "Game was successfully installed",
"ApplyPatch": "Applying patch...", "ApplyPatch": "Applying patch...",
"PatchRequired": "Patch required", "PatchRequired": "Patch required",

View file

@ -31,7 +31,7 @@
"hours": "jam", "hours": "jam",
"minutes": "menit", "minutes": "menit",
"Downloading": "Mengunduh", "Downloading": "Mengunduh",
"Unpack": "Membuka paket", "Unpacking": "Membuka paket",
"GameDownloaded": "Game berhasil dipasang", "GameDownloaded": "Game berhasil dipasang",
"ApplyPatch": "Memasang patch...", "ApplyPatch": "Memasang patch...",
"PatchRequired": "Patch dibutuhkan", "PatchRequired": "Patch dibutuhkan",

View file

@ -31,7 +31,7 @@
"YouPlayedFor": "あなたはのためにプレーしてきました", "YouPlayedFor": "あなたはのためにプレーしてきました",
"hours": "時間", "hours": "時間",
"minutes": "分", "minutes": "分",
"Unpack": "開梱", "Unpacking": "開梱",
"GameDownloaded": "ゲームのインストールに成功しました", "GameDownloaded": "ゲームのインストールに成功しました",
"ApplyPatch": "パッチの適用...", "ApplyPatch": "パッチの適用...",
"PatchRequired": "要パッチ", "PatchRequired": "要パッチ",

View file

@ -31,7 +31,7 @@
"hours": "시간", "hours": "시간",
"minutes": "분", "minutes": "분",
"Downloading": "다운로드 중", "Downloading": "다운로드 중",
"Unpack": "풀기", "Unpacking": "풀기",
"GameDownloaded": "게임이 성공적으로 설치되었습니다", "GameDownloaded": "게임이 성공적으로 설치되었습니다",
"ApplyPatch": "패치 적용...", "ApplyPatch": "패치 적용...",
"PatchRequired": "패치 필요", "PatchRequired": "패치 필요",

View file

@ -31,7 +31,7 @@
"hours": "hours", "hours": "hours",
"minutes": "minutes", "minutes": "minutes",
"Downloading": "Downloading", "Downloading": "Downloading",
"Unpack": "Unpacking", "Unpacking": "Unpacking",
"GameDownloaded": "Game was successfully installed", "GameDownloaded": "Game was successfully installed",
"ApplyPatch": "Applying patch...", "ApplyPatch": "Applying patch...",
"PatchRequired": "Patch required", "PatchRequired": "Patch required",

View file

@ -31,7 +31,7 @@
"hours": "часов", "hours": "часов",
"minutes": "минут", "minutes": "минут",
"Downloading": "Загрузка", "Downloading": "Загрузка",
"Unpack": "Распаковка", "Unpacking": "Распаковка",
"GameDownloaded": "Игра была успешно установлена", "GameDownloaded": "Игра была успешно установлена",
"ApplyPatch": "Применение патча...", "ApplyPatch": "Применение патча...",
"PatchRequired": "Необходим патч", "PatchRequired": "Необходим патч",

View file

@ -31,7 +31,7 @@
"hours": "hours", "hours": "hours",
"minutes": "minutes", "minutes": "minutes",
"Downloading": "Downloading", "Downloading": "Downloading",
"Unpack": "Unpacking", "Unpacking": "Unpacking",
"GameDownloaded": "Game was successfully installed", "GameDownloaded": "Game was successfully installed",
"ApplyPatch": "Applying patch...", "ApplyPatch": "Applying patch...",
"PatchRequired": "Patch required", "PatchRequired": "Patch required",

View file

@ -31,7 +31,7 @@
"hours": "hours", "hours": "hours",
"minutes": "minutes", "minutes": "minutes",
"Downloading": "Downloading", "Downloading": "Downloading",
"Unpack": "Unpacking", "Unpacking": "Unpacking",
"GameDownloaded": "Game was successfully installed", "GameDownloaded": "Game was successfully installed",
"ApplyPatch": "Applying patch...", "ApplyPatch": "Applying patch...",
"PatchRequired": "Patch required", "PatchRequired": "Patch required",

View file

@ -31,7 +31,7 @@
"YouPlayedFor": "You've played for", "YouPlayedFor": "You've played for",
"hours": "hours", "hours": "hours",
"minutes": "minutes", "minutes": "minutes",
"Unpack": "开箱", "Unpacking": "开箱",
"GameDownloaded": "游戏安装成功", "GameDownloaded": "游戏安装成功",
"ApplyPatch": "应用补丁...", "ApplyPatch": "应用补丁...",
"PatchRequired": "需要补丁", "PatchRequired": "需要补丁",

View file

@ -31,7 +31,7 @@
"YouPlayedFor": "You've played for", "YouPlayedFor": "You've played for",
"hours": "hours", "hours": "hours",
"minutes": "minutes", "minutes": "minutes",
"Unpack": "解壓縮中...", "Unpacking": "解壓縮中...",
"GameDownloaded": "遊戲安裝成功", "GameDownloaded": "遊戲安裝成功",
"ApplyPatch": "套用補丁...", "ApplyPatch": "套用補丁...",
"PatchRequired": "需要補丁", "PatchRequired": "需要補丁",

View file

@ -4,6 +4,7 @@ const { exec } = require('child_process');
const { ipcRenderer } = require('electron'); const { ipcRenderer } = require('electron');
const semver = require('semver'); const semver = require('semver');
const commandExists = require('command-exists').sync;
import $ from 'cash-dom'; import $ from 'cash-dom';
@ -78,6 +79,52 @@ $(() => {
await LauncherUI.updateLauncherState(data); await LauncherUI.updateLauncherState(data);
$('#launch').on('click', async () => { $('#launch').on('click', async () => {
// Download default wine if we
// don'thave wine or any runner installed
if (LauncherLib.getConfig('runner') === null && !commandExists('wine'))
{
const runners = await LauncherLib.getRunners();
let defaultRunner = runners[0].runners[0];
// Search defaul runner to download (Proton-6.20-GE-1)
runners.forEach(category => {
category.runners.forEach(runner => {
if (runner.name == 'Proton-6.20-GE-1')
defaultRunner = runner;
});
});
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();
});
});
}
// Creating wine prefix // Creating wine prefix
if (!LauncherLib.isPrefixInstalled(constants.prefixDir)) if (!LauncherLib.isPrefixInstalled(constants.prefixDir))
{ {
@ -240,8 +287,8 @@ $(() => {
{ {
const removeExts = [ const removeExts = [
'.log', '.log',
'.dxvk-cache', '.dmp',
'.dmp' // '.dxvk-cache'
]; ];
fs.readdirSync(constants.gameDir).forEach((file: string) => { fs.readdirSync(constants.gameDir).forEach((file: string) => {
@ -276,44 +323,6 @@ $(() => {
}, data => console.log(data.toString())); }, data => console.log(data.toString()));
} }
// Download default wine because we don't have it
else if (LauncherUI.launcherState == 'wine-installation-required')
{
const runners = await LauncherLib.getRunners();
let defaultRunner = runners[0].runners[0];
// Search defaul runner to download (Proton-6.20-GE-1)
runners.forEach(category => {
category.runners.forEach(runner => {
if (runner.name == 'Proton-6.20-GE-1')
defaultRunner = runner;
});
});
LauncherUI.setState('wine-installing');
Tools.downloadFile(defaultRunner.uri, path.join(constants.launcherDir, defaultRunner.name)).then(() => {
const unpacker = defaultRunner.archive === 'tar' ?
Tools.untar : Tools.unzip;
unpacker(
path.join(constants.launcherDir, defaultRunner.name),
defaultRunner.makeFolder ?
path.join(constants.runnersDir, defaultRunner.folder) :
constants.runnersDir
).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.updateLauncherState();
});
});
}
// Voice pack update // Voice pack update
else if (LauncherUI.launcherState == 'game-voice-update-required') else if (LauncherUI.launcherState == 'game-voice-update-required')
{ {
@ -367,7 +376,7 @@ $(() => {
LauncherUI.initProgressBar(); LauncherUI.initProgressBar();
Tools.unzip(path.join(constants.launcherDir, voicePack.name), constants.gameDir, (current: number, total: number, difference: number) => { Tools.unzip(path.join(constants.launcherDir, voicePack.name), constants.gameDir, (current: number, total: number, difference: number) => {
LauncherUI.updateProgressBar(LauncherUI.i18n.translate('Unpack'), current, total, difference); LauncherUI.updateProgressBar(LauncherUI.i18n.translate('Unpacking'), current, total, difference);
}).then(() => { }).then(() => {
fs.unlinkSync(path.join(constants.launcherDir, voicePack.name)); fs.unlinkSync(path.join(constants.launcherDir, voicePack.name));
@ -427,7 +436,7 @@ $(() => {
LauncherUI.initProgressBar(); LauncherUI.initProgressBar();
Tools.unzip(path.join(constants.launcherDir, diff.name), constants.gameDir, (current: number, total: number, difference: number) => { Tools.unzip(path.join(constants.launcherDir, diff.name), constants.gameDir, (current: number, total: number, difference: number) => {
LauncherUI.updateProgressBar(LauncherUI.i18n.translate('Unpack'), current, total, difference); LauncherUI.updateProgressBar(LauncherUI.i18n.translate('Unpacking'), current, total, difference);
}).then(() => { }).then(() => {
/** /**
* Downloading voice data * Downloading voice data
@ -461,7 +470,7 @@ $(() => {
LauncherUI.initProgressBar(); LauncherUI.initProgressBar();
Tools.unzip(path.join(constants.launcherDir, voicePack.name), constants.gameDir, (current: number, total: number, difference: number) => { Tools.unzip(path.join(constants.launcherDir, voicePack.name), constants.gameDir, (current: number, total: number, difference: number) => {
LauncherUI.updateProgressBar(LauncherUI.i18n.translate('Unpack'), current, total, difference); LauncherUI.updateProgressBar(LauncherUI.i18n.translate('Unpacking'), current, total, difference);
}).then(() => { }).then(() => {
fs.unlinkSync(path.join(constants.launcherDir, voicePack.name)); fs.unlinkSync(path.join(constants.launcherDir, voicePack.name));

View file

@ -10,6 +10,7 @@ const { spawn, exec } = require('child_process');
const store = require('electron-store'); const store = require('electron-store');
const https = require('follow-redirects').https; const https = require('follow-redirects').https;
const got = require('got'); const got = require('got');
const commandExists = require('command-exists').sync;
const config = new store ({ const config = new store ({
cwd: path.join(os.homedir(), '.local', 'share', 'anime-game-launcher'), cwd: path.join(os.homedir(), '.local', 'share', 'anime-game-launcher'),
@ -225,7 +226,7 @@ export default class LauncherLib
} }
// WINEPREFIX='...../wineprefix' winetricks corefonts usetakefocus=n // WINEPREFIX='...../wineprefix' winetricks corefonts usetakefocus=n
public static async installPrefix (prefixpath: string, progress: (output: string, current: number, total: number) => void): Promise<void> public static async installPrefix (prefixPath: string, progress: (output: string, current: number, total: number) => void): Promise<void>
{ {
const installationSteps = [ const installationSteps = [
// corefonts // corefonts
@ -252,11 +253,25 @@ export default class LauncherLib
Tools.downloadFile(constants.uri.winetricks, winetricksSh).then(() => { Tools.downloadFile(constants.uri.winetricks, winetricksSh).then(() => {
let installationProgress = 0; let installationProgress = 0;
let installerProcess = spawn('bash', [winetricksSh, 'corefonts', 'usetakefocus=n'], { let env: any = {
env: {
...process.env, ...process.env,
WINEPREFIX: prefixpath WINEPREFIX: prefixPath
};
if (!commandExists('wine') && LauncherLib.getConfig('runner') !== null)
{
env['WINE'] = path.join(
constants.runnersDir,
LauncherLib.getConfig('runner.folder'),
LauncherLib.getConfig('runner.executable')
);
if (!fs.existsSync(env['WINE']))
console.error(`Patcher supposed to use ${LauncherLib.getConfig('runner.name')} runner, but it doesn't installed`);
} }
const installerProcess = spawn('bash', [winetricksSh, 'corefonts', 'usetakefocus=n'], {
env: env
}); });
installerProcess.stdout.on('data', (data: string) => { installerProcess.stdout.on('data', (data: string) => {

View file

@ -6,8 +6,6 @@ import i18n from './i18n';
import Tools from './Tools'; import Tools from './Tools';
import Colors from './Colors'; import Colors from './Colors';
const commandExists = require('command-exists').sync;
type LauncherState = type LauncherState =
'patch-unavailable' | 'patch-unavailable' |
'test-patch-available' | 'test-patch-available' |
@ -15,8 +13,6 @@ type LauncherState =
'game-update-available' | 'game-update-available' |
'game-installation-available' | 'game-installation-available' |
'game-voice-update-required' | 'game-voice-update-required' |
'wine-installation-required' |
'wine-installing' |
'game-launch-available'; 'game-launch-available';
export default class LauncherUI export default class LauncherUI
@ -87,17 +83,6 @@ export default class LauncherUI
break; break;
case 'wine-installation-required':
$('#launch').text(this.i18n.translate('DownloadWine'));
break;
case 'wine-installing':
$('#launch').text(this.i18n.translate('Downloading'));
$('#launch').attr('disabled', 'disabled');
break;
case 'game-launch-available': case 'game-launch-available':
$('#launch').removeAttr('disabled') $('#launch').removeAttr('disabled')
.removeAttr('data-hint'); .removeAttr('data-hint');
@ -169,10 +154,6 @@ export default class LauncherUI
}, data => console.log(data.toString())); }, data => console.log(data.toString()));
} }
// If we don't have wine or any runner installed
else if (LauncherLib.getConfig('runner') === null && !commandExists('wine'))
this.setState('wine-installation-required');
else this.setState('game-launch-available'); else this.setState('game-launch-available');
} }