Giter VIP home page Giter VIP logo

nw-autoupdater's People

Contributors

ales-tsurko avatar cry0m1 avatar dsheiko avatar fossabot avatar geolffreym avatar lynxtaa avatar madlittlemods avatar peter23 avatar y-ich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nw-autoupdater's Issues

App not swap with script

I use latest version 1.1.4 and when I call function restartToSwap app closes, start again, but didn't swap. I simply added alerts in restartToSwap function to check arguments

 async function restartToSwap(extraArgs = []){
    const { updateDir, logPath } = this.options,
          swap = swapFactory( this.options ),
          args = swap.getArgs().concat( extraArgs );

    swap.extractScript( updateDir );
    alert(swap.getRunner())
    alert(args)
    alert(updateDir)
    alert(logPath)
    await launch( swap.getRunner(), args, updateDir, logPath );
    nw.App.quit();
  }

alert(swap.getRunner())
/var/folders/5f/2w5ss9tn6ksgwmxkl1lrqyyh0000gn/T/nw-autoupdater/swap.sh

alert(args)

--app-path=/Users/artemhruzd/Jscode/rf_configurator/build/RaceFlight/osx64,
--update-path=/var/folders/5f/2w5ss9tn6ksgwmxkl1lrqyyh0000gn/T/nw-autoupdater,--runner=RaceFlight.app,
--bak-path=/Users/artemhruzd/Jscode/rf_configurator/build/RaceFlight/osx64/RaceFlight.app.bak

alert(updateDir)
/var/folders/5f/2w5ss9tn6ksgwmxkl1lrqyyh0000gn/T/nw-autoupdater
alert(logPath)
/Users/artemhruzd/Library/Application Support/RaceFlight/Default/nw-autoupdater.log

So paths looks right, but script only creats RaceFlight.app.bak folder and thats all. In logs i see only one line:

rsync -al --delete /Users/artemhruzd/Jscode/rf_configurator/build/RaceFlight/osx64/. /Users/artemhruzd/Jscode/rf_configurator/build/RaceFlight/osx64/RaceFlight.app.bak/

NWJS v0.41.2 (latest) structure changed (build with nwjs-builder-phoenix)

  • While --swap is running (copy files from tmp to orig place) and 2nd restart to finish update process from NWJS 0.41.2 to 0.41.2, I am facing errors:

(unknown) Error: EEXIST: file already exists, mkdir '/Users/username/Application-0.10.14-22-mac-x64/Application.app/Contents/_CodeSignature' selfUpdate

(unknown) Error: Cannot copy 'Versions/Current/nwjs Framework' to a subdirectory of itself, 'Versions/Current/nwjs Framework'. at private/var/folders/2y/54plz59s5h73z1b46gnfdgwc0000gn/T/AppTranslocation/64F8F2E1-CC86-4509-9ED6-116D8B7488E2/d/Application.app/Contents/Resources/app.nw/node_modules/fs-extra/lib/copy/copy.js:190 at FSReqCallback.oncomplete (fs.js:154) selfUpdate
and update hangs forever.

I can suppose those by new folder structure inside nwjs with symlinks (found them by investigating binaries to sign by apple developer id):
WAS (I do not know exact version when it was changed):
Contents/Versions/*/nwjs\ Framework.framework/nwjs\ Framework Contents/Versions/*/nwjs\ Framework.framework/Versions/A/ Contents/Versions/*/nwjs\ Framework.framework/Versions/Current/ Contents/Versions/*/nwjs\ Helper.app/Contents/MacOS/nwjs\ Helper Contents/Versions/*/nwjs\ Framework.framework/Helpers/crashpad_handler Contents/MacOS/nwjs

NOW (NWJS v0.41.2 (latest) structure changed (build with nwjs-builder-phoenix 1.15.0 latest)):
Contents/Frameworks/nwjs\ Framework.framework/Versions/*/nwjs\ Framework Contents/Frameworks/nwjs\ Framework.framework/Versions/*/Helpers/nwjs\ Helper.app/Contents/MacOS/nwjs\ Helper Contents/Frameworks/nwjs\ Framework.framework/Versions/*/Helpers/nwjs\ Helper\ \(GPU\).app/Contents/MacOS/nwjs\ Helper\ \(GPU\) Contents/Frameworks/nwjs\ Framework.framework/Versions/*/Helpers/nwjs\ Helper\ \(Plugin\).app/Contents/MacOS/nwjs\ Helper\ \(Plugin\) Contents/Frameworks/nwjs\ Framework.framework/Versions/*/Helpers/nwjs\ Helper\ \(Renderer\).app/Contents/MacOS/nwjs\ Helper\ \(Renderer\) Contents/Frameworks/nwjs\ Framework.framework/Versions/*/Helpers/chrome_crashpad_handler Contents/Frameworks/nwjs\ Framework.framework/Versions/*/Helpers/app_mode_loader Contents/MacOS/Application

  • If from NWJS 0.37.4 to 0.41.2, I am facing only error:
    (unknown) Error: EEXIST: file already exists, mkdir '/Users/username/Application-0.10.14-22-mac-x64/Application.app/Contents/_CodeSignature' selfUpdate
    and update 2nd restart succeeds.

  • Earlier works without any issues at all.

