Add WinRAR as a Windows FMA (#47024)

## Summary

Adds **WinRAR 7.22.0** as a Fleet-maintained app (Windows / winget
`RARLab.WinRAR`).

## Details

- **Installer type**: `exe` (WinRAR self-extracting installer), machine
scope → custom install/uninstall scripts (the ingester only
auto-generates for machine-scope MSI).
- **Silent install**: `-s1` — from the winget manifest's documented
`InstallerSwitches.Silent`.
- **Silent uninstall**: `uninstall.exe /S` located via the registry
`UninstallString`, parsed with the defensive 3-shape matcher.
- **Identity**: `unique_identifier: "WinRAR"` + `fuzzy_match_name: true`
→ exists query `name LIKE 'WinRAR %' AND publisher = 'win.rar GmbH'`.
Fuzzy match is required because WinRAR's registry DisplayName embeds the
version (`WinRAR 7.22.0 (64-bit)`). Registry Publisher matches the
winget locale Publisher, so no `program_publisher` override.
- **SHA**: matches the manifest's en-x64 installer; version `7.22.0`
reconciles with osquery's DisplayVersion.
- **Icon**: generated component, website PNG, and `index.ts` map entry
(`winrar`).

## Notes / risks

- Installer URL (`https://www.rarlab.com/rar/winrar-x64-722.exe`) is
version-pinned, so the SHA is stable until the FMA auto-update bumps it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added WinRAR application support, including version 7.22.0 with
automated installation and uninstallation capabilities.
* Added custom WinRAR icon for improved visibility on the software page.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Allen Houchins
2026-06-06 22:56:24 -05:00
committed by GitHub
parent b2a9e77c46
commit e36ae71e2d
8 changed files with 154 additions and 0 deletions
@@ -0,0 +1,31 @@
# Learn more about .exe install scripts:
# http://fleetdm.com/learn-more-about/exe-install-scripts
#
# WinRAR ships as a self-extracting installer. "-s1" performs a silent
# install with no windows; it installs per-machine into Program Files.
$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 = "-s1"
PassThru = $true
Wait = $true
NoNewWindow = $true
}
$process = Start-Process @processOptions
$exitCode = $process.ExitCode
Write-Host "Install exit code: $exitCode"
Exit $exitCode
} catch {
Write-Host "Error: $_"
Exit 1
}
@@ -0,0 +1,65 @@
# Attempts to locate WinRAR's uninstaller from the registry and run it silently.
# WinRAR's UninstallString points at "<install dir>\uninstall.exe", which accepts /S.
$displayNameLike = "WinRAR*"
$publisher = "win.rar GmbH"
$paths = @(
'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall',
'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall'
)
$uninstall = $null
foreach ($p in $paths) {
$items = Get-ItemProperty "$p\*" -ErrorAction SilentlyContinue | Where-Object {
$_.DisplayName -like $displayNameLike -and $_.Publisher -like "$publisher*"
}
if ($items) { $uninstall = $items | Select-Object -First 1; break }
}
if (-not $uninstall -or -not $uninstall.UninstallString) {
Write-Host "Uninstall entry not found"
Exit 0
}
Stop-Process -Name "WinRAR" -Force -ErrorAction SilentlyContinue
$uninstallCommand = $uninstall.UninstallString
$uninstallArgs = "/S"
# Parse the UninstallString defensively for the three common shapes.
if ($uninstallCommand -match '^\s*"([^"]+)"\s*(.*)$') { # quoted path
$uninstallCommand = $matches[1]
$existingArgs = $matches[2].Trim()
} elseif ($uninstallCommand -match '(?i)^\s*(.+?\.exe)\s*(.*)$') { # unquoted, may contain spaces
$uninstallCommand = $matches[1]
$existingArgs = $matches[2].Trim()
} elseif ($uninstallCommand -match '^\s*(\S+)\s*(.*)$') { # bare token
$uninstallCommand = $matches[1]
$existingArgs = $matches[2].Trim()
}
if ($existingArgs -and $existingArgs -ne '') {
$uninstallArgs = "$existingArgs $uninstallArgs"
}
Write-Host "Uninstall command: $uninstallCommand"
Write-Host "Uninstall args: $uninstallArgs"
try {
$processOptions = @{
FilePath = $uninstallCommand
ArgumentList = $uninstallArgs
NoNewWindow = $true
PassThru = $true
Wait = $true
}
$process = Start-Process @processOptions
$exitCode = $process.ExitCode
Write-Host "Uninstall exit code: $exitCode"
Exit $exitCode
} catch {
Write-Host "Error running uninstaller: $_"
Exit 1
}
@@ -0,0 +1,13 @@
{
"name": "WinRAR",
"slug": "winrar/windows",
"package_identifier": "RARLab.WinRAR",
"unique_identifier": "WinRAR",
"fuzzy_match_name": true,
"install_script_path": "ee/maintained-apps/inputs/winget/scripts/winrar_install.ps1",
"uninstall_script_path": "ee/maintained-apps/inputs/winget/scripts/winrar_uninstall.ps1",
"installer_arch": "x64",
"installer_type": "exe",
"installer_scope": "machine",
"default_categories": ["Productivity"]
}
+7
View File
@@ -2794,6 +2794,13 @@
"unique_identifier": "Windsurf",
"description": "Windsurf is an agentic IDE powered by AI Flow paradigm."
},
{
"name": "WinRAR",
"slug": "winrar/windows",
"platform": "windows",
"unique_identifier": "WinRAR",
"description": "WinRAR is a file archiver utility for Windows. It creates and extracts RAR and ZIP archives and supports compression, encryption, and splitting archives into volumes."
},
{
"name": "WinSCP",
"slug": "winscp/windows",
@@ -0,0 +1,22 @@
{
"versions": [
{
"version": "7.22.0",
"queries": {
"exists": "SELECT 1 FROM programs WHERE name LIKE 'WinRAR %' AND publisher = 'win.rar GmbH';",
"patched": "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM programs WHERE name LIKE 'WinRAR %' AND publisher = 'win.rar GmbH' AND version_compare(version, '7.22.0') < 0);"
},
"installer_url": "https://www.rarlab.com/rar/winrar-x64-722.exe",
"install_script_ref": "5879db33",
"uninstall_script_ref": "48a0291b",
"sha256": "d669f4e15e9b8fde6e6dcc47697fc5a38b77e1fd5c608cf6423e4eba8df62498",
"default_categories": [
"Productivity"
]
}
],
"refs": {
"48a0291b": "# Attempts to locate WinRAR's uninstaller from the registry and run it silently.\n# WinRAR's UninstallString points at \"<install dir>\\uninstall.exe\", which accepts /S.\n\n$displayNameLike = \"WinRAR*\"\n$publisher = \"win.rar GmbH\"\n\n$paths = @(\n 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall',\n 'HKLM:\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall'\n)\n\n$uninstall = $null\nforeach ($p in $paths) {\n $items = Get-ItemProperty \"$p\\*\" -ErrorAction SilentlyContinue | Where-Object {\n $_.DisplayName -like $displayNameLike -and $_.Publisher -like \"$publisher*\"\n }\n if ($items) { $uninstall = $items | Select-Object -First 1; break }\n}\n\nif (-not $uninstall -or -not $uninstall.UninstallString) {\n Write-Host \"Uninstall entry not found\"\n Exit 0\n}\n\nStop-Process -Name \"WinRAR\" -Force -ErrorAction SilentlyContinue\n\n$uninstallCommand = $uninstall.UninstallString\n$uninstallArgs = \"/S\"\n\n# Parse the UninstallString defensively for the three common shapes.\nif ($uninstallCommand -match '^\\s*\"([^\"]+)\"\\s*(.*)$') { # quoted path\n $uninstallCommand = $matches[1]\n $existingArgs = $matches[2].Trim()\n} elseif ($uninstallCommand -match '(?i)^\\s*(.+?\\.exe)\\s*(.*)$') { # unquoted, may contain spaces\n $uninstallCommand = $matches[1]\n $existingArgs = $matches[2].Trim()\n} elseif ($uninstallCommand -match '^\\s*(\\S+)\\s*(.*)$') { # bare token\n $uninstallCommand = $matches[1]\n $existingArgs = $matches[2].Trim()\n}\n\nif ($existingArgs -and $existingArgs -ne '') {\n $uninstallArgs = \"$existingArgs $uninstallArgs\"\n}\n\nWrite-Host \"Uninstall command: $uninstallCommand\"\nWrite-Host \"Uninstall args: $uninstallArgs\"\n\ntry {\n $processOptions = @{\n FilePath = $uninstallCommand\n ArgumentList = $uninstallArgs\n NoNewWindow = $true\n PassThru = $true\n Wait = $true\n }\n\n $process = Start-Process @processOptions\n $exitCode = $process.ExitCode\n Write-Host \"Uninstall exit code: $exitCode\"\n Exit $exitCode\n} catch {\n Write-Host \"Error running uninstaller: $_\"\n Exit 1\n}\n",
"5879db33": "# Learn more about .exe install scripts:\n# http://fleetdm.com/learn-more-about/exe-install-scripts\n#\n# WinRAR ships as a self-extracting installer. \"-s1\" performs a silent\n# install with no windows; it installs per-machine into Program Files.\n\n$exeFilePath = \"${env:INSTALLER_PATH}\"\n\ntry {\n if (-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 = \"-s1\"\n PassThru = $true\n Wait = $true\n NoNewWindow = $true\n }\n\n $process = Start-Process @processOptions\n $exitCode = $process.ExitCode\n Write-Host \"Install exit code: $exitCode\"\n Exit $exitCode\n\n} catch {\n Write-Host \"Error: $_\"\n Exit 1\n}\n"
}
}
File diff suppressed because one or more lines are too long
@@ -293,6 +293,7 @@ import WindowsAppRemote from "./WindowsAppRemote";
import WindowsDefender from "./WindowsDefender";
import WindowsOS from "./WindowsOS";
import Windsurf from "./Windsurf";
import Winrar from "./Winrar";
import Winscp from "./Winscp";
import Wireshark from "./Wireshark";
import Word from "./Word";
@@ -613,6 +614,7 @@ export const SOFTWARE_NAME_TO_ICON_MAP = {
"windows app remote": WindowsAppRemote,
"windows defender": WindowsDefender,
windsurf: Windsurf,
winrar: Winrar,
winscp: Winscp,
wireshark: Wireshark,
"wrike for mac": WrikeForMac,
Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB