4
0
mirror of https://github.com/AltarikMC/Launcher synced 2024-11-22 06:19:50 +01:00

Second hotfix

This commit is contained in:
Quentin Legot 2022-08-20 11:53:13 +02:00
parent 3652e032a5
commit 66d56018f5
4 changed files with 10 additions and 11 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "altarik-launcher", "name": "altarik-launcher",
"author": "Altarik", "author": "Altarik",
"version": "1.2.1", "version": "1.2.2",
"description": "Altarik Launcher", "description": "Altarik Launcher",
"main": "src/server/main.js", "main": "src/server/main.js",
"homepage": "https://altarik.fr/", "homepage": "https://altarik.fr/",

View File

@ -7,13 +7,11 @@ app = vue.createApp({
} }
}, },
mounted() { mounted() {
this.sendCheckingUpdate()
}, },
methods: { methods: {
sendCheckingUpdate() { sendCheckingUpdate() {
ipcRenderer.send("checking-update"); ipcRenderer.send("checking-update");
},
closeFullscreen () {
this.displayFullscreen = "none"
} }
}, },
}); });

View File

@ -2,7 +2,7 @@ const { app, BrowserWindow, Menu, ipcMain, autoUpdater, dialog } = require('elec
const logger = require('electron-log') const logger = require('electron-log')
const { join } = require('path') const { join } = require('path')
const updater = require('./updater.js') 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() updaterInstance.configUpdater()
if (require('electron-squirrel-startup')) { if (require('electron-squirrel-startup')) {

View File

@ -4,9 +4,8 @@ const server = 'https://update.electronjs.org'
class Updater { class Updater {
constructor(app, win, autoUpdater, dialog, logger, ipcMain) { constructor(app, autoUpdater, dialog, logger, ipcMain) {
this.app = app this.app = app
this.win = win
this.autoUpdater = autoUpdater this.autoUpdater = autoUpdater
this.dialog = dialog this.dialog = dialog
this.logger = logger this.logger = logger
@ -21,14 +20,10 @@ class Updater {
this.logger.info(`arch: ${process.arch}`) this.logger.info(`arch: ${process.arch}`)
if(isDev) { if(isDev) {
this.logger.info(`developpement version ${this.app.getVersion()}`) this.logger.info(`developpement version ${this.app.getVersion()}`)
this.win.loadFile('src/client/login.html')
return return
} }
this.logger.info(`production version ${this.app.getVersion()}`) 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 // TODO : replace dialog by automatic restart
this.autoUpdater.on('update-downloaded', (_event, releaseNotes, releaseName) => { this.autoUpdater.on('update-downloaded', (_event, releaseNotes, releaseName) => {
this.logger.info(`update downloaded ${releaseName}`) this.logger.info(`update downloaded ${releaseName}`)
@ -39,7 +34,13 @@ class Updater {
} }
checkForUpdates(win, showNotification) { checkForUpdates(win, showNotification) {
if(isDev) {
win.loadFile('src/client/login.html')
return;
}
this.logger.info("Checking for update...") 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.checkForUpdates()
this.autoUpdater.on('error', message => { this.autoUpdater.on('error', message => {
this.logger.error('There was a problem updating the application') this.logger.error('There was a problem updating the application')