NB: symbol '*' is:
drwx------ 9 badayka staff 288 Oct 1 17:19 77.0.3865.90 lrwxr-xr-x 1 badayka staff 12 Oct 1 17:19 Current -> 77.0.3865.90

I am not sure this is a problem of nw-autoupdater, maybe nwjs-builder-phoenix.

nw-autoupdater: 1.1.10 (latest)
nwjs-builder-phoenix: 1.15.0 (latest)

Folder backup

Is there any way to stop creating back up.?
is there any way to hide "xcopy" command execution for better user experience?
is it possible that update can happen on next start of the application?

Script Strategy

Is there any way to hide hide the xcopy command execution from the user, with some custom text.

Nwjs prevent start of application copy

MacOS Sierra.
Main application is running, it downloads/unpack new release successfully, but cannot start this new release (another copy of app). Even running downloaded release (copy) from /var/folders/64/..../T/nw-autoupdate manually using different options (-a or/and -n) will not succeeded, application is not started.

Maybe I did a mistake?

The only way to run a copy of nwjs app I found is to remove app caches (leads to fresh app):
rm -rf /Users/%USERNAME%/Library/Caches/%APPNAME% && rm -rf /Users/%USERNAME%/Library/Application\ Support/%APPNAME%

freeze screen

NWJS Version : 0.25.3
Operating System : Win 10

Actual behavior

Windows 10 freeze crash when starting the application it stays frozen, I am using reactjs for the development of the application, in linux and mac everything works well

<!-
erro.log

CPU: amd64
family 6 model 61 stepping 4
4 CPUs

GPU: UNKNOWN

Crash reason: EXCEPTION_ACCESS_VIOLATION_READ
Crash address: 0xffffffffffffffff
Process uptime: 36 seconds

