Fix uninstall

This commit is contained in:
Sander Declerck 2026-01-19 16:17:34 +01:00
parent 4a7629a174
commit 20fb949a23
No known key found for this signature in database

View file

@ -79,14 +79,14 @@ function getWindowsArchitecture() {
} }
async function uninstallIfInstalled() { async function uninstallIfInstalled() {
const powershellScript = `$app = Get-WmiObject -Class Win32_Product -Filter "Name='SafeChain Agent'"; if ($app) { Write-Output $app.IdentifyingNumber }`;
ui.writeVerbose(`Finding product code with PowerShell`); ui.writeVerbose(`Finding product code with PowerShell`);
let productCode; let productCode;
try { try {
productCode = execSync(`powershell -Command "${powershellScript}"`, { productCode = execSync(
encoding: "utf8", `powershell -Command "$app = Get-WmiObject -Class Win32_Product -Filter \\"Name='SafeChain Agent'\\"; if ($app) { Write-Output $app.IdentifyingNumber }"`,
}).trim(); { encoding: "utf8" },
).trim();
} catch { } catch {
ui.writeVerbose("No existing installation found (fresh install)."); ui.writeVerbose("No existing installation found (fresh install).");
return; return;