ls-vertretungsplan-desktop

UNOFFICIAL Desktop App for the schedule of Lornsenschule, Schleswig
git clone git://archive.git.mtrnord.blog/MTRNord/ls-vertretungsplan-desktop.git
Log | Files | Refs | README

commit a8f92b931b23caefd53f739be7e96f984260241a
parent 055a2b236ec5eeb138beda911e1e9485b9cea398
Author: MTRNord <mtrnord1@gmail.com>
Date:   Sat,  3 Sep 2016 21:04:31 +0200

Fix Autoupdater and start on Linux Builds

Diffstat:
MREADME.md | 7+++++--
Mapp/main.js | 16+++++++++-------
Mapp/package.json | 15+++++++++++++--
Mpackage.json | 5+++--
4 files changed, 30 insertions(+), 13 deletions(-)

diff --git a/README.md b/README.md @@ -1,12 +1,15 @@ # ls-vertretungsplan-desktop UNOFFICIAL Desktop App for the schedule of Lornsenschule, Schleswig +#DOWNLOADS +Downloades can be found here: https://ls-desktop.herokuapp.com/download/ + # Info about the API This Desktop App uses an API by @johan12345 that is NOT managed by me. I am allowed to use it and to have it in the Git Source. To see the APP made by @johan12345 take a look at https://ls.vertretungsplan.me -# How to Build (If you find the URL to the API ^^) +# How to Build 1. Clone the Repository 2. Run `npm install` 3. If You use Windows run `build.cmd` otherwise go to 4 -4. Everybody else go into the app directory and run `npm install` and now run `node build.js` in the root +4. Everybody else go into the app directory and run `npm install` and now run `build` in the root diff --git a/app/main.js b/app/main.js @@ -1,19 +1,22 @@ -const {app, BrowserWindow, dialog} = require('electron') +const {app, BrowserWindow, dialog, autoUpdater, globalShortcut} = require('electron') // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. let win function update () { - var feedUrl = 'https://ls-desktop.herokuapp.com/update/win32/' + app.getVersion(); + console.warn("Starting Autoupdater") + var feedUrl = 'https://ls-desktop.herokuapp.com/update/win/' + app.getVersion(); autoUpdater.setFeedURL(feedUrl); + autoUpdater.checkForUpdates() + autoUpdater.on('update-downloaded', function (event, releaseNotes, releaseName, releaseDate, updateUrl, quitAndUpdate) { var index = dialog.showMessageBox(mainWindow, { type: 'info', - buttons: [i18n.__('Restart'), i18n.__('Later')], - title: "Typetalk", + buttons: ['Restart', 'Later'], + title: "Lornsenschule Vertretungsplan", message: i18n.__('The new version has been downloaded. Please restart the application to apply the updates.'), detail: releaseName + "\n\n" + releaseNotes }); @@ -22,7 +25,7 @@ function update () { return; } - quitAndUpdate(); + autoUpdater.quitAndUpdate(); }); } @@ -33,7 +36,6 @@ function createWindow () { // and load the index.html of the app. win.loadURL(`file://${__dirname}/index.html`) - // Open the DevTools. //win.webContents.openDevTools() // Emitted when the window is closed. @@ -43,6 +45,7 @@ function createWindow () { // when you should delete the corresponding element. win = null }) + update() } // This method will be called when Electron has finished @@ -65,7 +68,6 @@ app.on('activate', () => { if (win === null) { createWindow() } - update(); }) // In this file you can include the rest of your app's specific main process diff --git a/app/package.json b/app/package.json @@ -1,10 +1,21 @@ { "name": "ls_vertretungsplan_desktop", "productName": "Lornsenschule Vertretungsplan", - "version": "0.0.4", + "version": "0.1.0", "description": "Eine Anwendung die den Vertretungsplan auf dem Desktop anzeigt", "main": "./main.js", - "author": "Lornsenschule Vertretungsplan", + "author": { + "name" : "Lornsenschule Vertretungsplan", + "email" : "ínfo@nordgedanken.de", + "url" : "https://github.com/MTRNord/ls-vertretungsplan-desktop" + }, + "contributors": [ + { + "name" : "Marcel Radzio", + "email" : "ínfo@nordgedanken.de", + "url" : "https://github.com/MTRNord/ls-vertretungsplan-desktop" + } + ], "license": "", "dependencies": { "cached-request": "^1.0.0", diff --git a/package.json b/package.json @@ -1,8 +1,8 @@ { "name": "ls_vertretungsplan_desktop", - "version": "0.0.4", + "version": "0.1.0", "description": "Eine Anwendung die den Vertretungsplan auf dem Desktop anzeigt", - "author": "Marcel Radzio <info@nordgedanken.de>", + "author": "Marcel Radzio", "license": "", "devDependencies": { "electron": "^1.3.4", @@ -34,6 +34,7 @@ }, "win": { "iconUrl": "https://github.com/MTRNord/ls-vertretungsplan-desktop/tree/master/app/LS.ico?raw=true", + "remoteReleases": "http://ls-desktop.herokuapp.com/download/0.0.4/", "icon": "app/LS.ico" }, "linux": {