Giter VIP home page Giter VIP logo

Comments (11)

dsheiko avatar dsheiko commented on July 2, 2024

Thanks for the info. I am going to research on it.

from nw-autoupdater.

cryomi avatar cryomi commented on July 2, 2024

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.

dsheiko avatar dsheiko commented on July 2, 2024

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.

cryomi avatar cryomi commented on July 2, 2024

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.

dsheiko avatar dsheiko commented on July 2, 2024

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.

cryomi avatar cryomi commented on July 2, 2024

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.

dsheiko avatar dsheiko commented on July 2, 2024

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.

dsheiko avatar dsheiko commented on July 2, 2024

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.

cryomi avatar cryomi commented on July 2, 2024

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);

  1. macos - excessive path spaces quoting with "\ " in args/argv.
  2. unhandled paths for MacOS %APPNAME%.app when nwjs binary is inside package.
  3. differences between backup creation on mac/win_linux, we need create %APPNAME%.app.bak for macos, and %FOLDER_NAME%.bak for win/linux.
  4. 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.

dsheiko avatar dsheiko commented on July 2, 2024

Can you please create a pull request?

from nw-autoupdater.

cryomi avatar cryomi commented on July 2, 2024

Yep, done. Thank you.

from nw-autoupdater.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.