feat(launcher)!: manage multiple game copies

BREAKING CHANGE: The launcher stores copy registrations in copies.json. Installations recorded only in install.json must be registered again.
This commit is contained in:
N0VAN0M4LY committed 2026-11-29 15:14:41 +08:00
1 parent e41b73aaa3
commit 7d68dc0548
24 files changed
+408 -97

No files matched your search

@@ -5,7 +5,7 @@ import { app, dialog, shell, type BrowserWindow } from 'electron';
import { zipSync } from 'fflate';
import { AppError } from '@shared/errors.ts';
import { getSettings } from '../config/settings-store.ts';
import { readInstallRecord } from '../install/install-record.ts';
import { COPIES_FILENAME, readInstallRecord } from '../install/install-record.ts';
import { LAUNCHER_LOG_FILES, launcherLogFolder } from './launcher-log.ts';
type ArchiveFiles = Record<string, Uint8Array>;
@@ -35,7 +35,7 @@ export async function exportDiagnostics(window: BrowserWindow | null): Promise<{
const files: ArchiveFiles = {};
const userData = app.getPath('userData');
await addFile(files, 'settings.json', join(userData, 'settings.json'));
await addFile(files, 'install.json', join(userData, 'install.json'));
await addFile(files, COPIES_FILENAME, join(userData, COPIES_FILENAME));
const launcherLogs = launcherLogFolder();
if ((await ifPresent(() => lstat(launcherLogs)))?.isDirectory()) {
for (const name of LAUNCHER_LOG_FILES) {