Windows 8.1 not completing update process
Here are the steps that occur when I use the node-webkit-updater on Windows 8.1:
- app detects a new version available
- new version is downloaded & unzipped to temp directory
- app closes
- the new app in temp directory doesn't run
- the new app doesn't get copied from the temp directory to the app's exec/install directory
Basically the app will download the updated version and then quit, but won't relaunch the downloaded new version.
Did you try using gui.Shell.openItem?
I'm basically using the example code, on OSX it is able to detect, download, update and relaunch my app, however on Windows it only seems to detect and download my app but never performs the update and relaunch.
Instead of upd.run(execPath, null);, try gui.Shell.openItem(execPath).
Thanks @adam-lynch, I'll give it a try and let you know how it goes.
I'm getting the same result with gui.Shell.openItem(execPath); it works on OSX but fails on Windows 8.1.
Is execPath what you'd expect? (The path to the .exe of the new update)
I have problem on Windows 8.1 too, I check my code,and found : 1、app detects a new version available 2、new version is downloaded & unzipped to temp directory 3、app closes 4、the new app in temp directory run 5、the new app doesn't get copied from the temp directory to the app's exec/install directory, And I check the old version folder ,it was occupied by the new app run from temp directory.
I resolved my problem by create a bat file and gui.Shell.openItem() to run my update app as a new instance of nw.
var pathName = path.dirname(newAppPath)
var installName = pathName + "/install.bat"
fs.writeFileSync(installName,newAppPath+" "+ upd.getAppPath() + " "+upd.getAppExec(), "UTF-8",{'flags': 'w+'});
gui.Shell.openItem(installName)
gui.App.quit();
@Michael00767
And I check the old version folder ,it was occupied by the new app run from temp directory.
This sounds like it is being copied?
I'm not sure you need to do what you're doing.
@adam-lynch
Here is what I'm seeing when retrieving the various paths (on Windows 8.1):
newAppPath = C:\Users\hermwong\AppData\Local\Temp\PhoneGap-Desktop-Beta-0.1.4-win\PhoneGap.exe
upd.getAppExec() = C:\Program Files (x86)\Adobe\PhoneGap\PhoneGap Desktop\
upd.getAppPath() = C:\Program Files (x86)\Adobe\PhoneGap\PhoneGap Desktop\
When I execute: upd.runInstaller(newAppPath, [copyPath, execPath],{});, my App crashes
I've attached the screenshot of the error message from the App crash.

Uncaught node.js Error
Error: spawn ENOENT
at exports._errnoException (util.js:742:11)
at Process.ChildProcess._handle.onexit (child_process.js:1027:32)
at child_process.js:1110:20
at process._tickCallback (node.js:382:11)
Hey guys!! This is an awesome app! I have local copy totally slaughtered so I can't test this quickly.. But I think I know the problem... when you call -> upd.run(execPath, null); spawn gets a spawn("string", null, {xxx}); I think is not liking it! Try upd.run(execPath, []); or change updater.js so it gets a [] as a second parameter instead of null
Has anyone found a confirmed way to work around this bug? I'm experiencing the same trouble on Windows 10—the .zip file downloads and extracts, but the new process never starts up when the old version quits.
Hmm @hermwong this is weird. The result of getAppPath and getAppPath should never be the same on Windows. See here https://github.com/edjafarov/node-webkit-updater/blob/master/app/updater.js#L138 that getAppExec is the result of joining getAppPath (the parent directory of the app) and the app's basename (therefore it's just process.execPath really).
did you try what I mentioned @amsoell ? child_process.spawn signature is (String[, Array][, Object]), and the updater ends up invoking with (<String>, null, <Object>). It's a 5 minutes check man https://github.com/edjafarov/node-webkit-updater/blob/master/examples/basic.js#L29