mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +01:00
use native install on quit instead
This commit is contained in:
parent
ba7bcde951
commit
21684b0995
@ -731,7 +731,6 @@ electronApp.on("window-all-closed", () => {
|
|||||||
});
|
});
|
||||||
electronApp.on("before-quit", () => {
|
electronApp.on("before-quit", () => {
|
||||||
globalIsQuitting = true;
|
globalIsQuitting = true;
|
||||||
updater?.installUpdate();
|
|
||||||
});
|
});
|
||||||
process.on("SIGINT", () => {
|
process.on("SIGINT", () => {
|
||||||
console.log("Caught SIGINT, shutting down");
|
console.log("Caught SIGINT, shutting down");
|
||||||
@ -809,6 +808,7 @@ async function appMain() {
|
|||||||
await electronApp.whenReady();
|
await electronApp.whenReady();
|
||||||
await relaunchBrowserWindows();
|
await relaunchBrowserWindows();
|
||||||
await configureAutoUpdater();
|
await configureAutoUpdater();
|
||||||
|
|
||||||
globalIsStarting = false;
|
globalIsStarting = false;
|
||||||
|
|
||||||
electronApp.on("activate", async () => {
|
electronApp.on("activate", async () => {
|
||||||
|
@ -187,23 +187,24 @@ export async function configureAutoUpdater() {
|
|||||||
|
|
||||||
autoUpdateLock = true;
|
autoUpdateLock = true;
|
||||||
|
|
||||||
const autoUpdateEnabled = (await services.FileService.GetSettingsConfig()).autoupdate.enabled;
|
const autoUpdateOpts = (await services.FileService.GetSettingsConfig()).autoupdate;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
console.log("Configuring updater");
|
console.log("Configuring updater");
|
||||||
updater = new Updater();
|
updater = new Updater();
|
||||||
|
autoUpdater.autoInstallOnAppQuit = autoUpdateOpts.installonquit;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn("error configuring updater", e.toString());
|
console.warn("error configuring updater", e.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (autoUpdateEnabled && updater?.interval == null) {
|
if (autoUpdateOpts.enabled && updater?.interval == null) {
|
||||||
try {
|
try {
|
||||||
console.log("configuring auto update interval");
|
console.log("configuring auto update interval");
|
||||||
updater?.startInterval();
|
updater?.startInterval();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("error configuring auto update interval", e.toString());
|
console.log("error configuring auto update interval", e.toString());
|
||||||
}
|
}
|
||||||
} else if (!autoUpdateEnabled && updater?.interval != null) {
|
} else if (!autoUpdateOpts.enabled && updater?.interval != null) {
|
||||||
console.log("disabling auto updater");
|
console.log("disabling auto updater");
|
||||||
clearInterval(updater.interval);
|
clearInterval(updater.interval);
|
||||||
updater = null;
|
updater = null;
|
||||||
|
1
frontend/types/gotypes.d.ts
vendored
1
frontend/types/gotypes.d.ts
vendored
@ -19,6 +19,7 @@ declare global {
|
|||||||
type AutoUpdateOpts = {
|
type AutoUpdateOpts = {
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
intervalms: number;
|
intervalms: number;
|
||||||
|
installonquit: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
// wstore.Block
|
// wstore.Block
|
||||||
|
@ -48,8 +48,9 @@ type BlockHeaderOpts struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type AutoUpdateOpts struct {
|
type AutoUpdateOpts struct {
|
||||||
Enabled bool `json:"enabled"`
|
Enabled bool `json:"enabled"`
|
||||||
IntervalMs uint32 `json:"intervalms"`
|
IntervalMs uint32 `json:"intervalms"`
|
||||||
|
InstallOnQuit bool `json:"installonquit"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type TermThemeType struct {
|
type TermThemeType struct {
|
||||||
@ -245,8 +246,9 @@ func applyDefaultSettings(settings *SettingsConfigType) {
|
|||||||
}
|
}
|
||||||
if settings.AutoUpdate == nil {
|
if settings.AutoUpdate == nil {
|
||||||
settings.AutoUpdate = &AutoUpdateOpts{
|
settings.AutoUpdate = &AutoUpdateOpts{
|
||||||
Enabled: true,
|
Enabled: true,
|
||||||
IntervalMs: 3600000,
|
InstallOnQuit: true,
|
||||||
|
IntervalMs: 3600000,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var userName string
|
var userName string
|
||||||
|
Loading…
Reference in New Issue
Block a user