dsheiko / nw-autoupdater

⛔️ [DEPRECATED] Library provides low-level API to control NW.js app auto-updates
MIT License
75 stars 36 forks source link

FSPathMakeRef failed with error -43. #10

Open Arti3DPlayer opened 7 years ago

Arti3DPlayer commented 7 years ago

When app finished download, new app didn't launch. Tried with both strategies. In nw-autoupdater.log only one string: ERROR: FSPathMakeRef(/var/folders/5f/2w5ss9tn6ksgwmxkl1lrqyyh0000gn/T/nw-autoupdater/RaceFlight.app) failed with error -43.

Log with verbose: true https://pastebin.com/kQi48UWF

I used web2exe tool to build package

dsheiko commented 7 years ago

The errors means that the path defined in the bash script cannot be reached. It might happen with soft links. Guys were discussing the issue here https://github.com/dsheiko/nw-autoupdater/issues/6

I didn't yet publish v.1.1.1, but the latest changes available in master (including -L flag), it looks stable. So I would suggest you to try the last version:

cd example/client-strategy-script/
npm i dsheiko/nw-autoupdater
Arti3DPlayer commented 7 years ago

With version on mac v.1.1.1 log contains only:

rsync -al --delete /Users/output/app_name/mac-x64/. Users/output/app_name/mac-x64.bak/

On windows:

ERROR: The system cannot find the file specified.
ERROR: Error: spawn C:\Users\ARTEMH~1\AppData\Local\Temp\nw-autoupdater\RaceFlight ENOENT 
dsheiko commented 7 years ago

Does it work for you with the example application? Here what I do:

cd example/server
npm i
npm start
cd ../client-strategy-script
npm i
npm package
cd /tmp/Sandbox
unzip ~/Sites/nw-autoupdater/example/server/releases/nw-autoupdater-demo-r1.0.0-osx-x64.zip -d .
cd -
npm version patch
cd -
open -a nw-autoupdater-demo.app

As for the example demo to me on macOS Sierra (10.12.4) and Ubuntu 16.04 and Window 10 everything goes fine.

Arti3DPlayer commented 7 years ago

@dsheiko

npm start

> release-server@1.0.0 start /Users/artemhruzd/Downloads/nw-autoupdater-master/example/server
> node server.js

fs.js:1431
    throw error;
    ^

Error: watch releases ENOENT
    at exports._errnoException (util.js:1022:11)
    at FSWatcher.start (fs.js:1429:19)
    at Object.fs.watch (fs.js:1456:11)
    at Object.<anonymous> (/Users/artemhruzd/Downloads/nw-autoupdater-master/example/server/server.js:12:4)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)

npm ERR! Darwin 16.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v7.10.0
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! release-server@1.0.0 start: `node server.js`
npm ERR! Exit status 1
Arti3DPlayer commented 7 years ago

I tried node-webkit-updater it works nice on mac, but yours app looks much flexible:(

dsheiko commented 7 years ago

@Arti3DPlayer releases ENOENT... Apparently fs.watch cannot locate releases directory. Check that you have it as a subfolder for /example/server

I just added the directory releases to the repo master branch

Arti3DPlayer commented 7 years ago

@dsheiko I have a releases folder but it is empty...

dsheiko commented 7 years ago

Sure it is until you package. But empty dire shall allow you to start the server

cd example/server
npm i
npm start

because now the server has a directory t watch for changes. Thus you can proceed:

cd ../client-strategy-script
npm i
npm package

Now the builder has created a release package for you in server/releases folder. so you jump to arbitrary location where to we extract the obtained release package:

cd /tmp/Sandbox
unzip ~/Sites/nw-autoupdater/example/server/releases/nw-autoupdater-demo-r1.0.0-osx-x64.zip -d .

Now we have the first installation of the app. But as we test update, we rather first release a new version:

cd -
npm version patch

Done, we can switch back to app folder and run the application.

cd -
open -a nw-autoupdater-demo.app

Observe that app prompts for update.

Arti3DPlayer commented 7 years ago

Sorry for long response :( Now stuck on:

cd ../client-strategy-script
npm i
npm package

I tried to install nw locally with npm and directly from folder:

./nwjs-sdk-v0.22.3-osx-x64/nwjs.app/Contents/MacOS/nwjs package ~/Downloads/nw-autoupdater-master/example/client-strategy-script/

But npm package command not found or it just start app. What I'm missing now :(

npm 0.19.0 because latest has: https://github.com/nwjs/npm-installer/issues/56

Arti3DPlayer commented 7 years ago

oh, i missed run command...

npm run package

Arti3DPlayer commented 7 years ago

Ok, it doesn't work too. Downloading/Installing works fine but restart doesn't work

Only this strings in .log file:

rsync -al --delete /Users/artemhruzd/Downloads/. /Users/artemhruzd/Downloads.bak/
rsync -al --delete /Users/artemhruzd/Downloads/. /Users/artemhruzd/Downloads.bak/
dsheiko commented 7 years ago

In case your app is not signed MacOS will block it from opening (example app is unsigned!). But if you open the app from Finder and confirm you trust to this app it is going to work with restart

Arti3DPlayer commented 7 years ago

@dsheiko Do you have example how to sign nw.js app ? I tried MAS script from official doc and from Popcorn time app. Nothing works. After update with popcorn time sign script i got this:

screen shot 2017-07-26 at 23 35 29

After official MAS sign - app not open

JeffWinder commented 6 years ago

I have the same error with nw-autoupdater v1.1.4 (also tried v1.1.1): FSPathMakeRef .... failed with error -43 I packaged the app manually, not with nw-builder. And signed it with my own script which results in a signed and working app. So I have a signed app on my server with version 1.0.0 in the manifest and a signed app on my desktop, version 0.0.9. Downloading goes well, and the zip gets unpacked in the nw-autoupdater folder. The original app quits but there it stops. When I try to open the app in the nw-autoupdater folder it says it's a damaged file, although the size is the same and contents look good at first sight. When I unzip the downloaded zip manually, the unzipped app is working. I'm not using the server example, just upload the zip and add the number of bytes in the server package.json manually for now.

Any help is appreciated.

JeffWinder commented 6 years ago

I was able to fix the error. Apparently the module takes the name from the 'name' value in the manifest file which results an - for me - incorrect path, because I change the name of the app. So the path it's looking for is: FSPathMakeRef(/var/folders/5f/2w5ss9tn6ksgwmxkl1lrqyyh0000gn/T/nw-autoupdater/appnamefrommanifest.app) but that's not the name of the app when I unzip it. When I change that hardcoded in index.js line 53 this.options.executable = getExecutable( 'MyRealAppName' ); the error is gone.

But I'm still having this damaged file when it has been unzipped. Could that be related to me adding the filesize based on the size the system tells me?