[feat-578] setup protonFolder on startup

This commit is contained in:
silentrald
2024-09-22 15:21:19 +08:00
parent 0398a957ad
commit de7a054f89
19 changed files with 275 additions and 16 deletions
+22 -1
View File
@@ -6,7 +6,8 @@ import { InstallationLocationService } from "./installation-location.service";
import { IpcService } from "./ipc.service";
import { ModalService } from "./modale.service";
import { AskInstallPathModal } from "renderer/components/modal/modal-types/ask-install-path.component";
import { AskInstallPathModal } from "renderer/components/modal/modal-types/setup/ask-install-path.component";
import { LinuxSetupModal } from "renderer/components/modal/modal-types/setup/linux-setup-modal.component";
// Handle setup modals/prompts, ordering of the modals/prompts may be done here
export class SetupService {
@@ -35,6 +36,10 @@ export class SetupService {
try {
// NOTE: for modal sequencing
await this.checkInstallationPath();
if (window.electron.platform === "linux") {
await this.checkProtonFolder();
}
} catch (error) {
logRenderError(error);
}
@@ -61,4 +66,20 @@ export class SetupService {
}
}
private async checkProtonFolder(): Promise<void> {
try {
const valid = await lastValueFrom(this.ipcService.sendV2("linux.verify-proton-folder"));
if (valid) {
return;
}
await this.modalService.openModal(
LinuxSetupModal,
{ closable: false }
);
} catch (error) {
logRenderError(error);
}
}
}