Skip to content
5 changes: 5 additions & 0 deletions .changeset/afraid-buckets-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"electron-updater": patch
---

feat(updater): clear cached installers after update check
6 changes: 6 additions & 0 deletions packages/electron-updater/src/AppUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,12 @@ export abstract class AppUpdater extends (EventEmitter as new () => TypedEmitter
}).`
)
this.emit("update-not-available", updateInfo)

// remove all installers from cache
const downloadedUpdateHelper = await this.getOrCreateDownloadHelper()
await downloadedUpdateHelper.clear()
this._logger.info(`All installers have been removed from cache: ${downloadedUpdateHelper.cacheDirForPendingUpdate}`)

return {
isUpdateAvailable: false,
versionInfo: updateInfo,
Expand Down
Loading