diff --git a/electron/main/backend/install-manager.ts b/electron/main/backend/install-manager.ts index 21a11037..d2dad6e3 100644 --- a/electron/main/backend/install-manager.ts +++ b/electron/main/backend/install-manager.ts @@ -148,8 +148,7 @@ ipcMain.on("queue-install", async (event, download_json) => { typeof download_json === "string" ? JSON.parse(download_json) : download_json; - const { id, pkgname, metalinkUrl, filename, upgradeOnly, origin } = - download || {}; + const { id, pkgname, metalinkUrl, filename, origin } = download || {}; if (!id || !pkgname) { logger.warn("passed arguments missing id or pkgname"); @@ -249,26 +248,24 @@ ipcMain.on("queue-install", async (event, download_json) => { } if (origin === "spark") { - // Spark Store logic - if (upgradeOnly) { - execCommand = superUserCmd || SHELL_CALLER_PATH; - if (superUserCmd) execParams.push(SHELL_CALLER_PATH); - execParams.push("aptss", "install", "-y", pkgname, "--only-upgrade"); - } else { - execCommand = superUserCmd || SHELL_CALLER_PATH; - if (superUserCmd) execParams.push(SHELL_CALLER_PATH); + execCommand = superUserCmd || SHELL_CALLER_PATH; + if (superUserCmd) execParams.push(SHELL_CALLER_PATH); - if (metalinkUrl && filename) { - execParams.push( - "ssinstall", - `${downloadDir}/${filename}`, - "--delete-after-install", - "--no-create-desktop-entry", - "--native", - ); - } else { - execParams.push("aptss", "install", "-y", pkgname); - } + if (metalinkUrl && filename) { + execParams.push( + "ssinstall", + `${downloadDir}/${filename}`, + "--delete-after-install", + "--no-create-desktop-entry", + "--native", + ); + } else { + execParams.push( + "ssinstall", + pkgname, + "--no-create-desktop-entry", + "--native", + ); } } else { // APM Store logic diff --git a/src/__tests__/unit/update-center/task-runner.test.ts b/src/__tests__/unit/update-center/task-runner.test.ts index eaf5831c..daaa783d 100644 --- a/src/__tests__/unit/update-center/task-runner.test.ts +++ b/src/__tests__/unit/update-center/task-runner.test.ts @@ -3,7 +3,6 @@ import { describe, expect, it, vi } from "vitest"; import type { UpdateCenterItem } from "../../../../electron/main/backend/update-center/types"; import { createTaskRunner, - buildLegacySparkUpgradeCommand, installUpdateItem, } from "../../../../electron/main/backend/update-center/install"; import { createUpdateCenterQueue } from "../../../../electron/main/backend/update-center/queue"; @@ -114,22 +113,6 @@ describe("update-center task runner", () => { }); }); - it("returns a direct aptss upgrade command instead of spark-update-tool", () => { - expect( - buildLegacySparkUpgradeCommand("spark-weather", "/usr/bin/pkexec"), - ).toEqual({ - execCommand: "/usr/bin/pkexec", - execParams: [ - "/opt/spark-store/extras/shell-caller.sh", - "aptss", - "install", - "-y", - "spark-weather", - "--only-upgrade", - ], - }); - }); - it("blocks close while a refresh or task is still running", () => { const queue = createUpdateCenterQueue(); const item = createAptssItem(); @@ -208,7 +191,7 @@ describe("update-center task runner", () => { { id: task.id, status: "failed", - error: "APM update task requires downloaded package metadata", + error: "Update task for spark-player requires download metadata (URL and filename)", }, ], }); @@ -300,4 +283,28 @@ describe("update-center task runner", () => { }, ]); }); + + it("uses ssinstall for aptss (spark) file installs", async () => { + childProcessMock.spawnCalls.length = 0; + + await installUpdateItem({ + item: createAptssItem(), + filePath: "/tmp/spark-weather.deb", + superUserCmd: "/usr/bin/pkexec", + }); + + expect(childProcessMock.spawnCalls).toEqual([ + { + command: "/usr/bin/pkexec", + args: [ + "/opt/spark-store/extras/shell-caller.sh", + "ssinstall", + "/tmp/spark-weather.deb", + "--delete-after-install", + "--no-create-desktop-entry", + "--native", + ], + }, + ]); + }); }); diff --git a/src/components/DownloadDetail.vue b/src/components/DownloadDetail.vue index db27ab70..f449d995 100644 --- a/src/components/DownloadDetail.vue +++ b/src/components/DownloadDetail.vue @@ -13,7 +13,7 @@ @click="handleOverlayClick" >