mirror of
https://github.com/AltarikMC/Launcher
synced 2024-11-22 06:19:50 +01:00
Second hotfix
This commit is contained in:
parent
3652e032a5
commit
66d56018f5
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "altarik-launcher",
|
||||
"author": "Altarik",
|
||||
"version": "1.2.1",
|
||||
"version": "1.2.2",
|
||||
"description": "Altarik Launcher",
|
||||
"main": "src/server/main.js",
|
||||
"homepage": "https://altarik.fr/",
|
||||
|
@ -7,13 +7,11 @@ app = vue.createApp({
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.sendCheckingUpdate()
|
||||
},
|
||||
methods: {
|
||||
sendCheckingUpdate() {
|
||||
ipcRenderer.send("checking-update");
|
||||
},
|
||||
closeFullscreen () {
|
||||
this.displayFullscreen = "none"
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -2,7 +2,7 @@ const { app, BrowserWindow, Menu, ipcMain, autoUpdater, dialog } = require('elec
|
||||
const logger = require('electron-log')
|
||||
const { join } = require('path')
|
||||
const updater = require('./updater.js')
|
||||
let updaterInstance = new updater.Updater(app, win, autoUpdater, dialog, logger, showNotification)
|
||||
let updaterInstance = new updater.Updater(app, autoUpdater, dialog, logger, showNotification)
|
||||
updaterInstance.configUpdater()
|
||||
|
||||
if (require('electron-squirrel-startup')) {
|
||||
|
@ -4,9 +4,8 @@ const server = 'https://update.electronjs.org'
|
||||
|
||||
class Updater {
|
||||
|
||||
constructor(app, win, autoUpdater, dialog, logger, ipcMain) {
|
||||
constructor(app, autoUpdater, dialog, logger, ipcMain) {
|
||||
this.app = app
|
||||
this.win = win
|
||||
this.autoUpdater = autoUpdater
|
||||
this.dialog = dialog
|
||||
this.logger = logger
|
||||
@ -21,14 +20,10 @@ class Updater {
|
||||
this.logger.info(`arch: ${process.arch}`)
|
||||
if(isDev) {
|
||||
this.logger.info(`developpement version ${this.app.getVersion()}`)
|
||||
this.win.loadFile('src/client/login.html')
|
||||
return
|
||||
}
|
||||
this.logger.info(`production version ${this.app.getVersion()}`)
|
||||
|
||||
const feed = `${server}/${pkg.repository}/${process.platform}-${process.arch}/${this.app.getVersion()}`
|
||||
this.autoUpdater.setFeedURL(feed)
|
||||
|
||||
// TODO : replace dialog by automatic restart
|
||||
this.autoUpdater.on('update-downloaded', (_event, releaseNotes, releaseName) => {
|
||||
this.logger.info(`update downloaded ${releaseName}`)
|
||||
@ -39,7 +34,13 @@ class Updater {
|
||||
}
|
||||
|
||||
checkForUpdates(win, showNotification) {
|
||||
if(isDev) {
|
||||
win.loadFile('src/client/login.html')
|
||||
return;
|
||||
}
|
||||
this.logger.info("Checking for update...")
|
||||
const feed = `${server}/${pkg.repository}/${process.platform}-${process.arch}/${this.app.getVersion()}`
|
||||
this.autoUpdater.setFeedURL(feed)
|
||||
this.autoUpdater.checkForUpdates()
|
||||
this.autoUpdater.on('error', message => {
|
||||
this.logger.error('There was a problem updating the application')
|
||||
|
Loading…
Reference in New Issue
Block a user