auto-update

This commit is contained in:
2024-11-03 18:24:57 +02:00
parent cf845cae1b
commit e3a6d826f9
5 changed files with 37 additions and 10 deletions

View File

@@ -2,8 +2,14 @@ require('./rt/electron-rt');
//////////////////////////////
// User Defined Preload scripts below
console.log('User Preload!');
const { contextBridge, shell } = require('electron');
const { contextBridge, shell, ipcRenderer } = require('electron');
contextBridge.exposeInMainWorld('electronAPI', {
openExternal: (url) => shell.openExternal(url)
});
contextBridge.exposeInMainWorld('electron', {
onUpdateAvailable: (callback) => ipcRenderer.on('update_available', callback),
onUpdateDownloaded: (callback) => ipcRenderer.on('update_downloaded', callback),
restartApp: () => ipcRenderer.send('restart_app')
});