jonasmusall/texpaste

Enable update checks for target formats not supported by electron-updater

Closed this issue · 3 comments

Proposed Enhancement

Only AppImage (Linux) and NSIS (Windows) targets are auto-updatable with electron-updater (https://www.electron.build/auto-update). On other targets, at least a check for available updates and a subsequent message to the user that they can download and install a new version should be possible.

If this is implemented, on non-auto-updatable targets the option "Install updates automatically" (in the settings) should be visible, but disabled, maybe with a hint why automatic installation is not possible.

ToDo: Check what electron-updater does when the app is running on an unsupported target. Is the update-available event still emitted? If yes, what happens when calling downloadUpdate, what happens on app quit if autoInstallOnAppQuit == true?

ToDo: Check what electron-updater does when the app is running on an unsupported target. Is the update-available event still emitted? If yes, what happens when calling downloadUpdate, what happens on app quit if autoInstallOnAppQuit == true?

It seems like the updater already fails at autoUpdater.checkForUpdates() with error ENOENT: no such file or directory, open '[...]/resources/app-update.yml' whenever called from an unsupported target.

How to proceed: Implement alternative update check (use internal electron-updater logic?) and run that if default check fails. Note: default check ENOENT error has a code property which may be used to distinguish this case from network errors.

autoUpdater.checkForUpdates() does not fail on unsupported targets if they were built together with supported targets (e.g. with build config "win": { "target": ["nsis", "zip"] }). This may mean all targets need to be built seperately.