Thread 0 (crashed)
0 nw.dll + 0x44076f3
rax = 0x000001b1e9f5b650 rdx = 0x000001b1ebe95280
rcx = 0x000001b1e9f5b650 rbx = 0x00007ffcdccb2820
rsi = 0x00000063c45ff140 rdi = 0x00007ffcdcf21d80
rbp = 0x00000063c45fed80 rsp = 0x00000063c45fec78
r8 = 0x0000000000000020 r9 = 0x000000004436e898
r10 = 0x00000063c45ff180 r11 = 0x00000063c45fed30
r12 = 0x0000000000000000 r13 = 0x000001b1e6b20b50
r14 = 0x00007ffcdc232920 r15 = 0x000001b1e6b20c78
rip = 0x00007ffcdbb576f3
Found by: given as instruction pointer in context
1 ntdll.dll + 0x60800
rbp = 0x00000063c45fedb0 rsp = 0x00000063c45fed90
rip = 0x00007ffd138e0800
Found by: previous frame's frame pointer
2 nw.dll + 0x57d1d20
rsp = 0x00000063c45fede0 rip = 0x00007ffcdcf21d20
Found by: stack scanning
3 nw.dll + 0x15ff5e6
rsp = 0x00000063c45fee00 rip = 0x00007ffcd8d4f5e6
Found by: stack scanning
4 nw.dll + 0x4d1a4c0
rsp = 0x00000063c45fee08 rip = 0x00007ffcdc46a4c0
Found by: stack scanning
5 nw.dll + 0x15ff970
rsp = 0x00000063c45fee10 rip = 0x00007ffcd8d4f970
Found by: stack scanning
6 nw.dll + 0x1a4d9bc
rsp = 0x00000063c45fee70 rip = 0x00007ffcd919d9bc
Found by: stack scanning
7 MSCTF.dll + 0x108db
rsp = 0x00000063c45fef60 rip = 0x00007ffd10e208db
Found by: stack scanning
8 nw.dll + 0x165412d
rsp = 0x00000063c45fef90 rip = 0x00007ffcd8da412d
Found by: stack scanning
9 USER32.dll + 0x11ae6
rsp = 0x00000063c45fefa0 rip = 0x00007ffd12aa1ae6
Found by: stack scanning
10 USER32.dll + 0x11e1e
rsp = 0x00000063c45fefa8 rip = 0x00007ffd12aa1e1e
Found by: stack scanning
11 nw.dll + 0x15fcab2
rsp = 0x00000063c45fefc0 rip = 0x00007ffcd8d4cab2
Found by: stack scanning
12 nw.dll + 0x16540f2
rsp = 0x00000063c45fefe0 rip = 0x00007ffcd8da40f2
Found by: stack scanning
13 nw.dll + 0x4a98f10
rsp = 0x00000063c45fefe8 rip = 0x00007ffcdc1e8f10
Found by: stack scanning
14 nw.dll + 0x15fcbab
rsp = 0x00000063c45ff010 rip = 0x00007ffcd8d4cbab
Found by: stack scanning
15 nw.dll + 0x15ef201
rsp = 0x00000063c45ff030 rip = 0x00007ffcd8d3f201
Found by: stack scanning
16 nw.dll + 0x15b7ec8
rsp = 0x00000063c45ff040 rip = 0x00007ffcd8d07ec8
Found by: stack scanning
17 nw.dll + 0x15b7f6b
rsp = 0x00000063c45ff060 rip = 0x00007ffcd8d07f6b
Found by: stack scanning
18 nw.dll + 0x494cab0
rsp = 0x00000063c45ff068 rip = 0x00007ffcdc09cab0
Found by: stack scanning
19 nw.dll + 0x4a98f10
rsp = 0x00000063c45ff070 rip = 0x00007ffcdc1e8f10
Found by: stack scanning
20 nw.dll + 0x4a98f10
rsp = 0x00000063c45ff098 rip = 0x00007ffcdc1e8f10
Found by: stack scanning
21 nw.dll + 0x15fe5a0
rsp = 0x00000063c45ff0b0 rip = 0x00007ffcd8d4e5a0
Found by: stack scanning
22 nw.dll + 0x15fe2bb
rsp = 0x00000063c45ff0c0 rip = 0x00007ffcd8d4e2bb
Found by: stack scanning
23 nw.dll + 0x4990828
rsp = 0x00000063c45ff0f8 rip = 0x00007ffcdc0e0828
Found by: stack scanning
24 nw.dll + 0x5562820
rsp = 0x00000063c45ff100 rip = 0x00007ffcdccb2820
Found by: stack scanning
25 nw.dll + 0x4407e58
rsp = 0x00000063c45ff110 rip = 0x00007ffcdbb57e58
Found by: stack scanning
26 nw.dll + 0x1a0e9a7
rsp = 0x00000063c45ff118 rip = 0x00007ffcd915e9a7
Found by: stack scanning
27 nw.dll + 0x16703f6
rsp = 0x00000063c45ff120 rip = 0x00007ffcd8dc03f6
Found by: stack scanning
28 nw.dll + 0x4990828
rsp = 0x00000063c45ff168 rip = 0x00007ffcdc0e0828
Found by: stack scanning
29 nw.dll + 0x5562820
rsp = 0x00000063c45ff170 rip = 0x00007ffcdccb2820
Found by: stack scanning
30 nw.dll + 0x4407e58
rsp = 0x00000063c45ff180 rip = 0x00007ffcdbb57e58
Found by: stack scanning
31 nw.dll + 0x1a0e9a7
rsp = 0x00000063c45ff188 rip = 0x00007ffcd915e9a7
Found by: stack scanning
32 nw.dll + 0x16703f6
rsp = 0x00000063c45ff190 rip = 0x00007ffcd8dc03f6
Found by: stack scanning
33 nw.dll + 0x1654e61
rsp = 0x00000063c45ff1d0 rip = 0x00007ffcd8da4e61
Found by: stack scanning
34 nw.dll + 0x4a98f10
rsp = 0x00000063c45ff1f0 rip = 0x00007ffcdc1e8f10
Found by: stack scanning
35 nw.dll + 0x15e612e
rsp = 0x00000063c45ff200 rip = 0x00007ffcd8d3612e
Found by: stack scanning
36 nw.dll + 0x16553b4
rsp = 0x00000063c45ff240 rip = 0x00007ffcd8da53b4
Found by: stack scanning
37 nw.dll + 0x4a98f10
rsp = 0x00000063c45ff248 rip = 0x00007ffcdc1e8f10
Found by: stack scanning
38 nw.dll + 0x15e7bb9
rsp = 0x00000063c45ff260 rip = 0x00007ffcd8d37bb9
Found by: stack scanning
39 nw.dll + 0x161f1a3
rsp = 0x00000063c45ff290 rip = 0x00007ffcd8d6f1a3
Found by: stack scanning
40 nw.dll + 0x1de401a
rsp = 0x00000063c45ff2a0 rip = 0x00007ffcd953401a
Found by: stack scanning
41 nw.dll + 0x4cd1eb8
rsp = 0x00000063c45ff2c8 rip = 0x00007ffcdc421eb8
Found by: stack scanning
42 nw.dll + 0x4ac89e0
rsp = 0x00000063c45ff320 rip = 0x00007ffcdc2189e0
Found by: stack scanning
43 nw.dll + 0x1494eb3
rsp = 0x00000063c45ff330 rip = 0x00007ffcd8be4eb3
Found by: stack scanning
44 nw.dll + 0x13ce9b4
rsp = 0x00000063c45ff340 rip = 0x00007ffcd8b1e9b4
Found by: stack scanning
45 nw.dll + 0x492cdc0
rsp = 0x00000063c45ff360 rip = 0x00007ffcdc07cdc0
Found by: stack scanning
46 nw.dll + 0x4da33b
rsp = 0x00000063c45ff370 rip = 0x00007ffcd7c2a33b
Found by: stack scanning
47 nw.dll + 0x4d8dfa
rsp = 0x00000063c45ff3c0 rip = 0x00007ffcd7c28dfa
Found by: stack scanning
48 nw.dll + 0x4da742
rsp = 0x00000063c45ff410 rip = 0x00007ffcd7c2a742
Found by: stack scanning
49 nw.dll + 0x4a98f10
rsp = 0x00000063c45ff418 rip = 0x00007ffcdc1e8f10
Found by: stack scanning
50 nw.dll + 0x4d4708
rsp = 0x00000063c45ff440 rip = 0x00007ffcd7c24708
Found by: stack scanning
51 nw.dll + 0x4a98f10
rsp = 0x00000063c45ff450 rip = 0x00007ffcdc1e8f10
Found by: stack scanning
52 nw.dll + 0x4a98f10
rsp = 0x00000063c45ff460 rip = 0x00007ffcdc1e8f10
Found by: stack scanning
53 nw.dll + 0x15bd1dc
rsp = 0x00000063c45ff470 rip = 0x00007ffcd8d0d1dc
Found by: stack scanning
54 nw.dll + 0x12b15fd
rsp = 0x00000063c45ff490 rip = 0x00007ffcd8a015fd
Found by: stack scanning
55 nw.dll + 0x4a98f10
rsp = 0x00000063c45ff4a8 rip = 0x00007ffcdc1e8f10
Found by: stack scanning
56 0x7ff75f730000
rsp = 0x00000063c45ff4b8 rip = 0x00007ff75f730000
Found by: stack scanning
57 nw.dll + 0x12b14ed
rsp = 0x00000063c45ff4d0 rip = 0x00007ffcd8a014ed
Found by: stack scanning
58 0x7ff75f730000
rsp = 0x00000063c45ff538 rip = 0x00007ff75f730000
Found by: stack scanning
59 nw.dll + 0x12b0c50
rsp = 0x00000063c45ff580 rip = 0x00007ffcd8a00c50
Found by: stack scanning
60 nw.dll + 0x48a0a00
rsp = 0x00000063c45ff5a0 rip = 0x00007ffcdbff0a00
Found by: stack scanning
61 0x7ff75f730000
rsp = 0x00000063c45ff5a8 rip = 0x00007ff75f730000
Found by: stack scanning
62 nw.dll + 0xda490
rsp = 0x00000063c45ff5b0 rip = 0x00007ffcd782a490
Found by: stack scanning
63 nw_elf.dll + 0x2dfb0
rsp = 0x00000063c45ff5b8 rip = 0x00007ffce04cdfb0
Found by: stack scanning
64 nw_elf.dll + 0x2dfb0
rsp = 0x00000063c45ff5c0 rip = 0x00007ffce04cdfb0
Found by: stack scanning
65 0x7ff75f730000
rsp = 0x00000063c45ff5e0 rip = 0x00007ff75f730000
Found by: stack scanning
66 nw.dll + 0x48a22c0
rsp = 0x00000063c45ff600 rip = 0x00007ffcdbff22c0
Found by: stack scanning
67 nw.dll + 0x4adb470
rsp = 0x00000063c45ff608 rip = 0x00007ffcdc22b470
Found by: stack scanning
68 nw.dll + 0x585db48
rsp = 0x00000063c45ff610 rip = 0x00007ffcdcfadb48
Found by: stack scanning
69 watchIT.exe + 0x921b
rsp = 0x00000063c45ff650 rip = 0x00007ff75f73921b
Found by: stack scanning
70 ntdll.dll + 0x60800
rsp = 0x00000063c45ff670 rip = 0x00007ffd138e0800
Found by: stack scanning
71 watchIT.exe + 0x4e52f
rsp = 0x00000063c45ff6c8 rip = 0x00007ff75f77e52f
Found by: stack scanning
72 0x7ff75f730000
rsp = 0x00000063c45ff6e8 rip = 0x00007ff75f730000
Found by: stack scanning
73 0x7ffcd7750000
rsp = 0x00000063c45ff6f8 rip = 0x00007ffcd7750000
Found by: stack scanning
74 watchIT.exe + 0xc9c50
rsp = 0x00000063c45ff700 rip = 0x00007ff75f7f9c50
Found by: stack scanning
75 watchIT.exe + 0x5dd3
rsp = 0x00000063c45ff708 rip = 0x00007ff75f735dd3
Found by: stack scanning
76 KERNELBASE.dll + 0x51b85
rsp = 0x00000063c45ff710 rip = 0x00007ffd10161b85
Found by: stack scanning
77 0x7ffd13600000
rsp = 0x00000063c45ff718 rip = 0x00007ffd13600000
Found by: stack scanning
78 watchIT.exe + 0x5dd3
rsp = 0x00000063c45ff740 rip = 0x00007ff75f735dd3
Found by: stack scanning
79 watchIT.exe + 0x5de0
rsp = 0x00000063c45ff760 rip = 0x00007ff75f735de0
Found by: stack scanning
80 0x7ff75f730000
rsp = 0x00000063c45ff788 rip = 0x00007ff75f730000
Found by: stack scanning
81 watchIT.exe + 0xc9d8c
rsp = 0x00000063c45ff7a0 rip = 0x00007ff75f7f9d8c
Found by: stack scanning
82 watchIT.exe + 0x921b
rsp = 0x00000063c45ff7d0 rip = 0x00007ff75f73921b
Found by: stack scanning
83 0x7ff75f730000
rsp = 0x00000063c45ff810 rip = 0x00007ff75f730000
Found by: stack scanning
84 watchIT.exe + 0x61e6
rsp = 0x00000063c45ff830 rip = 0x00007ff75f7361e6
Found by: stack scanning
85 0x7ff75f730000
rsp = 0x00000063c45ff850 rip = 0x00007ff75f730000
Found by: stack scanning
86 watchIT.exe + 0x5437
rsp = 0x00000063c45ff860 rip = 0x00007ff75f735437
Found by: stack scanning
87 watchIT.exe + 0xc9d8c
rsp = 0x00000063c45ff8a0 rip = 0x00007ff75f7f9d8c
Found by: stack scanning
88 watchIT.exe + 0xf5070
rsp = 0x00000063c45ff8b0 rip = 0x00007ff75f825070
Found by: stack scanning
89 watchIT.exe + 0x71b73
rsp = 0x00000063c45ff920 rip = 0x00007ff75f7a1b73
Found by: stack scanning
90 ntdll.dll + 0x6bb42
rsp = 0x00000063c45ff930 rip = 0x00007ffd138ebb42
Found by: stack scanning
91 watchIT.exe + 0x82ba6
rsp = 0x00000063c45ff950 rip = 0x00007ff75f7b2ba6
Found by: stack scanning
92 watchIT.exe + 0x82fe6
rsp = 0x00000063c45ff980 rip = 0x00007ff75f7b2fe6
Found by: stack scanning
93 watchIT.exe + 0xc4d10
rsp = 0x00000063c45ff988 rip = 0x00007ff75f7f4d10
Found by: stack scanning
94 watchIT.exe + 0x812f
rsp = 0x00000063c45ff990 rip = 0x00007ff75f73812f
Found by: stack scanning
95 watchIT.exe + 0xf98c0
rsp = 0x00000063c45ff998 rip = 0x00007ff75f8298c0
Found by: stack scanning
96 watchIT.exe + 0x7107a
rsp = 0x00000063c45ff9c0 rip = 0x00007ff75f7a107a
Found by: stack scanning
97 watchIT.exe + 0x7019d
rsp = 0x00000063c45ff9d0 rip = 0x00007ff75f7a019d
Found by: stack scanning
98 watchIT.exe + 0xf9d40
rsp = 0x00000063c45ff9d8 rip = 0x00007ff75f829d40
Found by: stack scanning
99 watchIT.exe + 0xc4d10
rsp = 0x00000063c45ff9e0 rip = 0x00007ff75f7f4d10
Found by: stack scanning
100 watchIT.exe + 0x707d3
rsp = 0x00000063c45ffa60 rip = 0x00007ff75f7a07d3
Found by: stack scanning
101 KERNEL32.DLL + 0x8364
rsp = 0x00000063c45ffaa0 rip = 0x00007ffd13608364
Found by: stack scanning
102 ntdll.dll + 0x670d1
rsp = 0x00000063c45ffad0 rip = 0x00007ffd138e70d1
Found by: stack scanning
103 KERNELBASE.dll + 0x54e20
rsp = 0x00000063c45ffb00 rip = 0x00007ffd10164e20
Found by: stack scanning

