Skip to content

Commit

Permalink
fix(rpm-updater): stop uninstalling app before update (#8311)
Browse files Browse the repository at this point in the history
Stop uninstalling an app before it updates, as dnf, yum, and zypper all 
support updating an app from a .rpm, and because app.getName() returns 
the product name of the app instead of its package name. (Fixes #8305)
  • Loading branch information
rastiqdev authored Jul 10, 2024
1 parent dd145d6 commit 35a0784
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/real-ducks-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"electron-updater": patch
---

fix(rpm-updater): stop uninstalling app before update
11 changes: 1 addition & 10 deletions packages/electron-updater/src/RpmUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,9 @@ export class RpmUpdater extends BaseUpdater {
let cmd: string[]
if (!packageManager) {
const packageManager = this.spawnSyncLog("which dnf || which yum")
cmd = [packageManager, "-y", "remove", `'${this.app.name}'`, ";", packageManager, "-y", "install", upgradePath]
cmd = [packageManager, "-y", "install", upgradePath]
} else {
cmd = [

Check warning on line 41 in packages/electron-updater/src/RpmUpdater.ts

View workflow job for this annotation

GitHub Actions / test-linux (ArtifactPublisherTest,BuildTest,ExtraBuildTest,RepoSlugTest,binDownloadTest,configura...

Replace `⏎········packageManager,⏎········"--no-refresh",⏎········"install",⏎········"--allow-unsigned-rpm",⏎········"-y",⏎········"-f",⏎········upgradePath,⏎······` with `packageManager,·"--no-refresh",·"install",·"--allow-unsigned-rpm",·"-y",·"-f",·upgradePath`

Check warning on line 41 in packages/electron-updater/src/RpmUpdater.ts

View workflow job for this annotation

GitHub Actions / test-linux (snapTest,debTest,fpmTest,protonTest)

Replace `⏎········packageManager,⏎········"--no-refresh",⏎········"install",⏎········"--allow-unsigned-rpm",⏎········"-y",⏎········"-f",⏎········upgradePath,⏎······` with `packageManager,·"--no-refresh",·"install",·"--allow-unsigned-rpm",·"-y",·"-f",·upgradePath`
packageManager,
"remove",
"-y",
`'${this.app.name}'`,
";",
packageManager,
"clean",
"--all",
";",
packageManager,
"--no-refresh",
"install",
Expand Down

0 comments on commit 35a0784

Please sign in to comment.