Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/blue-spiders-go.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"electron-updater": minor
---

feat: adding external method that allows clearing the update cache
7 changes: 6 additions & 1 deletion packages/electron-updater/src/AppUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ export abstract class AppUpdater extends (EventEmitter as new () => TypedEmitter
return checkForUpdatesPromise
}

public isUpdaterActive(): boolean {
isUpdaterActive(): boolean {
const isEnabled = this.app.isPackaged || this.forceDevUpdateConfig
if (!isEnabled) {
this._logger.info("Skip checkForUpdates because application is not packed and dev update config is not forced")
Expand All @@ -364,6 +364,11 @@ export abstract class AppUpdater extends (EventEmitter as new () => TypedEmitter
return true
}

async clearDownloadCache(): Promise<void> {
const it = await this.getOrCreateDownloadHelper()
return await it.clear()
}

// noinspection JSUnusedGlobalSymbols
checkForUpdatesAndNotify(downloadNotification?: DownloadNotification): Promise<UpdateCheckResult | null> {
return this.checkForUpdates().then(it => {
Expand Down
Loading