chore: merge with main

This commit is contained in:
Chubby Granny Chaser
2024-06-08 20:28:41 +01:00
12 changed files with 128 additions and 73 deletions

View File

@@ -1,4 +1,4 @@
import { AppUpdaterEvents } from "@types";
import { AppUpdaterEvent } from "@types";
import { registerEvent } from "../register-event";
import updater, { UpdateInfo } from "electron-updater";
import { WindowManager } from "@main/services";
@@ -6,12 +6,15 @@ import { app } from "electron";
const { autoUpdater } = updater;
const sendEvent = (event: AppUpdaterEvents) => {
const sendEvent = (event: AppUpdaterEvent) => {
WindowManager.mainWindow?.webContents.send("autoUpdaterEvent", event);
};
const sendEventsForDebug = false;
const mockValuesForDebug = () => {
sendEvent({ type: "update-available", info: { version: "1.3.0" } });
sendEvent({ type: "update-downloaded" });
};
const checkForUpdates = async (_event: Electron.IpcMainInvokeEvent) => {
@@ -25,7 +28,7 @@ const checkForUpdates = async (_event: Electron.IpcMainInvokeEvent) => {
if (app.isPackaged) {
autoUpdater.checkForUpdates();
} else {
} else if (sendEventsForDebug) {
mockValuesForDebug();
}
};

View File

@@ -44,6 +44,11 @@ const openGameInstaller = async (
return true;
}
if (process.platform === "darwin") {
shell.openPath(gamePath);
return true;
}
if (fs.lstatSync(gamePath).isFile()) {
return executeGameInstaller(gamePath);
}