Comments (11)
Thanks for the info. I am going to research on it.
from nw-autoupdater.
I realized I can do it manually only, I am talking about running another nwjs app while previous still opened. Did you test it on MacOS Sierra? Is it working for you? I read documentation of nodejs about 'spawn' - seems it should work, but I am not able to complete update process, because detached child never got up and running.
from nw-autoupdater.
It runs the second copy of NWjs because restartToSwap() runs it with option:
--user-data-dir=${tpmUserData}
where tpmUserData = join( nw.App.dataPath, "swap" )
what shall be ~/Library/Application\ Support/nw-autoupdater-demo/swap
. It differs from default one and is not locked by previous instance.
Besides in index.html I use the options:
updater = new AutoUpdater( require( "./package.json" ), {
homeDir: "/Users/sheiko/Sites/test",
backupDir: "/Users/sheiko/Sites/test.bak"
}),
because for Mac app it's pretty hard to figure out the app container folder.
And of course MacOS security gate will block restart until you tell otherwise.
P.S. BTW errors while running detached process on first restart logged in `~/Library/Application\ Support/nw-autoupdater-demo/swap.log
from nw-autoupdater.
Yep, I see, but I restartToSwap() on my machine did not start child.
So it works fine for you?
I think to do launcher based on your solution: check -> download -> unpack to inner folder every build -> exit -> start launcher -> launcher checks everyhing ok -> remove folder with old build -> switch to new build changing document.location.href
I checked MVP - works for me.
from nw-autoupdater.
Yeah, it starts. I had to allow launching it in the Security section of the system preferences as one of unidentified dev, but works (macOS Sierra 10.12.3)
I believe it shall look like the app updates itself in its original folder. In ideal world I would use a swap utility (a light-weight native app) instead of NWjs, but could not find one, universal for all 3 platforms.
from nw-autoupdater.
You mentioned
updater = new AutoUpdater( require( "./package.json" ), {
homeDir: "/Users/sheiko/Sites/test",
backupDir: "/Users/sheiko/Sites/test.bak"
}),
What are these folders? Inside APPNAME.app is? Why it operates by folders not *.app files (imagine *.app file is placed at /Applications folder).
Description is quite a mess of misunderstanding. It is not oblivious how it works under the hood.
Finally it started too work, thank you very much.
from nw-autoupdater.
On Ubuntu/Windows I use for the home dir dirname( process.execPath )
. That is the folder where the self-extracting archive built by nwjs-builder is located (process.cwd()
points to temp directory where that archive is unpacked to). The problem here that under MacOS process.execPath
points to the executable inside Mac app structure (something like project-dir/nw-autoupdater-demo.app/Contents/MacOS/nwjs
- not very useful when we need just project-dir
). Backup directory by default is built from home one by concatenating ".bak". So what I suggest is to set the directories explicitly. It can be any writable directories. I just created two in my workspace ~/Sites/
from nw-autoupdater.
homeDir/backupDir optional parameters to AutoUpdater, which is part of API (https://github.com/dsheiko/nw-autoupdater/blob/master/example/client/index.html)
from nw-autoupdater.
Hi, will you join my pull request, if yes - I need to prepare it, also we need to update README to make it more descriptive about initial data, I found some bugs:
My nwjs app builds with 'nw-builder':
macos - %APPNAME%.app (compressed *.app file for release);
win/linux - %FOLDER_NAME% with binary and other necessary files inside (compressed all files inside this folder for release);
- macos - excessive path spaces quoting with "\ " in args/argv.
- unhandled paths for MacOS %APPNAME%.app when nwjs binary is inside package.
- differences between backup creation on mac/win_linux, we need create %APPNAME%.app.bak for macos, and %FOLDER_NAME%.bak for win/linux.
- fix for MacOS Sierra, did you notice new app is starting in sanbox Apple called AppTranslocation?
I tested on macos sierra / win10 / ubuntu 12 - works fine with my changes.
from nw-autoupdater.
Can you please create a pull request?
from nw-autoupdater.
Yep, done. Thank you.
from nw-autoupdater.
Related Issues (20)
- App does not swap when built with https://github.com/evshiron/nwjs-builder-phoenix HOT 4
- App does not restart after exiting post update (LINUX) HOT 3
- freeze screen
- Failed to compile (with create-react-app) HOT 1
- App not swap with script
- app.bak file in the same directory with app on Mac
- Doesn't restart after update, but updates without problems HOT 1
- unable to do anything other than output.innerHTML=''
- Unable to update after packaging using InnoSetup
- Error during installation of an update (EMFILE: too many open files)
- damaged update file
- Script Strategy HOT 1
- Folder backup
- Unable to download from AWS Cloudfront URL
- License file is missing in repo HOT 1
- NWJS v0.41.2 (latest) structure changed (build with nwjs-builder-phoenix) HOT 1
- Can not support https request HOT 4
- The default script deletes ALL files in folder (Mac)
- Callback fuction not defined in nodejs - chmod inside linux.js(Version - 1.1.11) HOT 1
- Request to move repo under NW Userland
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nw-autoupdater.