1.0.0 • Published 3 years ago
@crazyvinc/updater v1.0.0
AutoUpdater
This update system is used in @CrazyVinc/Led-Controller
Features
- Get remote version from JSON
- Download the update.
- Extractor with the function to specify what to extract
- Run npm install with the default extractor
- Automatically download the correct extractor.
- Define your own extractor
Example to run the default updater and run npm install
autoupdater -dest=./ -zip=./temp/update.zip -extractfile=installer.json -npm
To use the built-in extractor, You can define what to extract:
{ "extract": { "files": [ "/index.js", "/installer.json", "/package.json" ], "directories": [ "/src" ] } }
Recommend use:
- Use a launcher to run your main program.
- Let your program scan for updates in the background.
- If a update is found, install the update and the extractor.
- Let your main program communicate to your launcher that there is a update ready to install.
- Send a JSON object with the path to the update and the path to the extractor
- Send a prepared commandline string.
- Let the launcher stop your program and start the update-extractor (with child process spawn).
- Start your main program as soon the update-extractor is closed.
You can use the @CrazyVinc/Led-Controller Launcher and change it according to your own use
1.0.0
3 years ago