Add SQL Server Management Studio as a Windows FMA - #47003
Conversation
Add a new winget maintained-app entry for SQL Server Management Studio (SSMS) 22. Includes input JSON (Microsoft.SQLServerManagementStudio.22) and two PowerShell scripts: an installer wrapper that runs the Visual Studio bootstrapper (vs_SSMS.exe) with --quiet --norestart --wait, and an uninstaller that looks up the ARP entry for SSMS 22.x and invokes the Visual Studio Installer uninstall verb with silent switches. Also update outputs: add the app to apps.json and add version metadata (installer URL, sha256, and embedded script refs) in outputs/sql-server-management-studio/windows.json.
Raise the Windows script execution timeout from 5 to 10 minutes and add an explanatory comment. Some installers (e.g. Visual Studio bootstrappers) download large payloads at install time and can legitimately take longer than a few minutes; production allows up to 1 hour, so a 10-minute validator cap covers large-payload installers while avoiding hung scripts.
Use the explicit DisplayName "SQL Server Management Studio 22" across inputs and outputs and update osquery exists/patched queries to match that name. Simplify the uninstall PowerShell by removing the publisher/version checks and only matching the verified DisplayName (found via osquery), and update the uninstall script ref in the Windows output. These changes align detection and uninstallation with how SSMS 22 registers on real hosts.
Script Diff Resultsee/maintained-apps/outputs/sql-server-management-studio/windows.json=== Install Script (no changes) ===
=== Uninstall // 8efc7095 -> 13740770 ===
--- /tmp/old.NiWlYG 2026-06-06 14:49:08.239674338 +0000
+++ /tmp/new.u78gMv 2026-06-06 14:49:08.239674338 +0000
@@ -1,11 +1,9 @@
# SSMS 22 is owned by the Visual Studio Installer. Its ARP entry registers under
-# DisplayName "SQL Server Management Studio" with DisplayVersion "22.x". The
-# UninstallString points at the VS Installer's setup.exe with an "uninstall
-# --installPath ..." command; we look it up from the registry rather than
-# hard-coding the install path, then ensure the silent switches are present.
-$displayName = "SQL Server Management Studio"
-$publisher = "Microsoft Corporation"
-$versionPrefix = "22."
+# DisplayName "SQL Server Management Studio 22" (verified via osquery on a real
+# host). The UninstallString points at the VS Installer's setup.exe with an
+# "uninstall --installPath ..." command; we look it up from the registry rather
+# than hard-coding the install path, then ensure the silent switches are present.
+$displayName = "SQL Server Management Studio 22"
$paths = @(
'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall',
@@ -17,9 +15,7 @@
$uninstall = $null
foreach ($p in $paths) {
$items = Get-ItemProperty "$p\*" -ErrorAction SilentlyContinue | Where-Object {
- $_.DisplayName -eq $displayName -and `
- $_.Publisher -like "$publisher*" -and `
- $_.DisplayVersion -like "$versionPrefix*"
+ $_.DisplayName -eq $displayName
}
if ($items) { $uninstall = $items | Select-Object -First 1; break }
} |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #47003 +/- ##
==========================================
- Coverage 67.04% 67.03% -0.01%
==========================================
Files 2869 2869
Lines 225121 225121
Branches 11600 11600
==========================================
- Hits 150926 150919 -7
- Misses 60525 60529 +4
- Partials 13670 13673 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
|
@cdcme minor change. Increasing the timeout from 5 minutes to 10 minutes for larger packages to be able to validate. Production is configured at 1 hour which is too much for our testing since we want to catch any issues quickly. |
There was a problem hiding this comment.
Pull request overview
This PR adds SQL Server Management Studio (SSMS) 22 as a Fleet-maintained app (FMA) for Windows via winget, including install/uninstall PowerShell scripts and generated output manifests. It also adjusts the Windows maintained-app validator to allow longer-running installer scripts typical of Visual Studio-style bootstrappers.
Changes:
- Add a new winget input manifest and accompanying install/uninstall PowerShell scripts for SSMS 22.
- Generate and commit the maintained-app output manifest for SSMS 22 and register the app in the global
apps.jsonlist. - Increase the Windows validator script execution timeout from 5 minutes to 10 minutes to accommodate large-payload installers.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ee/maintained-apps/outputs/sql-server-management-studio/windows.json | New generated Windows output manifest for SSMS 22, including queries, installer metadata, and embedded script refs. |
| ee/maintained-apps/outputs/apps.json | Registers “SQL Server Management Studio” in the maintained apps catalog. |
| ee/maintained-apps/inputs/winget/sql-server-management-studio.json | New winget input definition mapping SSMS 22 to scripts and identifiers. |
| ee/maintained-apps/inputs/winget/scripts/sql_server_management_studio_uninstall.ps1 | Uninstaller that discovers SSMS 22 via ARP and invokes the VS Installer uninstall flow silently. |
| ee/maintained-apps/inputs/winget/scripts/sql_server_management_studio_install.ps1 | Installer wrapper invoking vs_SSMS.exe with quiet/no-restart/wait. |
| cmd/maintained-apps/validate/windows.go | Extends validator PowerShell execution timeout to 10 minutes for long-running installers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
WalkthroughThis PR extends the maintained apps system to support SQL Server Management Studio 22 on Windows. The timeout for PowerShell script execution increases from 5 to 10 minutes to accommodate large bootstrapper payloads. Two new PowerShell scripts implement install and uninstall operations: the install script runs a Visual Studio bootstrapper with quiet flags; the uninstall script queries the Windows registry for the SSMS 22 uninstall entry, normalizes the uninstall command with silent flags, and executes it. A new Winget input manifest wires the scripts and detection query together, and output manifests declare the app to the maintained apps registry with versioning metadata and script references. Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
ee/maintained-apps/inputs/winget/scripts/sql_server_management_studio_uninstall.ps1 (1)
36-47: ⚡ Quick winConsider defensive check for executable path parsing.
The three sequential regex patterns provide broad fallback coverage, but pattern 3 (
'^\s*(\S+)\s*(.*)$') will match any non-whitespace token as the executable path. If$uninstallCommandcontains unexpected formatting or special characters, this could capture something invalid (e.g.,&,|, or a malformed path).While the try/catch block on lines 57-74 will catch exceptions from
Start-Processif the path is invalid, adding an explicit check that$exePathends with.exeand/or exists after parsing would make the error handling more robust and provide clearer diagnostics.🛡️ Proposed validation after parsing
} else { Throw "Could not parse uninstall string: $uninstallCommand" } + +if (-not $exePath.EndsWith('.exe', [StringComparison]::OrdinalIgnoreCase)) { + Throw "Parsed executable path does not end with .exe: $exePath" +}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@ee/maintained-apps/inputs/winget/scripts/sql_server_management_studio_uninstall.ps1` around lines 36 - 47, After the regex parsing block for $uninstallCommand (the branches that set $exePath and $existingArgs), add a defensive validation that ensures $exePath is a sensible executable: verify it ends with “.exe” (case-insensitive) and/or that the resolved path exists (use Test-Path or Resolve-Path) and is a file; if the check fails, Throw a clear error including the original $uninstallCommand and the parsed $exePath so downstream Start-Process errors are avoided and diagnostics are clearer.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@ee/maintained-apps/inputs/winget/scripts/sql_server_management_studio_uninstall.ps1`:
- Around line 36-47: After the regex parsing block for $uninstallCommand (the
branches that set $exePath and $existingArgs), add a defensive validation that
ensures $exePath is a sensible executable: verify it ends with “.exe”
(case-insensitive) and/or that the resolved path exists (use Test-Path or
Resolve-Path) and is a file; if the check fails, Throw a clear error including
the original $uninstallCommand and the parsed $exePath so downstream
Start-Process errors are avoided and diagnostics are clearer.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 927d4cbb-0c7c-4133-af39-db14ea39f950
📒 Files selected for processing (6)
cmd/maintained-apps/validate/windows.goee/maintained-apps/inputs/winget/scripts/sql_server_management_studio_install.ps1ee/maintained-apps/inputs/winget/scripts/sql_server_management_studio_uninstall.ps1ee/maintained-apps/inputs/winget/sql-server-management-studio.jsonee/maintained-apps/outputs/apps.jsonee/maintained-apps/outputs/sql-server-management-studio/windows.json
Add a new winget maintained-app entry for SQL Server Management Studio (SSMS) 22. Includes input JSON (Microsoft.SQLServerManagementStudio.22) and two PowerShell scripts: an installer wrapper that runs the Visual Studio bootstrapper (vs_SSMS.exe) with --quiet --norestart --wait, and an uninstaller that looks up the ARP entry for SSMS 22.x and invokes the Visual Studio Installer uninstall verb with silent switches. Also update outputs: add the app to apps.json and add version metadata (installer URL, sha256, and embedded script refs) in outputs/sql-server-management-studio/windows.json.
Summary by CodeRabbit
New Features
Improvements