mirror of
https://github.com/fleetdm/fleet
synced 2026-05-06 06:48:54 +00:00
Closes #31077. - Added logic to wait for the uninstall command to finish running before exiting the script. - Also added the `/norestart` flag so users who click uninstall in self-service aren't at risk of a sudden and unintentional reboot as the result of software uninstalling. # Checklist for submitter If some of the following don't apply, delete the relevant line. <!-- Note that API documentation changes are now addressed by the product design team. --> - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files) for more information. --------- Co-authored-by: Ian Littman <iansltx@gmail.com>
13 lines
396 B
PowerShell
13 lines
396 B
PowerShell
$product_code = $PACKAGE_ID
|
|
|
|
# Fleet uninstalls app using product code that's extracted on upload
|
|
$process = Start-Process msiexec -ArgumentList @("/quiet", "/x", $product_code, "/norestart") -Wait -PassThru
|
|
|
|
# Check exit code and output result
|
|
if ($process.ExitCode -eq 0) {
|
|
Write-Output "Exit 0"
|
|
Exit 0
|
|
} else {
|
|
Write-Output "Exit $($process.ExitCode)"
|
|
Exit $process.ExitCode
|
|
}
|