What do we do to autoupdate (see example)
readRemoteManifest
reads manifest from the remote release servercheckNewVersion( rManifest )
checks if the version in the remote manifest greater than one of the local manifest- If the remote manifest doesn't have newer version, skips the update flow
- We subscribe for
download
events - We subscribe for
install
events
- We subscribe for
download( rManifest )
downloads the latest available release matching the host platform (according to thepackages
map of the remote manifest)unpack( updateFile )
unpacks the release archive (zip
ortar.gz
) in a temporary directoryrestartToSwap()
closes the app and launches the downloaded releaseisSwapRequest()
- checks if we need to go the swap flow (while running in tmp and therefore having the initial app directory unlocked for writing)swap()
- backs up actual version and replaces it with the new onerestart()
- restarts the updated app from its original location
npm start
npm run package
npm version patch