Although this requirement seems a bit illogical, what I need to achieve is an automatic update effect. ZIP downloaded from the server, compressed to another folder, and then close the old version before opening the new version.
Because it is based on NW.JS, it does not support multi-window preview, so before starting a new process (Nw window), you must first close the old process (nw window). Since NW 0.1.3, multiple windows at the same time are not supported. It's on, so. . Quite embarrassing. .
But I think it can definitely meet my needs. After all, there is a NW-AUTOUPDATER that has also been implemented, but it does not meet the project requirements and cannot be used, so I am asking all the experts for advice. Thank you!
It seems to be similar to the implementation in my framework...
https://github.com/llwslc/ele...
First download the zip package in the background, click upgrade to call the following code
Pass the current path path and program pid to update.exe, and then the program exits...
update.exe will monitor the pid until the pid disappears...
After the pid disappears, update.exe will decompress the zip package...
After decompression is completed, restart the main program and exit by yourself...
Just unzip directly under mac, no need to start a new program...