mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: remove auto download if is portable version
This commit is contained in:
parent
bcef86fd94
commit
8c1851bb4c
3 changed files with 30 additions and 19 deletions
|
@ -12,6 +12,9 @@ const sendEvent = (event: AppUpdaterEvent) => {
|
|||
|
||||
const sendEventsForDebug = false;
|
||||
|
||||
const isAutoInstallAvailable =
|
||||
process.platform !== "darwin" && process.env.PORTABLE_EXECUTABLE_FILE == null;
|
||||
|
||||
const mockValuesForDebug = () => {
|
||||
sendEvent({ type: "update-available", info: { version: "1.3.0" } });
|
||||
sendEvent({ type: "update-downloaded" });
|
||||
|
@ -27,10 +30,13 @@ const checkForUpdates = async (_event: Electron.IpcMainInvokeEvent) => {
|
|||
});
|
||||
|
||||
if (app.isPackaged) {
|
||||
autoUpdater.autoDownload = isAutoInstallAvailable;
|
||||
autoUpdater.checkForUpdates();
|
||||
} else if (sendEventsForDebug) {
|
||||
mockValuesForDebug();
|
||||
}
|
||||
|
||||
return isAutoInstallAvailable;
|
||||
};
|
||||
|
||||
registerEvent("checkForUpdates", checkForUpdates);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue