Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release test #13

Merged
merged 18 commits into from
Jul 2, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added auto updater module
Ciriak committed Jun 18, 2016
commit fe778fec83adcd2e37b28e43a72f902ed0931d6c
31 changes: 31 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@

const electron = require('electron');
const app = electron.app;
console.log("Tagifier V."+app.getVersion());
const Menu = electron.Menu;
const BrowserWindow = electron.BrowserWindow;
const ipc = electron.ipcMain;
@@ -39,6 +40,36 @@ app.on('activate', function () {
}
});

//
// Auto updater
//
const GhReleases = require('electron-gh-releases')

let options = {
repo: 'Cyriaqu3/tagifier',
currentVersion: app.getVersion()
}

const updater = new GhReleases(options)

// Check for updates
// `status` returns true if there is a new update available
updater.check((err, status) => {
if (!err && status) {
// Download the update
updater.download()
}
})

// When an update has been downloaded
updater.on('update-downloaded', (info) => {
// Restart the app and install the update
updater.install()
})

// Access electrons autoUpdater
updater.autoUpdater

var fs = require('fs-sync');
var ofs = require('fs'); // old fs
var util = require('util');
1 change: 1 addition & 0 deletions src/package.json
Original file line number Diff line number Diff line change
@@ -28,6 +28,7 @@
"body-parser": "^1.15.0",
"browser-id3-writer": "^2.3.1",
"del": "^2.2.0",
"electron-gh-releases": "^2.0.3",
"fast-image-downloader": "0.0.4",
"file-exists": "^1.0.0",
"fluent-ffmpeg": "^2.1.0",