diff --git a/ee/maintained-apps/inputs/winget/scripts/visual_studio_2022_community_uninstall.ps1 b/ee/maintained-apps/inputs/winget/scripts/visual_studio_2022_community_uninstall.ps1 new file mode 100644 index 0000000000..048846f824 --- /dev/null +++ b/ee/maintained-apps/inputs/winget/scripts/visual_studio_2022_community_uninstall.ps1 @@ -0,0 +1,62 @@ +# Visual Studio has no UninstallString; it's removed through the shared Visual +# Studio Installer, which needs the specific instance's install path. -version +# is required as well as -products, since product IDs are not version specific +# and an unscoped query also matches a side-by-side Visual Studio 2026. + +$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" +$vsInstaller = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\setup.exe" + +try { + +if (-not (Test-Path $vswhere) -or -not (Test-Path $vsInstaller)) { + Write-Host "Visual Studio Installer not present, nothing to uninstall" + Exit 0 +} + +$installPath = & $vswhere -products Microsoft.VisualStudio.Product.Community -version "[17.0,18.0)" -property installationPath + +# vswhere reports failure through the exit code rather than by throwing, so +# without this check a failed query looks like "no instance installed". +if ($LASTEXITCODE -ne 0) { + Write-Host "vswhere.exe failed with exit code $LASTEXITCODE" + Exit 1 +} + +$installPath = ($installPath | Select-Object -First 1) + +if (-not $installPath) { + Write-Host "No Visual Studio Community 2022 instance found, nothing to uninstall" + Exit 0 +} + +Write-Host "Found Visual Studio Community 2022 at: $installPath" + +# The install path always contains spaces, so it has to be quoted here. No +# --wait: it's bootstrapper-only, and Start-Process -Wait already blocks. +$processOptions = @{ + FilePath = $vsInstaller + ArgumentList = "uninstall --installPath `"$installPath`" --quiet --norestart" + PassThru = $true + Wait = $true +} + +$process = Start-Process @processOptions +$exitCode = $process.ExitCode + +if ($exitCode -eq 3010 -or $exitCode -eq 1641) { + Write-Host "Uninstall exit code: $exitCode (succeeded, reboot required to finish)" + Exit 0 +} + +if ($exitCode -eq 1001 -or $exitCode -eq 1618) { + Write-Host "Uninstall failed: another Visual Studio Installer operation is already in progress (exit code $exitCode)" + Exit 1 +} + +Write-Host "Uninstall exit code: $exitCode" +Exit $exitCode + +} catch { + Write-Host "Error: $_" + Exit 1 +} diff --git a/ee/maintained-apps/inputs/winget/scripts/visual_studio_2022_enterprise_uninstall.ps1 b/ee/maintained-apps/inputs/winget/scripts/visual_studio_2022_enterprise_uninstall.ps1 new file mode 100644 index 0000000000..0c10493793 --- /dev/null +++ b/ee/maintained-apps/inputs/winget/scripts/visual_studio_2022_enterprise_uninstall.ps1 @@ -0,0 +1,62 @@ +# Visual Studio has no UninstallString; it's removed through the shared Visual +# Studio Installer, which needs the specific instance's install path. -version +# is required as well as -products, since product IDs are not version specific +# and an unscoped query also matches a side-by-side Visual Studio 2026. + +$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" +$vsInstaller = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\setup.exe" + +try { + +if (-not (Test-Path $vswhere) -or -not (Test-Path $vsInstaller)) { + Write-Host "Visual Studio Installer not present, nothing to uninstall" + Exit 0 +} + +$installPath = & $vswhere -products Microsoft.VisualStudio.Product.Enterprise -version "[17.0,18.0)" -property installationPath + +# vswhere reports failure through the exit code rather than by throwing, so +# without this check a failed query looks like "no instance installed". +if ($LASTEXITCODE -ne 0) { + Write-Host "vswhere.exe failed with exit code $LASTEXITCODE" + Exit 1 +} + +$installPath = ($installPath | Select-Object -First 1) + +if (-not $installPath) { + Write-Host "No Visual Studio Enterprise 2022 instance found, nothing to uninstall" + Exit 0 +} + +Write-Host "Found Visual Studio Enterprise 2022 at: $installPath" + +# The install path always contains spaces, so it has to be quoted here. No +# --wait: it's bootstrapper-only, and Start-Process -Wait already blocks. +$processOptions = @{ + FilePath = $vsInstaller + ArgumentList = "uninstall --installPath `"$installPath`" --quiet --norestart" + PassThru = $true + Wait = $true +} + +$process = Start-Process @processOptions +$exitCode = $process.ExitCode + +if ($exitCode -eq 3010 -or $exitCode -eq 1641) { + Write-Host "Uninstall exit code: $exitCode (succeeded, reboot required to finish)" + Exit 0 +} + +if ($exitCode -eq 1001 -or $exitCode -eq 1618) { + Write-Host "Uninstall failed: another Visual Studio Installer operation is already in progress (exit code $exitCode)" + Exit 1 +} + +Write-Host "Uninstall exit code: $exitCode" +Exit $exitCode + +} catch { + Write-Host "Error: $_" + Exit 1 +} diff --git a/ee/maintained-apps/inputs/winget/scripts/visual_studio_2022_install.ps1 b/ee/maintained-apps/inputs/winget/scripts/visual_studio_2022_install.ps1 new file mode 100644 index 0000000000..1038a38ceb --- /dev/null +++ b/ee/maintained-apps/inputs/winget/scripts/visual_studio_2022_install.ps1 @@ -0,0 +1,43 @@ +# Learn more about .exe install scripts: +# http://fleetdm.com/learn-more-about/exe-install-scripts +# +# The downloaded file is a bootstrapper that pulls the multi-GB payload during +# this step. --wait is required: without it the bootstrapper forks the real +# install to a background process and returns before it finishes. + +$exeFilePath = "${env:INSTALLER_PATH}" + +try { + +if (-not (Test-Path $exeFilePath)) { + Write-Host "Error: Installer file not found at: $exeFilePath" + Exit 1 +} + +$processOptions = @{ + FilePath = "$exeFilePath" + ArgumentList = "--quiet --wait --norestart" + PassThru = $true + Wait = $true +} + +$process = Start-Process @processOptions +$exitCode = $process.ExitCode + +if ($exitCode -eq 3010 -or $exitCode -eq 1641) { + Write-Host "Install exit code: $exitCode (succeeded, reboot required to finish)" + Exit 0 +} + +if ($exitCode -eq 1001 -or $exitCode -eq 1618) { + Write-Host "Install failed: another Visual Studio Installer operation is already in progress (exit code $exitCode)" + Exit 1 +} + +Write-Host "Install exit code: $exitCode" +Exit $exitCode + +} catch { + Write-Host "Error: $_" + Exit 1 +} diff --git a/ee/maintained-apps/inputs/winget/scripts/visual_studio_2022_professional_uninstall.ps1 b/ee/maintained-apps/inputs/winget/scripts/visual_studio_2022_professional_uninstall.ps1 new file mode 100644 index 0000000000..3820f5698b --- /dev/null +++ b/ee/maintained-apps/inputs/winget/scripts/visual_studio_2022_professional_uninstall.ps1 @@ -0,0 +1,62 @@ +# Visual Studio has no UninstallString; it's removed through the shared Visual +# Studio Installer, which needs the specific instance's install path. -version +# is required as well as -products, since product IDs are not version specific +# and an unscoped query also matches a side-by-side Visual Studio 2026. + +$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" +$vsInstaller = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\setup.exe" + +try { + +if (-not (Test-Path $vswhere) -or -not (Test-Path $vsInstaller)) { + Write-Host "Visual Studio Installer not present, nothing to uninstall" + Exit 0 +} + +$installPath = & $vswhere -products Microsoft.VisualStudio.Product.Professional -version "[17.0,18.0)" -property installationPath + +# vswhere reports failure through the exit code rather than by throwing, so +# without this check a failed query looks like "no instance installed". +if ($LASTEXITCODE -ne 0) { + Write-Host "vswhere.exe failed with exit code $LASTEXITCODE" + Exit 1 +} + +$installPath = ($installPath | Select-Object -First 1) + +if (-not $installPath) { + Write-Host "No Visual Studio Professional 2022 instance found, nothing to uninstall" + Exit 0 +} + +Write-Host "Found Visual Studio Professional 2022 at: $installPath" + +# The install path always contains spaces, so it has to be quoted here. No +# --wait: it's bootstrapper-only, and Start-Process -Wait already blocks. +$processOptions = @{ + FilePath = $vsInstaller + ArgumentList = "uninstall --installPath `"$installPath`" --quiet --norestart" + PassThru = $true + Wait = $true +} + +$process = Start-Process @processOptions +$exitCode = $process.ExitCode + +if ($exitCode -eq 3010 -or $exitCode -eq 1641) { + Write-Host "Uninstall exit code: $exitCode (succeeded, reboot required to finish)" + Exit 0 +} + +if ($exitCode -eq 1001 -or $exitCode -eq 1618) { + Write-Host "Uninstall failed: another Visual Studio Installer operation is already in progress (exit code $exitCode)" + Exit 1 +} + +Write-Host "Uninstall exit code: $exitCode" +Exit $exitCode + +} catch { + Write-Host "Error: $_" + Exit 1 +} diff --git a/ee/maintained-apps/inputs/winget/visual-studio-2022-community.json b/ee/maintained-apps/inputs/winget/visual-studio-2022-community.json new file mode 100644 index 0000000000..c466d33ea9 --- /dev/null +++ b/ee/maintained-apps/inputs/winget/visual-studio-2022-community.json @@ -0,0 +1,15 @@ +{ + "name": "Visual Studio Community 2022", + "slug": "visual-studio-2022-community/windows", + "package_identifier": "Microsoft.VisualStudio.2022.Community", + "unique_identifier": "Visual Studio Community 2022", + "exists_query": "SELECT 1 FROM programs WHERE (name = 'Visual Studio Community 2022' OR name LIKE 'Visual Studio Community 2022 (%') AND publisher = 'Microsoft Corporation';", + "install_script_path": "ee/maintained-apps/inputs/winget/scripts/visual_studio_2022_install.ps1", + "uninstall_script_path": "ee/maintained-apps/inputs/winget/scripts/visual_studio_2022_community_uninstall.ps1", + "installer_arch": "x64", + "installer_type": "exe", + "installer_scope": "machine", + "default_categories": [ + "Developer tools" + ] +} diff --git a/ee/maintained-apps/inputs/winget/visual-studio-2022-enterprise.json b/ee/maintained-apps/inputs/winget/visual-studio-2022-enterprise.json new file mode 100644 index 0000000000..90c877dfef --- /dev/null +++ b/ee/maintained-apps/inputs/winget/visual-studio-2022-enterprise.json @@ -0,0 +1,15 @@ +{ + "name": "Visual Studio Enterprise 2022", + "slug": "visual-studio-2022-enterprise/windows", + "package_identifier": "Microsoft.VisualStudio.2022.Enterprise", + "unique_identifier": "Visual Studio Enterprise 2022", + "exists_query": "SELECT 1 FROM programs WHERE (name = 'Visual Studio Enterprise 2022' OR name LIKE 'Visual Studio Enterprise 2022 (%') AND publisher = 'Microsoft Corporation';", + "install_script_path": "ee/maintained-apps/inputs/winget/scripts/visual_studio_2022_install.ps1", + "uninstall_script_path": "ee/maintained-apps/inputs/winget/scripts/visual_studio_2022_enterprise_uninstall.ps1", + "installer_arch": "x64", + "installer_type": "exe", + "installer_scope": "machine", + "default_categories": [ + "Developer tools" + ] +} diff --git a/ee/maintained-apps/inputs/winget/visual-studio-2022-professional.json b/ee/maintained-apps/inputs/winget/visual-studio-2022-professional.json new file mode 100644 index 0000000000..35fbc7093b --- /dev/null +++ b/ee/maintained-apps/inputs/winget/visual-studio-2022-professional.json @@ -0,0 +1,15 @@ +{ + "name": "Visual Studio Professional 2022", + "slug": "visual-studio-2022-professional/windows", + "package_identifier": "Microsoft.VisualStudio.2022.Professional", + "unique_identifier": "Visual Studio Professional 2022", + "exists_query": "SELECT 1 FROM programs WHERE (name = 'Visual Studio Professional 2022' OR name LIKE 'Visual Studio Professional 2022 (%') AND publisher = 'Microsoft Corporation';", + "install_script_path": "ee/maintained-apps/inputs/winget/scripts/visual_studio_2022_install.ps1", + "uninstall_script_path": "ee/maintained-apps/inputs/winget/scripts/visual_studio_2022_professional_uninstall.ps1", + "installer_arch": "x64", + "installer_type": "exe", + "installer_scope": "machine", + "default_categories": [ + "Developer tools" + ] +} diff --git a/ee/maintained-apps/outputs/apps.json b/ee/maintained-apps/outputs/apps.json index 74a8bac058..f16afc315a 100644 --- a/ee/maintained-apps/outputs/apps.json +++ b/ee/maintained-apps/outputs/apps.json @@ -9031,6 +9031,27 @@ "unique_identifier": "com.install4j.1106-5897-7327-6550.5", "description": "Visual Paradigm is an UML, SysML, BPMN modelling platform." }, + { + "name": "Visual Studio Community 2022", + "slug": "visual-studio-2022-community/windows", + "platform": "windows", + "unique_identifier": "Visual Studio Community 2022", + "description": "Visual Studio Community 2022 is a free, full-featured IDE from Microsoft for building apps across desktop, web, mobile, and cloud." + }, + { + "name": "Visual Studio Enterprise 2022", + "slug": "visual-studio-2022-enterprise/windows", + "platform": "windows", + "unique_identifier": "Visual Studio Enterprise 2022", + "description": "Visual Studio Enterprise 2022 is Microsoft's IDE for enterprise development teams, built for scale, security, and complex, high-impact projects." + }, + { + "name": "Visual Studio Professional 2022", + "slug": "visual-studio-2022-professional/windows", + "platform": "windows", + "unique_identifier": "Visual Studio Professional 2022", + "description": "Visual Studio Professional 2022 is Microsoft's IDE for professional developers working across desktop, web, mobile, and cloud." + }, { "name": "Microsoft Visual Studio Code", "slug": "visual-studio-code/darwin", diff --git a/ee/maintained-apps/outputs/visual-studio-2022-community/windows.json b/ee/maintained-apps/outputs/visual-studio-2022-community/windows.json new file mode 100644 index 0000000000..9aac926682 --- /dev/null +++ b/ee/maintained-apps/outputs/visual-studio-2022-community/windows.json @@ -0,0 +1,22 @@ +{ + "versions": [ + { + "version": "17.14.37", + "queries": { + "exists": "SELECT 1 FROM programs WHERE (name = 'Visual Studio Community 2022' OR name LIKE 'Visual Studio Community 2022 (%') AND publisher = 'Microsoft Corporation';", + "patched": "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM programs WHERE ((name = 'Visual Studio Community 2022' OR name LIKE 'Visual Studio Community 2022 (%') AND publisher = 'Microsoft Corporation') AND version_compare(version, '17.14.37') < 0);" + }, + "installer_url": "https://download.visualstudio.microsoft.com/download/pr/f7f5ecbc-83ca-4cf0-bdb2-aaf70efb6d97/065e93abcaf6a7ea97fa9a43561fc55bd57845d97b0cbf58c9be8cb72ddc1934/vs_Community.exe", + "install_script_ref": "1662986f", + "uninstall_script_ref": "e8264c65", + "sha256": "065e93abcaf6a7ea97fa9a43561fc55bd57845d97b0cbf58c9be8cb72ddc1934", + "default_categories": [ + "Developer tools" + ] + } + ], + "refs": { + "1662986f": "# Learn more about .exe install scripts:\n# http://fleetdm.com/learn-more-about/exe-install-scripts\n#\n# The downloaded file is a bootstrapper that pulls the multi-GB payload during\n# this step. --wait is required: without it the bootstrapper forks the real\n# install to a background process and returns before it finishes.\n\n$exeFilePath = \"${env:INSTALLER_PATH}\"\n\ntry {\n\nif (-not (Test-Path $exeFilePath)) {\n Write-Host \"Error: Installer file not found at: $exeFilePath\"\n Exit 1\n}\n\n$processOptions = @{\n FilePath = \"$exeFilePath\"\n ArgumentList = \"--quiet --wait --norestart\"\n PassThru = $true\n Wait = $true\n}\n\n$process = Start-Process @processOptions\n$exitCode = $process.ExitCode\n\nif ($exitCode -eq 3010 -or $exitCode -eq 1641) {\n Write-Host \"Install exit code: $exitCode (succeeded, reboot required to finish)\"\n Exit 0\n}\n\nif ($exitCode -eq 1001 -or $exitCode -eq 1618) {\n Write-Host \"Install failed: another Visual Studio Installer operation is already in progress (exit code $exitCode)\"\n Exit 1\n}\n\nWrite-Host \"Install exit code: $exitCode\"\nExit $exitCode\n\n} catch {\n Write-Host \"Error: $_\"\n Exit 1\n}\n", + "e8264c65": "# Visual Studio has no UninstallString; it's removed through the shared Visual\n# Studio Installer, which needs the specific instance's install path. -version\n# is required as well as -products, since product IDs are not version specific\n# and an unscoped query also matches a side-by-side Visual Studio 2026.\n\n$vswhere = \"${env:ProgramFiles(x86)}\\Microsoft Visual Studio\\Installer\\vswhere.exe\"\n$vsInstaller = \"${env:ProgramFiles(x86)}\\Microsoft Visual Studio\\Installer\\setup.exe\"\n\ntry {\n\nif (-not (Test-Path $vswhere) -or -not (Test-Path $vsInstaller)) {\n Write-Host \"Visual Studio Installer not present, nothing to uninstall\"\n Exit 0\n}\n\n$installPath = & $vswhere -products Microsoft.VisualStudio.Product.Community -version \"[17.0,18.0)\" -property installationPath\n\n# vswhere reports failure through the exit code rather than by throwing, so\n# without this check a failed query looks like \"no instance installed\".\nif ($LASTEXITCODE -ne 0) {\n Write-Host \"vswhere.exe failed with exit code $LASTEXITCODE\"\n Exit 1\n}\n\n$installPath = ($installPath | Select-Object -First 1)\n\nif (-not $installPath) {\n Write-Host \"No Visual Studio Community 2022 instance found, nothing to uninstall\"\n Exit 0\n}\n\nWrite-Host \"Found Visual Studio Community 2022 at: $installPath\"\n\n# The install path always contains spaces, so it has to be quoted here. No\n# --wait: it's bootstrapper-only, and Start-Process -Wait already blocks.\n$processOptions = @{\n FilePath = $vsInstaller\n ArgumentList = \"uninstall --installPath `\"$installPath`\" --quiet --norestart\"\n PassThru = $true\n Wait = $true\n}\n\n$process = Start-Process @processOptions\n$exitCode = $process.ExitCode\n\nif ($exitCode -eq 3010 -or $exitCode -eq 1641) {\n Write-Host \"Uninstall exit code: $exitCode (succeeded, reboot required to finish)\"\n Exit 0\n}\n\nif ($exitCode -eq 1001 -or $exitCode -eq 1618) {\n Write-Host \"Uninstall failed: another Visual Studio Installer operation is already in progress (exit code $exitCode)\"\n Exit 1\n}\n\nWrite-Host \"Uninstall exit code: $exitCode\"\nExit $exitCode\n\n} catch {\n Write-Host \"Error: $_\"\n Exit 1\n}\n" + } +} diff --git a/ee/maintained-apps/outputs/visual-studio-2022-enterprise/windows.json b/ee/maintained-apps/outputs/visual-studio-2022-enterprise/windows.json new file mode 100644 index 0000000000..f73f036dbf --- /dev/null +++ b/ee/maintained-apps/outputs/visual-studio-2022-enterprise/windows.json @@ -0,0 +1,22 @@ +{ + "versions": [ + { + "version": "17.14.37", + "queries": { + "exists": "SELECT 1 FROM programs WHERE (name = 'Visual Studio Enterprise 2022' OR name LIKE 'Visual Studio Enterprise 2022 (%') AND publisher = 'Microsoft Corporation';", + "patched": "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM programs WHERE ((name = 'Visual Studio Enterprise 2022' OR name LIKE 'Visual Studio Enterprise 2022 (%') AND publisher = 'Microsoft Corporation') AND version_compare(version, '17.14.37') < 0);" + }, + "installer_url": "https://download.visualstudio.microsoft.com/download/pr/f7f5ecbc-83ca-4cf0-bdb2-aaf70efb6d97/2229b67966b6ae32a74599b68acc1d7d88bc21e93fcceb2f8c1c8253b6e92b29/vs_Enterprise.exe", + "install_script_ref": "1662986f", + "uninstall_script_ref": "4e3130f5", + "sha256": "2229b67966b6ae32a74599b68acc1d7d88bc21e93fcceb2f8c1c8253b6e92b29", + "default_categories": [ + "Developer tools" + ] + } + ], + "refs": { + "1662986f": "# Learn more about .exe install scripts:\n# http://fleetdm.com/learn-more-about/exe-install-scripts\n#\n# The downloaded file is a bootstrapper that pulls the multi-GB payload during\n# this step. --wait is required: without it the bootstrapper forks the real\n# install to a background process and returns before it finishes.\n\n$exeFilePath = \"${env:INSTALLER_PATH}\"\n\ntry {\n\nif (-not (Test-Path $exeFilePath)) {\n Write-Host \"Error: Installer file not found at: $exeFilePath\"\n Exit 1\n}\n\n$processOptions = @{\n FilePath = \"$exeFilePath\"\n ArgumentList = \"--quiet --wait --norestart\"\n PassThru = $true\n Wait = $true\n}\n\n$process = Start-Process @processOptions\n$exitCode = $process.ExitCode\n\nif ($exitCode -eq 3010 -or $exitCode -eq 1641) {\n Write-Host \"Install exit code: $exitCode (succeeded, reboot required to finish)\"\n Exit 0\n}\n\nif ($exitCode -eq 1001 -or $exitCode -eq 1618) {\n Write-Host \"Install failed: another Visual Studio Installer operation is already in progress (exit code $exitCode)\"\n Exit 1\n}\n\nWrite-Host \"Install exit code: $exitCode\"\nExit $exitCode\n\n} catch {\n Write-Host \"Error: $_\"\n Exit 1\n}\n", + "4e3130f5": "# Visual Studio has no UninstallString; it's removed through the shared Visual\n# Studio Installer, which needs the specific instance's install path. -version\n# is required as well as -products, since product IDs are not version specific\n# and an unscoped query also matches a side-by-side Visual Studio 2026.\n\n$vswhere = \"${env:ProgramFiles(x86)}\\Microsoft Visual Studio\\Installer\\vswhere.exe\"\n$vsInstaller = \"${env:ProgramFiles(x86)}\\Microsoft Visual Studio\\Installer\\setup.exe\"\n\ntry {\n\nif (-not (Test-Path $vswhere) -or -not (Test-Path $vsInstaller)) {\n Write-Host \"Visual Studio Installer not present, nothing to uninstall\"\n Exit 0\n}\n\n$installPath = & $vswhere -products Microsoft.VisualStudio.Product.Enterprise -version \"[17.0,18.0)\" -property installationPath\n\n# vswhere reports failure through the exit code rather than by throwing, so\n# without this check a failed query looks like \"no instance installed\".\nif ($LASTEXITCODE -ne 0) {\n Write-Host \"vswhere.exe failed with exit code $LASTEXITCODE\"\n Exit 1\n}\n\n$installPath = ($installPath | Select-Object -First 1)\n\nif (-not $installPath) {\n Write-Host \"No Visual Studio Enterprise 2022 instance found, nothing to uninstall\"\n Exit 0\n}\n\nWrite-Host \"Found Visual Studio Enterprise 2022 at: $installPath\"\n\n# The install path always contains spaces, so it has to be quoted here. No\n# --wait: it's bootstrapper-only, and Start-Process -Wait already blocks.\n$processOptions = @{\n FilePath = $vsInstaller\n ArgumentList = \"uninstall --installPath `\"$installPath`\" --quiet --norestart\"\n PassThru = $true\n Wait = $true\n}\n\n$process = Start-Process @processOptions\n$exitCode = $process.ExitCode\n\nif ($exitCode -eq 3010 -or $exitCode -eq 1641) {\n Write-Host \"Uninstall exit code: $exitCode (succeeded, reboot required to finish)\"\n Exit 0\n}\n\nif ($exitCode -eq 1001 -or $exitCode -eq 1618) {\n Write-Host \"Uninstall failed: another Visual Studio Installer operation is already in progress (exit code $exitCode)\"\n Exit 1\n}\n\nWrite-Host \"Uninstall exit code: $exitCode\"\nExit $exitCode\n\n} catch {\n Write-Host \"Error: $_\"\n Exit 1\n}\n" + } +} diff --git a/ee/maintained-apps/outputs/visual-studio-2022-professional/windows.json b/ee/maintained-apps/outputs/visual-studio-2022-professional/windows.json new file mode 100644 index 0000000000..a5c476f813 --- /dev/null +++ b/ee/maintained-apps/outputs/visual-studio-2022-professional/windows.json @@ -0,0 +1,22 @@ +{ + "versions": [ + { + "version": "17.14.37", + "queries": { + "exists": "SELECT 1 FROM programs WHERE (name = 'Visual Studio Professional 2022' OR name LIKE 'Visual Studio Professional 2022 (%') AND publisher = 'Microsoft Corporation';", + "patched": "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM programs WHERE ((name = 'Visual Studio Professional 2022' OR name LIKE 'Visual Studio Professional 2022 (%') AND publisher = 'Microsoft Corporation') AND version_compare(version, '17.14.37') < 0);" + }, + "installer_url": "https://download.visualstudio.microsoft.com/download/pr/f7f5ecbc-83ca-4cf0-bdb2-aaf70efb6d97/119dd0785334e307d2df472373f0cdfeb6174c8cc895ae12e9157cfb65527ad0/vs_Professional.exe", + "install_script_ref": "1662986f", + "uninstall_script_ref": "ea7440c0", + "sha256": "119dd0785334e307d2df472373f0cdfeb6174c8cc895ae12e9157cfb65527ad0", + "default_categories": [ + "Developer tools" + ] + } + ], + "refs": { + "1662986f": "# Learn more about .exe install scripts:\n# http://fleetdm.com/learn-more-about/exe-install-scripts\n#\n# The downloaded file is a bootstrapper that pulls the multi-GB payload during\n# this step. --wait is required: without it the bootstrapper forks the real\n# install to a background process and returns before it finishes.\n\n$exeFilePath = \"${env:INSTALLER_PATH}\"\n\ntry {\n\nif (-not (Test-Path $exeFilePath)) {\n Write-Host \"Error: Installer file not found at: $exeFilePath\"\n Exit 1\n}\n\n$processOptions = @{\n FilePath = \"$exeFilePath\"\n ArgumentList = \"--quiet --wait --norestart\"\n PassThru = $true\n Wait = $true\n}\n\n$process = Start-Process @processOptions\n$exitCode = $process.ExitCode\n\nif ($exitCode -eq 3010 -or $exitCode -eq 1641) {\n Write-Host \"Install exit code: $exitCode (succeeded, reboot required to finish)\"\n Exit 0\n}\n\nif ($exitCode -eq 1001 -or $exitCode -eq 1618) {\n Write-Host \"Install failed: another Visual Studio Installer operation is already in progress (exit code $exitCode)\"\n Exit 1\n}\n\nWrite-Host \"Install exit code: $exitCode\"\nExit $exitCode\n\n} catch {\n Write-Host \"Error: $_\"\n Exit 1\n}\n", + "ea7440c0": "# Visual Studio has no UninstallString; it's removed through the shared Visual\n# Studio Installer, which needs the specific instance's install path. -version\n# is required as well as -products, since product IDs are not version specific\n# and an unscoped query also matches a side-by-side Visual Studio 2026.\n\n$vswhere = \"${env:ProgramFiles(x86)}\\Microsoft Visual Studio\\Installer\\vswhere.exe\"\n$vsInstaller = \"${env:ProgramFiles(x86)}\\Microsoft Visual Studio\\Installer\\setup.exe\"\n\ntry {\n\nif (-not (Test-Path $vswhere) -or -not (Test-Path $vsInstaller)) {\n Write-Host \"Visual Studio Installer not present, nothing to uninstall\"\n Exit 0\n}\n\n$installPath = & $vswhere -products Microsoft.VisualStudio.Product.Professional -version \"[17.0,18.0)\" -property installationPath\n\n# vswhere reports failure through the exit code rather than by throwing, so\n# without this check a failed query looks like \"no instance installed\".\nif ($LASTEXITCODE -ne 0) {\n Write-Host \"vswhere.exe failed with exit code $LASTEXITCODE\"\n Exit 1\n}\n\n$installPath = ($installPath | Select-Object -First 1)\n\nif (-not $installPath) {\n Write-Host \"No Visual Studio Professional 2022 instance found, nothing to uninstall\"\n Exit 0\n}\n\nWrite-Host \"Found Visual Studio Professional 2022 at: $installPath\"\n\n# The install path always contains spaces, so it has to be quoted here. No\n# --wait: it's bootstrapper-only, and Start-Process -Wait already blocks.\n$processOptions = @{\n FilePath = $vsInstaller\n ArgumentList = \"uninstall --installPath `\"$installPath`\" --quiet --norestart\"\n PassThru = $true\n Wait = $true\n}\n\n$process = Start-Process @processOptions\n$exitCode = $process.ExitCode\n\nif ($exitCode -eq 3010 -or $exitCode -eq 1641) {\n Write-Host \"Uninstall exit code: $exitCode (succeeded, reboot required to finish)\"\n Exit 0\n}\n\nif ($exitCode -eq 1001 -or $exitCode -eq 1618) {\n Write-Host \"Uninstall failed: another Visual Studio Installer operation is already in progress (exit code $exitCode)\"\n Exit 1\n}\n\nWrite-Host \"Uninstall exit code: $exitCode\"\nExit $exitCode\n\n} catch {\n Write-Host \"Error: $_\"\n Exit 1\n}\n" + } +} diff --git a/frontend/pages/SoftwarePage/components/icons/VisualStudio2022.tsx b/frontend/pages/SoftwarePage/components/icons/VisualStudio2022.tsx new file mode 100644 index 0000000000..04ff84894e --- /dev/null +++ b/frontend/pages/SoftwarePage/components/icons/VisualStudio2022.tsx @@ -0,0 +1,14 @@ +import * as React from "react"; + +import type { SVGProps } from "react"; + +const VisualStudio2022 = (props: SVGProps) => ( + + + +); +export default VisualStudio2022; diff --git a/frontend/pages/SoftwarePage/components/icons/index.ts b/frontend/pages/SoftwarePage/components/icons/index.ts index 456b7297bd..611f026362 100644 --- a/frontend/pages/SoftwarePage/components/icons/index.ts +++ b/frontend/pages/SoftwarePage/components/icons/index.ts @@ -1062,6 +1062,7 @@ import VirtualBox from "./VirtualBox"; import VirtualBuddy from "./VirtualBuddy"; import Viscosity from "./Viscosity"; import VisualParadigm from "./VisualParadigm"; +import VisualStudio2022 from "./VisualStudio2022"; import VisualStudioCode from "./VisualStudioCode"; import Vivaldi from "./Vivaldi"; import VividApp from "./VividApp"; @@ -2232,6 +2233,9 @@ export const SOFTWARE_NAME_TO_ICON_MAP = { viscosity: Viscosity, "visual paradigm": VisualParadigm, "visual studio code": VisualStudioCode, + "visual studio community 2022": VisualStudio2022, + "visual studio enterprise 2022": VisualStudio2022, + "visual studio professional 2022": VisualStudio2022, vivaldi: Vivaldi, vivid: VividApp, viz: Viz, diff --git a/website/assets/images/app-icon-visual-studio-2022-community-60x60@2x.png b/website/assets/images/app-icon-visual-studio-2022-community-60x60@2x.png new file mode 100644 index 0000000000..d6d8d38359 Binary files /dev/null and b/website/assets/images/app-icon-visual-studio-2022-community-60x60@2x.png differ diff --git a/website/assets/images/app-icon-visual-studio-2022-enterprise-60x60@2x.png b/website/assets/images/app-icon-visual-studio-2022-enterprise-60x60@2x.png new file mode 100644 index 0000000000..d6d8d38359 Binary files /dev/null and b/website/assets/images/app-icon-visual-studio-2022-enterprise-60x60@2x.png differ diff --git a/website/assets/images/app-icon-visual-studio-2022-professional-60x60@2x.png b/website/assets/images/app-icon-visual-studio-2022-professional-60x60@2x.png new file mode 100644 index 0000000000..d6d8d38359 Binary files /dev/null and b/website/assets/images/app-icon-visual-studio-2022-professional-60x60@2x.png differ