This commit is contained in:
CICD - Pipeline 2023-04-26 23:37:15 +02:00
parent a0879be3b4
commit 9854270413
2 changed files with 16 additions and 28 deletions

31
main.js
View File

@ -1,5 +1,5 @@
const {app, BrowserWindow, ipcMain, Notification, nativeImage, Tray, Menu, shell} = require("electron")
const { autoUpdater } = require("electron-updater")
const { autoUpdater, AppUpdater } = require("electron-updater")
const path = require("path")
const fs = require("fs")
const ipc = ipcMain
@ -10,6 +10,9 @@ const { platform } = require("os");
// [Function] Main Window Function
autoUpdater.autoDownload = false;
autoUpdater.autoInstallOnAppQuit = true;
async function createWindow() {
const win = new BrowserWindow({
@ -306,32 +309,6 @@ app.whenReady().then(() => {
})
autoUpdater.on("update-available", (_event, releaseNotes, releaseName) => {
const dialogOpts = {
type: 'info',
buttons: ['Ok'],
title: 'Mise à jour de Submanager',
message: process.platform === 'win32' ? releaseNotes : releaseName,
detail: 'Cette version va être téléchargé automatiquement !'
}
dialog.showMessageBox(dialogOpts, (response) => {
});
})
autoUpdater.on("update-downloaded", (_event, releaseNotes, releaseName) => {
const dialogOpts = {
type: 'info',
buttons: ['Restart', 'Later'],
title: 'Mise à jour de Submanager',
message: process.platform === 'win32' ? releaseNotes : releaseName,
detail: 'Une nouvelle version a été téléchargé ! Redémarrer l\'application afin d\'effectuer les changements !'
};
dialog.showMessageBox(dialogOpts).then((returnValue) => {
if (returnValue.response === 0) autoUpdater.quitAndInstall()
})
});

View File

@ -1,6 +1,6 @@
{
"name": "subsonics-manager",
"version": "1.0",
"version": "1.0.0",
"description": "Manager for subsonics",
"main": "main.js",
"scripts": {
@ -10,6 +10,17 @@
"type": "git",
"url": "https://git.raphix.fr/subsonics/manager.git"
},
"build": {
"appId":"fr.raphix.submanager",
"productName":"Submanager",
"win": {
"target": "nsis"
},
"directories": {
"output":"dist"
}
},
"keywords": [],
"author": "Raphix",
"license": "ISC",