Unable to update after packaging using InnoSetup

I've ran into a weird problem. Auto updates work when not handled as an installed product - if I just copy everything into a directory on the local machine and run the app on Windows 7 or Windows 10, it will happily update without error. Perfect.

However, when I package the project for distribution using InnoSetup or similar, it harfs when it tries to require("nw-autoupdater") with a module not found. Oddly, zipping up the project doesn't have the same effect.

Run swap as administrator?

I couldn't find anyway of making the swap operation as an administrator.

It's failing for me with an EPERM error (code -4048, syscall 'unlink').

I tried opening a command line and running the call to the temp exe file myself and it failed the same, calling it in a command line opened as an administrator succeeded.
I'm guessing it's because my program files directory requires UAC elevation for any changes (which was the default windows 10 behavior for me).

Can I make the swap operation elevate to admin privileges?

Request to move repo under NW Userland

Hi @dsheiko,

I'm part of a GitHub org called NW Utils. I'm trying to consolidate NW tooling so it's easier to find useful projects and give much needed life to stagnant ones. I also think this would be a great opportunity to exchange ideas and learn new things. Let me know what you think and if you’d be willing to.

Best Regards
Ayushman

download event doesn't work properly

Hello i have the following code:

var AutoUpdater = require("nw-autoupdater");
        var updater = new AutoUpdater(nw.App.manifest, {
            strategy: "ScriptSwap"
        });

        updater.on("download", function(downloadSize, totalSize ) {
            console.log('Downloading...');
            console.log("download progress", Math.floor(downloadSize/totalSize * 100), "%" );
        });

        updater.on("install", function(installFiles, totalFiles ) {
            console.log("install progress", Math.floor(installFiles/totalFiles * 100 ), "%" );
        });

        // Download/unpack update if any available
        updater.readRemoteManifest().then(function(rManifest) {
            updater.checkNewVersion(rManifest).then(function(needsUpdate ) {
                if (!needsUpdate) {
                    console.log('App is up to date..');
                    return;
                }

                if (!confirm("New release is available. Do you want to upgrade?")) {
                    return;
                }

                updater.download(rManifest).then(function (updateFile) {
                    console.log(updateFile)
                    // updater.unpack(updateFile).then(function() {
                    //     console.log('The application will automatically restart to finish installing the update');
                    //     updater.restartToSwap();
                    // });
                }, function (error) {
                    console.log(error)
                });
            }, function (error) {
                console.log(error)
            });
        }, function (error) {
            console.log(error)
        });

