7 changed files with 195 additions and 9 deletions
@ -0,0 +1,30 @@
|
||||
'use strict'; |
||||
var electronInstaller = require('electron-winstaller'); |
||||
|
||||
var arch = process.argv.slice(2)[0]; |
||||
|
||||
if ( !arch ) { |
||||
console.error('No Architecture paramenter specified. [ia32 or x64]'); |
||||
return; |
||||
} |
||||
|
||||
//var appData = require('../app/package.json');
|
||||
|
||||
var resultPromise = electronInstaller.createWindowsInstaller({ |
||||
appDirectory: './dist/Rambox-win32-'+arch |
||||
,outputDirectory: './dist' |
||||
,title: 'Rambox' |
||||
,loadingGif: './resources/installer/loading.gif' |
||||
,authors: 'Rambox' |
||||
,owners: 'Rambox' |
||||
,exe: 'Rambox.exe' |
||||
,setupExe: 'RamboxSetup-'+arch+'.exe' |
||||
,noMsi: true |
||||
,iconUrl: 'https://raw.githubusercontent.com/saenzramiro/rambox/master/resources/installer/icons/64x64.png' |
||||
,setupIcon: './resources/Icon.ico' |
||||
//,remoteReleases: 'https://getrambox.herokuapp.com/update/'+process.platform+'/'+process.arch+'/'+appData.version
|
||||
}); |
||||
|
||||
console.log('Creating installer... Please wait...') |
||||
|
||||
resultPromise.then(() => console.log("Done!"), (e) => console.log(`Ups!: ${e.message}`)); |
@ -0,0 +1,43 @@
|
||||
'use strict'; |
||||
const electron = require('electron'); |
||||
const app = electron.app; |
||||
const dialog = electron.dialog; |
||||
|
||||
const autoUpdater = electron.autoUpdater; |
||||
|
||||
const feedUrl = `https://getrambox.herokuapp.com/update/${process.platform}/${process.arch}/${app.getVersion()}`; |
||||
|
||||
autoUpdater.setFeedURL(feedUrl); |
||||
autoUpdater.checkForUpdates(); |
||||
|
||||
exports.check = win => { |
||||
autoUpdater.on('update-available', function(a, b, c, d) { |
||||
dialog.showMessageBox({ |
||||
message: "There is a new version" |
||||
,buttons: ["OK"] |
||||
}); |
||||
}); |
||||
/* |
||||
autoUpdater.on('update-not-available', function(a, b, c, d) { |
||||
|
||||
}); |
||||
*/ |
||||
autoUpdater.on('update-downloaded', function(e, releaseNotes, releaseName, releaseDate, updateURL) { |
||||
var index = dialog.showMessageBox({ |
||||
message: "New version" |
||||
,detail: "Do you want to install the new version ("+releaseName+")?" |
||||
,buttons: ["Yes", "No"] |
||||
}); |
||||
if (index === 0) { |
||||
autoUpdater.quitAndInstall(); |
||||
} |
||||
}); |
||||
/* |
||||
autoUpdater.on("error", function(error){ |
||||
dialog.showMessageBox({ |
||||
message: error.toString() |
||||
,buttons: ["OK"] |
||||
}); |
||||
}); |
||||
*/ |
||||
}; |
After Width: | Height: | Size: 68 KiB |
Loading…
Reference in new issue