Skip to content

Commit

Permalink
Fix Update Window 2
Browse files Browse the repository at this point in the history
  • Loading branch information
jaruba committed Aug 16, 2015
1 parent ad62eb3 commit 73c100d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/lib/update.js
Expand Up @@ -8,12 +8,16 @@ function checkUpdates() {

$("#update-header").html("Update to Powder v"+xhr);
var updater = gui.Window.open('app://powder/src/updater.html',{ width: 320, height: 133, icon: "icon.png", toolbar: false });

if (isWin) updExt = ".exe";
else {
if (process.platform == "darwin") var updExt = ".dmg";
else if (process.platform == "linux") var updExt = ".tar.gz";
}
updater.on('close', function() {
fs.stat(gui.App.dataPath+pathBreak+'updater.exe', function(err,stat) {
fs.stat(gui.App.dataPath+pathBreak+'updater'+updExt, function(err,stat) {
if (err == null) {
if (localStorage.doUpdate == "1") win.close();
else fs.unlink(gui.App.dataPath+pathBreak+'updater.exe');
else fs.unlink(gui.App.dataPath+pathBreak+'updater'+updExt);
}
});
updater.close(true);
Expand Down
4 changes: 3 additions & 1 deletion src/updater.html
Expand Up @@ -54,7 +54,8 @@ <h2 id="update-header" style="font-size:15px">Downloaded Successfully</h2>

var request = require('request'),
gui = require('nw.gui'),
fs = require('fs');
fs = require('fs'),
file_url;

var https = require('https');

Expand Down Expand Up @@ -84,6 +85,7 @@ <h2 id="update-header" style="font-size:15px">Downloaded Successfully</h2>
}
}
}
if (!file_url) win.close();
});
});

Expand Down

0 comments on commit 73c100d

Please sign in to comment.