But download event only fired only once when zip file already finished.

Version:
"nw-autoupdater": "^1.1.0",

FSPathMakeRef failed with error -43.

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

damaged update file

on Mac, it downloads the new version and when opening, it says the file is damaged and I should move it to the trash. However, the file is working.

App does not restart after exiting post update (LINUX)

Hey @dsheiko hope you can help me out here.

Current OS - linux x64
I am currently following basic steps (swapping strategy)

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

App downloads update successfully, backup folder is created successfully, current app exits but new one does not restart. I tried supplying a log file and checking for logs but there are no errors being reported there. I know that we open a background process via spawn to perform the swapping but i cannot figure out where to look for errors occurring in that spawned process (assuming there's some error in that process which prevents new app to start). Can you guide me as to where should i look for logs that may indicate why the restart fails ?

Also i cannot perform the update unless i start the application using sudo as without it app is unable to unzip the new version in /tmp folder because of insufficient permissions. I temporarily changed /tmp permissions to get around this.

Thanks for this project, appreciate your efforts !

Beta 1.1.0 macos errors.

Unsuccess test. I did not do complete test/debug due to insufficient time.

Again, swap.sh creates backup of parent folder for application.app, imagine it is in standard macos /Applications folder, backup 30GB.

First run in mac:

index.html:67 Error: spawn EACCES
    at exports._errnoException (util.js:1050:11)
    at ChildProcess.spawn (internal/child_process.js:319:11)
    at exports.spawn (child_process.js:378:9)
    at Promise (/Users/%USER%/%APP%/node_modules/nw-autoupdater/Lib/utils.js:46:15)
    at Promise (<anonymous>)
    at launch (/Users/%USER%/%APP%/node_modules/nw-autoupdater/Lib/utils.js:43:11)
    at AutoUpdater.restartToSwap (/Users/%USER%/%APP%/node_modules/nw-autoupdater/Lib/Strategy/ScriptSwap.js:15:11)

Just add fs.chmodSync(scriptPath, '0755'); to /Lib/Swap/Mac.js

If something went wrong, application re-run causes:

index.html:67 Error: Cannot unpack .tar.gz package /var/folders/64/sthbgckj4xgbsd_t11pfxpjc0000gn/T/mac-x64.tar.gz
    at AutoUpdater.unpack (/Users/%USER%/%APP%/node_modules/nw-autoupdater/index.js:126:19)
    at <anonymous>

Finally swap.sh created folder back of mac os app, but did not copy new app to orig place and did not start it as well.

Dont't understand how to write VERBOSE .

Thanks for reading!
const updater = new AutoUpdater( require( "../package.json" ), {strategy: 'ScriptSwap', verbose: true});
Is that right?
If right, where to write the following script?How to declare variable of this script?

I just want to replace the index.html and static folder.

THX again!

Error during installation of an update (EMFILE: too many open files)

Hello everyone, i am having some troubles to use nw-autoupdater, i get this error:
EMFILE: too many open files, open '/tmp/nw-autoupdater/package.nw/node_modules/node-libs-browser/mock/empty.js'

downloaded zip size: 109.9 MB
nw: 0.29.4
nw-autoupdater: 1.1.4
OS: Fedora 26

Doesn't restart after update, but updates without problems

I am using the swap() function and then the restart() function to replace the original app with the updated version and start it up.
const updateFile = await updater.download(rManifest); await updater.unpack(updateFile); await updater.swap(); alert(The application will automatically restart to finish installing the update); await updater.restart();

If I close the app and open it back, it is perfectly updated, but it won't automatically restart the app after the update.

Remove dependencies, compile into one file

In my project i use nwjc to protect my source code. I uglify all my js files to one and then use

nwjc app/all.min.js app/app.bin

But after i installed your library I get about new 30 folders with a lot of dependencies .... Is this possible somehow to include in your project .min.js version, that doesn't need any dependencies ?

I tried, but they are so deep, that i can't make it work after minimize file

Thanks

unable to do anything other than output.innerHTML=''

My auto updater works perfectly. It added such a convenient feature to my desktop app. I appreciate the efforts for this repo. However, I am having problems changing the part where I show users that the app is swapping to the new version. In the if statement, the codes that I indicated in the picture dont work. I am a beginner to javascript and I could not figure out why this is happening.
screen shot 2018-04-06 at 8 22 22 pm

I am not able to see the errors in the console because I cannot use the console I am trying the updater in a actual dist version. I would appreciate if anyone suggests a solution for this issue.

License file is missing in repo

Hi,

Can you please add License file inside repo. I know that license is ISC from npmjs.com, but please add one inside repo.

app.bak file in the same directory with app on Mac

#26 I am trying to use the
await updater.swap(); and
await updater.restart();

method to update the app and restart it from the same place. However this creates app.bak and credits.html files:
screen shot 2018-04-03 at 6 36 02 pm

Since I want my users to be able to drag the app icon to apps folder to install it, Im not using an installer. How can we hide that file somewhere else after the update? to not have it in the Applications folder.

Another issue I have is await updater.restart(); doesn't restart the app

Symlinks with absolute paths in temp folder on macOS with NW.js 0.22.x

This is related to nwjs/nw.js#5873.
Starting with 0.22.0 nwjs includes symlinks in distro for macOS.
Those symlinks with relative paths are included into update packages after fixes done for evshiron/nwjs-builder-phoenix#30.
When extracted into temp location those symlinks have absolute path due to https://github.com/bower/decompress-zip/blob/master/lib/extractors.js#L109.
Once extracted update package is rsync'ed into original (app home) location as part of swap.sh it has symlinks pointing to absolute locations of the folders from temp directory, which leads to easy to guess consequences of clearing that temp folder.

We are currently hacking this by replacing decompress-zip/lib/extractors.symlink operation in runtime with a monkey-patched version that has the following code:

      return symlink(linkTo /* path.resolve(parent, linkTo) */, destination)

It produces symlinks with relative paths in the temporary update location and they are rsync'ed correctly.
Alternatively, swap.sh could be changed to include -L option for rsync to recursively copy content behind those symlinks, but then one probably would have to deal with duplicate copies and potentially some other issues.

It would be great to make sure that symlinks with relative paths are supported in unpacking as it seems that this is how it's going to be packaged for macOS moving forward.

Callback fuction not defined in nodejs - chmod inside linux.js(Version - 1.1.11)

Received error while relaunches the downloaded release

The linux.js(nw-autoupdater/Lib/Swap/Linux.js) Library - extract function is using Nodejs chmod function whereas the call back function is not defined and the script is generating a type error.

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined
    at makeCallback (fs.js:161:11)
    at Object.chmod (fs.js:1218:14)
    at SwapLinux.extractScript (/tmp/.io.nwjs.islKfA/node_modules/nw-autoupdater/Lib/Swap/Linux.js:19:8)

We are receiving the error when nw-autoupdater is trying to restart the node WebKit application after its downloads and installed the files from the server. Also, this issue appears only in linux OS for Windows it's working fine. For the reference below I have defined the extract function which is used by linux.js

  extractScript( homeDir )
  {
    let content = this.getScriptContent() + `
echo " "
echo "$APP_PATH/\${RUNNER}&"
"$APP_PATH/\${RUNNER}"&`,
        scriptPath = join( homeDir, "swap.sh" );
    fs.writeFileSync( scriptPath, content, "utf8" );
    fs.chmod( scriptPath, 511 ); // 755
    this.scriptPath = scriptPath;
  }

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.