mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2024-12-24 10:38:14 +03:00
Preparations to 1.6.1 release
- fixed default runner installation - disabled dxvk cache auto-deletion
This commit is contained in:
parent
22acf02f01
commit
0bc5910543
18 changed files with 89 additions and 83 deletions
|
@ -71,7 +71,7 @@ sudo pacman -Syu unzip tar git xdelta3
|
|||
| --- | --- |
|
||||
| [MangoHud](https://github.com/flightlessmango/MangoHud) | To use MangoHud |
|
||||
| [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 |
|
||||
|
||||
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>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)*
|
||||
* Add dark theme support for settings menu
|
||||
* Fix button flickering at start when the launcher's state updates
|
||||
* Wine prefix folder selection *(symlinks?)*
|
||||
* Game's update pre-installation
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
"hours": "Stunden und",
|
||||
"minutes": "Minuten gespielt",
|
||||
"Downloading": "wird Heruntergeladen",
|
||||
"Unpack": "wird Entpackt",
|
||||
"Unpacking": "wird Entpackt",
|
||||
"GameDownloaded": "Spiel würde erfolgreich heruntergeladen",
|
||||
"ApplyPatch": "Patch wird angewendet",
|
||||
"PatchRequired": "Patch nicht verfügbar",
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
"YouPlayedFor": "You've played for",
|
||||
"hours": "hours",
|
||||
"minutes": "minutes",
|
||||
"Unpack": "Unpacking",
|
||||
"Unpacking": "Unpacking",
|
||||
"GameDownloaded": "Game was successfully installed",
|
||||
"ApplyPatch": "Applying patch...",
|
||||
"PatchRequired": "Patch required",
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
"hours": "hours",
|
||||
"minutes": "minutes",
|
||||
"Downloading": "Downloading",
|
||||
"Unpack": "Unpacking",
|
||||
"Unpacking": "Unpacking",
|
||||
"GameDownloaded": "Game was successfully installed",
|
||||
"ApplyPatch": "Applying patch...",
|
||||
"PatchRequired": "Patch required",
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
"hours": "hours",
|
||||
"minutes": "minutes",
|
||||
"Downloading": "Downloading",
|
||||
"Unpack": "Unpacking",
|
||||
"Unpacking": "Unpacking",
|
||||
"GameDownloaded": "Game was successfully installed",
|
||||
"ApplyPatch": "Applying patch...",
|
||||
"PatchRequired": "Patch required",
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
"hours": "hours",
|
||||
"minutes": "minutes",
|
||||
"Downloading": "Downloading",
|
||||
"Unpack": "Unpacking",
|
||||
"Unpacking": "Unpacking",
|
||||
"GameDownloaded": "Game was successfully installed",
|
||||
"ApplyPatch": "Applying patch...",
|
||||
"PatchRequired": "Patch required",
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
"hours": "jam",
|
||||
"minutes": "menit",
|
||||
"Downloading": "Mengunduh",
|
||||
"Unpack": "Membuka paket",
|
||||
"Unpacking": "Membuka paket",
|
||||
"GameDownloaded": "Game berhasil dipasang",
|
||||
"ApplyPatch": "Memasang patch...",
|
||||
"PatchRequired": "Patch dibutuhkan",
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
"YouPlayedFor": "あなたはのためにプレーしてきました",
|
||||
"hours": "時間",
|
||||
"minutes": "分",
|
||||
"Unpack": "開梱",
|
||||
"Unpacking": "開梱",
|
||||
"GameDownloaded": "ゲームのインストールに成功しました",
|
||||
"ApplyPatch": "パッチの適用...",
|
||||
"PatchRequired": "要パッチ",
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
"hours": "시간",
|
||||
"minutes": "분",
|
||||
"Downloading": "다운로드 중",
|
||||
"Unpack": "풀기",
|
||||
"Unpacking": "풀기",
|
||||
"GameDownloaded": "게임이 성공적으로 설치되었습니다",
|
||||
"ApplyPatch": "패치 적용...",
|
||||
"PatchRequired": "패치 필요",
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
"hours": "hours",
|
||||
"minutes": "minutes",
|
||||
"Downloading": "Downloading",
|
||||
"Unpack": "Unpacking",
|
||||
"Unpacking": "Unpacking",
|
||||
"GameDownloaded": "Game was successfully installed",
|
||||
"ApplyPatch": "Applying patch...",
|
||||
"PatchRequired": "Patch required",
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
"hours": "часов",
|
||||
"minutes": "минут",
|
||||
"Downloading": "Загрузка",
|
||||
"Unpack": "Распаковка",
|
||||
"Unpacking": "Распаковка",
|
||||
"GameDownloaded": "Игра была успешно установлена",
|
||||
"ApplyPatch": "Применение патча...",
|
||||
"PatchRequired": "Необходим патч",
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
"hours": "hours",
|
||||
"minutes": "minutes",
|
||||
"Downloading": "Downloading",
|
||||
"Unpack": "Unpacking",
|
||||
"Unpacking": "Unpacking",
|
||||
"GameDownloaded": "Game was successfully installed",
|
||||
"ApplyPatch": "Applying patch...",
|
||||
"PatchRequired": "Patch required",
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
"hours": "hours",
|
||||
"minutes": "minutes",
|
||||
"Downloading": "Downloading",
|
||||
"Unpack": "Unpacking",
|
||||
"Unpacking": "Unpacking",
|
||||
"GameDownloaded": "Game was successfully installed",
|
||||
"ApplyPatch": "Applying patch...",
|
||||
"PatchRequired": "Patch required",
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
"YouPlayedFor": "You've played for",
|
||||
"hours": "hours",
|
||||
"minutes": "minutes",
|
||||
"Unpack": "开箱",
|
||||
"Unpacking": "开箱",
|
||||
"GameDownloaded": "游戏安装成功",
|
||||
"ApplyPatch": "应用补丁...",
|
||||
"PatchRequired": "需要补丁",
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
"YouPlayedFor": "You've played for",
|
||||
"hours": "hours",
|
||||
"minutes": "minutes",
|
||||
"Unpack": "解壓縮中...",
|
||||
"Unpacking": "解壓縮中...",
|
||||
"GameDownloaded": "遊戲安裝成功",
|
||||
"ApplyPatch": "套用補丁...",
|
||||
"PatchRequired": "需要補丁",
|
||||
|
|
|
@ -4,6 +4,7 @@ const { exec } = require('child_process');
|
|||
const { ipcRenderer } = require('electron');
|
||||
|
||||
const semver = require('semver');
|
||||
const commandExists = require('command-exists').sync;
|
||||
|
||||
import $ from 'cash-dom';
|
||||
|
||||
|
@ -78,6 +79,52 @@ $(() => {
|
|||
await LauncherUI.updateLauncherState(data);
|
||||
|
||||
$('#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
|
||||
if (!LauncherLib.isPrefixInstalled(constants.prefixDir))
|
||||
{
|
||||
|
@ -240,8 +287,8 @@ $(() => {
|
|||
{
|
||||
const removeExts = [
|
||||
'.log',
|
||||
'.dxvk-cache',
|
||||
'.dmp'
|
||||
'.dmp',
|
||||
// '.dxvk-cache'
|
||||
];
|
||||
|
||||
fs.readdirSync(constants.gameDir).forEach((file: string) => {
|
||||
|
@ -276,44 +323,6 @@ $(() => {
|
|||
}, 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
|
||||
else if (LauncherUI.launcherState == 'game-voice-update-required')
|
||||
{
|
||||
|
@ -367,7 +376,7 @@ $(() => {
|
|||
LauncherUI.initProgressBar();
|
||||
|
||||
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(() => {
|
||||
fs.unlinkSync(path.join(constants.launcherDir, voicePack.name));
|
||||
|
||||
|
@ -427,7 +436,7 @@ $(() => {
|
|||
LauncherUI.initProgressBar();
|
||||
|
||||
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(() => {
|
||||
/**
|
||||
* Downloading voice data
|
||||
|
@ -461,7 +470,7 @@ $(() => {
|
|||
LauncherUI.initProgressBar();
|
||||
|
||||
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(() => {
|
||||
fs.unlinkSync(path.join(constants.launcherDir, voicePack.name));
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ const { spawn, exec } = require('child_process');
|
|||
const store = require('electron-store');
|
||||
const https = require('follow-redirects').https;
|
||||
const got = require('got');
|
||||
const commandExists = require('command-exists').sync;
|
||||
|
||||
const config = new store ({
|
||||
cwd: path.join(os.homedir(), '.local', 'share', 'anime-game-launcher'),
|
||||
|
@ -225,7 +226,7 @@ export default class LauncherLib
|
|||
}
|
||||
|
||||
// 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 = [
|
||||
// corefonts
|
||||
|
@ -252,11 +253,25 @@ export default class LauncherLib
|
|||
Tools.downloadFile(constants.uri.winetricks, winetricksSh).then(() => {
|
||||
let installationProgress = 0;
|
||||
|
||||
let installerProcess = spawn('bash', [winetricksSh, 'corefonts', 'usetakefocus=n'], {
|
||||
env: {
|
||||
...process.env,
|
||||
WINEPREFIX: prefixpath
|
||||
}
|
||||
let env: any = {
|
||||
...process.env,
|
||||
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) => {
|
||||
|
|
|
@ -6,8 +6,6 @@ import i18n from './i18n';
|
|||
import Tools from './Tools';
|
||||
import Colors from './Colors';
|
||||
|
||||
const commandExists = require('command-exists').sync;
|
||||
|
||||
type LauncherState =
|
||||
'patch-unavailable' |
|
||||
'test-patch-available' |
|
||||
|
@ -15,8 +13,6 @@ type LauncherState =
|
|||
'game-update-available' |
|
||||
'game-installation-available' |
|
||||
'game-voice-update-required' |
|
||||
'wine-installation-required' |
|
||||
'wine-installing' |
|
||||
'game-launch-available';
|
||||
|
||||
export default class LauncherUI
|
||||
|
@ -87,17 +83,6 @@ export default class LauncherUI
|
|||
|
||||
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':
|
||||
$('#launch').removeAttr('disabled')
|
||||
.removeAttr('data-hint');
|
||||
|
@ -169,10 +154,6 @@ export default class LauncherUI
|
|||
}, 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');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue