2025-07-17 15:33:23 +00:00
|
|
|
# Fleet uninstalls app by finding all related product codes for the specified upgrade code
|
|
|
|
|
$inst = New-Object -ComObject "WindowsInstaller.Installer"
|
|
|
|
|
foreach ($product_code in $inst.RelatedProducts("$UPGRADE_CODE")) {
|
2025-07-23 14:27:59 +00:00
|
|
|
$process = Start-Process msiexec -ArgumentList @("/quiet", "/x", $product_code, "/norestart") -Wait -PassThru
|
|
|
|
|
|
|
|
|
|
# If the uninstall failed, bail
|
|
|
|
|
if ($process.ExitCode -ne 0) {
|
|
|
|
|
Write-Output "Uninstall for $($product_code) exited $($process.ExitCode)"
|
|
|
|
|
Exit $process.ExitCode
|
|
|
|
|
}
|
2025-07-17 15:33:23 +00:00
|
|
|
}
|
|
|
|
|
|
2025-07-23 14:27:59 +00:00
|
|
|
# All uninstalls succeeded; exit success
|
|
|
|
|
Exit 0
|