Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Commit

Permalink
fix updater
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianPetkovsek committed Nov 29, 2019
1 parent ffcb831 commit 43befa4
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function download(uri, filename) {
return deferred.promise;
};
isUPDATE = false
isUPDATEDONE = false
function getUpdate(){
a = 'https://api.github.com/repos/{0}/{1}/releases/latest'.format(author,github_repository)
var client = new HttpClient();
Expand All @@ -77,12 +78,19 @@ function getUpdate(){
console.log(browser_download_url)
download(browser_download_url,path).then(ret => {
var exec = require('child_process').execFile;
exec('start_update.bat', [path],function(err, data) {
exec('start_update.bat', [path],function(err, data) {
console.log(err)
console.log(data.toString());
});
console.log('update done')
app.quit()
});
isUPDATEDONE = true;
setInterval(() => {
if (isUPDATEDONE){
console.log('update done')
app.quit()
}
}, 0.5E3);
//console.log('update done')
//app.quit()
callback(ret);
});
console.log('updating')
Expand Down

0 comments on commit 43befa4

Please sign in to comment.