Launch the verified NSIS installer directly before application shutdown, wait for Windows to confirm process creation, and keep the application open on spawn failure. Move process waiting into NSIS with a bounded graceful and post-force termination check, and cover the handoff with updater regression tests.
14 lines
733 B
TypeScript
14 lines
733 B
TypeScript
import fs from "node:fs";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
describe("update process handoff", () => {
|
|
it("starts the verified installer before shutdown and delegates waiting to NSIS", () => {
|
|
const updateSource = fs.readFileSync(new URL("../src/main/update.ts", import.meta.url), "utf8");
|
|
const launchBlock = updateSource.slice(updateSource.indexOf('message: "Starte stille Update-Installation"'), updateSource.indexOf('message: "Update wird im Hintergrund installiert'));
|
|
|
|
expect(launchBlock).toContain("childProcess.spawn(targetPath, buildInstallerLaunchArgs()");
|
|
expect(launchBlock).not.toContain("powershell.exe");
|
|
expect(launchBlock).not.toContain("buildDeferredInstallerLaunch");
|
|
});
|
|
});
|