mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 20:20:49 +00:00
Fix uninstall
This commit is contained in:
parent
4a7629a174
commit
20fb949a23
1 changed files with 4 additions and 4 deletions
|
|
@ -79,14 +79,14 @@ function getWindowsArchitecture() {
|
|||
}
|
||||
|
||||
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`);
|
||||
|
||||
let productCode;
|
||||
try {
|
||||
productCode = execSync(`powershell -Command "${powershellScript}"`, {
|
||||
encoding: "utf8",
|
||||
}).trim();
|
||||
productCode = execSync(
|
||||
`powershell -Command "$app = Get-WmiObject -Class Win32_Product -Filter \\"Name='SafeChain Agent'\\"; if ($app) { Write-Output $app.IdentifyingNumber }"`,
|
||||
{ encoding: "utf8" },
|
||||
).trim();
|
||||
} catch {
|
||||
ui.writeVerbose("No existing installation found (fresh install).");
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue