-
-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* start some autoupdater adjustments * WIP: feat: use electron-updater for checking updates * chore: move t function to helpers * fix: improve presentation of update message boxes * chore: remove old updater code * chore: remove more old updater code * docs: fix references to updater * chore: add comment to clarify download behavior
- Loading branch information
Showing
19 changed files
with
71 additions
and
272 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import {dialog} from 'electron'; | ||
import {autoUpdater} from 'electron-updater'; | ||
|
||
import {t} from './helpers'; | ||
|
||
const RELEASES_LINK = 'https://github.com/appium/appium-inspector/releases'; | ||
|
||
autoUpdater.autoDownload = false; | ||
autoUpdater.autoInstallOnAppQuit = false; | ||
|
||
autoUpdater.on('error', (error) => { | ||
dialog.showErrorBox(t('Could not download update'), t('updateDownloadFailed', {message: error})); | ||
}); | ||
|
||
autoUpdater.on('update-not-available', () => { | ||
dialog.showMessageBox({ | ||
type: 'info', | ||
buttons: [t('OK')], | ||
message: t('No update available'), | ||
detail: t('Appium Inspector is up-to-date'), | ||
}); | ||
}); | ||
|
||
autoUpdater.on('update-available', async ({version, releaseDate}) => { | ||
const pubDate = new Date(releaseDate).toDateString(); | ||
const {response} = await dialog.showMessageBox({ | ||
type: 'info', | ||
message: t('appiumIsAvailable', {name: version}), | ||
buttons: [t('Install Now'), t('Install Later')], | ||
detail: t('updateDetails', {pubDate, notes: RELEASES_LINK}), | ||
}); | ||
if (response === 0) { | ||
// download is started without waiting for the dialog box to be dismissed | ||
dialog.showMessageBox({ | ||
type: 'info', | ||
buttons: [t('OK')], | ||
message: t('updateIsBeingDownloaded'), | ||
}); | ||
autoUpdater.downloadUpdate(); | ||
} | ||
}); | ||
|
||
autoUpdater.on('update-downloaded', async ({releaseName}) => { | ||
const {response} = await dialog.showMessageBox({ | ||
type: 'info', | ||
buttons: [t('Restart Now'), t('Later')], | ||
message: t('Update Downloaded'), | ||
detail: t('updateIsDownloaded', {releaseName}), | ||
}); | ||
if (response === 0) { | ||
autoUpdater.quitAndInstall(); | ||
} | ||
}); | ||
|
||
export function checkForUpdates() { | ||
autoUpdater.checkForUpdates(); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import * as inspectorActions from './Inspector'; | ||
import * as sessionActions from './Session'; | ||
import * as updaterActions from './Updater'; | ||
|
||
export default { | ||
...inspectorActions, | ||
...sessionActions, | ||
...updaterActions, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.