diff --git a/electron/assets/appIcon.ico b/electron/assets/appIcon.ico index 1aea5a5..5cf18b3 100644 Binary files a/electron/assets/appIcon.ico and b/electron/assets/appIcon.ico differ diff --git a/electron/electron-builder.config.json b/electron/electron-builder.config.json index 3f9a756..055d483 100644 --- a/electron/electron-builder.config.json +++ b/electron/electron-builder.config.json @@ -1,5 +1,5 @@ { - "appId": "com.yourdomain.yourapp", + "appId": "com.github.Qortal.Qortal-Hub", "directories": { "buildResources": "resources" }, @@ -14,13 +14,21 @@ "oneClick": false, "allowToChangeInstallationDirectory": true }, + "publish": [ + { + "provider": "github", + "owner": "Qortal", + "repo": "Qortal-Hub", + "releaseType": "draft" + } + ], "win": { "target": "nsis", "icon": "assets/appIcon.ico" }, "linux": { "target": ["AppImage"], - "category": "Utility", // Set a specific Linux category here + "category": "Utility", "executableName": "Qortal", "icon": "assets/qortal.png" }, diff --git a/electron/package.json b/electron/package.json index d022bd9..0135a50 100644 --- a/electron/package.json +++ b/electron/package.json @@ -1,15 +1,24 @@ { - "name": "Qortal ", - "version": "1.0.0", - "description": "An Amazing Capacitor App", + "name": "qortal-hub", + "version": "0.0.2", + "description": "A desktop app that gives you access to the Qortal network", "author": { - "name": "", - "email": "" + "name": "" }, "repository": { "type": "git", "url": "" }, + "build": { + "appId": "com.github.Qortal.Qortal-Hub", + "publish": [ + { + "provider": "github", + "owner": "Qortal", + "repo": "Qortal-Hub" + } + ] + }, "license": "MIT", "main": "build/src/index.js", "scripts": { @@ -17,7 +26,8 @@ "electron:start-live": "node ./live-runner.js", "electron:start": "npm run build && electron --inspect=5858 ./", "electron:pack": "npm run build && electron-builder build --dir -c ./electron-builder.config.json", - "electron:make": "npm run build && electron-builder build -c ./electron-builder.config.json -p always" + "electron:make": "npm run build && electron-builder build -c ./electron-builder.config.json -p always", + "electron:make-local": "npm run build && electron-builder build -c ./electron-builder.config.json --publish=never" }, "dependencies": { "@capacitor-community/electron": "^5.0.0", diff --git a/electron/src/index.ts b/electron/src/index.ts index e64f5b6..759f662 100644 --- a/electron/src/index.ts +++ b/electron/src/index.ts @@ -46,7 +46,10 @@ if (electronIsDev) { // Initialize our app, build windows, and load content. await myCapacitorApp.init(); // Check for updates if we are in a packaged app. - // autoUpdater.checkForUpdatesAndNotify(); + autoUpdater.checkForUpdatesAndNotify(); + setInterval(() => { + autoUpdater.checkForUpdatesAndNotify(); + }, 6 * 60 * 60 * 1000); // 24 hours in milliseconds })(); // Handle when all of our windows are close (platforms have their own expectations). diff --git a/electron/src/preload.ts b/electron/src/preload.ts index e7f815b..9911817 100644 --- a/electron/src/preload.ts +++ b/electron/src/preload.ts @@ -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') }); \ No newline at end of file