Files
Harrison RavazzoloandAllen Houchins a93ea6974d Windows FMA - Windsurf (#46401)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added Windows support for Windsurf as a managed app (version 2.3.15)
with packaged manifest and installer metadata.
  * Added automated silent install and uninstall flows for Windows.

* **Bug Fixes**
* Improved post-install/uninstall process handling to avoid file-locks.
* Enhanced uninstall detection and exit-code handling to better report
success/failure.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/fleetdm/fleet/pull/46401?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Allen Houchins <allenhouchins@mac.com>
2026-05-28 22:22:18 -05:00

45 lines
1.6 KiB
PowerShell

# install switches:
# /VERYSILENT = no UI at all
# /SUPPRESSMSGBOXES = suppress every message box
# /NORESTART = don't reboot (returns 3010 instead, treat as success)
# /ALLUSERS = machine-scope install. Requires elevation; the
# installer self-elevates (manifest:
# ElevationRequirement: elevatesSelf), and Fleet/
# SYSTEM already runs elevated anyway.
# /MERGETASKS=!runcode = keep default selectable tasks but deselect
# "runcode" (which auto-launches Windsurf after
# install). Inno's "!" prefix means "deselect".
$exeFilePath = "${env:INSTALLER_PATH}"
# 0 = success; 3010 = success but reboot required.
$ExpectedExitCodes = @(0, 3010)
try {
$processOptions = @{
FilePath = "$exeFilePath"
ArgumentList = "/VERYSILENT", "/SUPPRESSMSGBOXES", "/NORESTART",
"/ALLUSERS", "/MERGETASKS=!runcode"
PassThru = $true
Wait = $true
}
$process = Start-Process @processOptions
$exitCode = $process.ExitCode
Write-Host "Install exit code: $exitCode"
# Defensive: even with !runcode, Inno installers occasionally launch the
# app via post-install scripts. Stop Windsurf if it slipped through so
# files aren't locked for later detection/uninstall.
Start-Sleep -Seconds 5
Stop-Process -Name "Windsurf" -Force -ErrorAction SilentlyContinue
if ($ExpectedExitCodes -contains $exitCode) { Exit 0 }
Exit $exitCode
} catch {
Write-Host "Error: $_"
Exit 1
}