fleet/ee/maintained-apps/inputs/winget/scripts/claude_install.ps1
Allen Houchins d2c485a5f7
Switch Claude installer to MSIX and update scripts (#43337)
Change Claude package from EXE to MSIX: update input metadata, replace
the installer script to provision the MSIX machine-wide and attempt
per-user registration, and rewrite the uninstaller to remove provisioned
and installed Appx packages (with best-effort package matching, timeout
handling, and safer error reporting). Update Windows output metadata:
bump version, update installer URL and sha256, and refresh
install/uninstall script refs to the new MSIX-based implementations.
2026-04-09 11:58:49 -05:00

29 lines
969 B
PowerShell

# MSIX: provision machine-wide, then register for the current user when possible so inventory
# (osquery programs) and FMA validation are more likely to see the app immediately.
try {
$msixPath = $env:INSTALLER_PATH
if (-not $msixPath) {
throw "INSTALLER_PATH is not set"
}
Write-Host "Provisioning MSIX for all users..."
$result = Add-AppxProvisionedPackage -Online -PackagePath $msixPath -SkipLicense -Regions "all" -ErrorAction Stop
$result | Out-String | Write-Host
# Per-user registration helps ARP/programs visibility on hosts where validation runs with a user session.
try {
Write-Host "Registering MSIX for current user (best-effort)..."
Add-AppxPackage -Path $msixPath -ErrorAction Stop | Out-String | Write-Host
} catch {
Write-Host "Add-AppxPackage skipped or failed (provisioned install may still be valid): $($_.Exception.Message)"
}
Start-Sleep -Seconds 5
Exit 0
} catch {
Write-Host "Error: $_"
Exit 1
}