forked from codeskyblue/electron-inno-auto-update
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
36 lines (34 loc) · 1.29 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var innoUpdater = require('./inno-updater');
window.onload = function(){
document.getElementById('quit-install').onclick = function(){
innoUpdater.quitAndInstall()
}
document.getElementById('check-update').onclick = function(){
innoUpdater.checkForUpdates()
}
document.getElementById('later').onclick = function(){
document.getElementById('update-downloaded').style.display = 'none';
}
document.getElementById('close').onclick = function(){
document.getElementById('update-not-avaliable').style.display = 'none';
}
document.getElementById('changelog').onclick = function(){
alert(window.releaseNotes);
}
innoUpdater.setFeedURL('https://raw.githubusercontent.com/codeskyblue/electron-quick-start/master/example-feed.json')
innoUpdater.on('checking-for-update', function(){
console.log("INFO: Checking update")
})
innoUpdater.on('update-downloaded', function(data){
console.log("INFO: Update file downloaded.", data)
window.releaseNotes = data.releaseNotes;
document.getElementById('update-downloaded').style.display = '';
})
innoUpdater.on('update-not-available', function(){
document.getElementById('update-not-avaliable').style.display = '';
console.log("INFO: Update not avaliable")
})
innoUpdater.on('update-avaliable', function(){
console.log("INFO: Update avaliable")
})
}