-
Notifications
You must be signed in to change notification settings - Fork 977
Add AOMEI Backupper Standard as a Windows Fleet-maintained app #50021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e9bc66f
056d210
81b741f
1afece8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "name": "AOMEI Backupper Standard", | ||
| "slug": "aomei-backupper-standard/windows", | ||
| "package_identifier": "AOMEI.Backupper.Standard", | ||
| "unique_identifier": "AOMEI Backupper", | ||
| "program_publisher": "AOMEI International Network Limited.", | ||
| "install_script_path": "ee/maintained-apps/inputs/winget/scripts/aomei_backupper_standard_install.ps1", | ||
| "uninstall_script_path": "ee/maintained-apps/inputs/winget/scripts/aomei_backupper_standard_uninstall.ps1", | ||
| "installer_arch": "x86", | ||
| "installer_type": "exe", | ||
| "installer_scope": "machine", | ||
| "default_categories": ["Utilities"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Learn more about .exe install scripts: | ||
| # http://fleetdm.com/learn-more-about/exe-install-scripts | ||
|
|
||
| $exeFilePath = "${env:INSTALLER_PATH}" | ||
|
|
||
| try { | ||
|
|
||
| # AOMEI Backupper Standard uses Inno Setup | ||
| $processOptions = @{ | ||
| FilePath = "$exeFilePath" | ||
| ArgumentList = "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART" | ||
| PassThru = $true | ||
| Wait = $true | ||
| } | ||
|
|
||
| $process = Start-Process @processOptions | ||
| $exitCode = $process.ExitCode | ||
|
|
||
| Write-Host "Install exit code: $exitCode" | ||
| Exit $exitCode | ||
|
|
||
| } catch { | ||
| Write-Host "Error: $_" | ||
| Exit 1 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # The ARP DisplayName is "AOMEI Backupper" (no "Standard" suffix since ~v7.4). | ||
| # Match name and publisher exactly so add-ons sharing the name prefix aren't hit. | ||
| $softwareName = "AOMEI Backupper" | ||
| $softwarePublisher = "AOMEI International Network Limited." | ||
| $uninstallArgs = "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART" | ||
|
|
||
| $machineKey = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*' | ||
| $machineKey32on64 = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*' | ||
| $exitCode = 0 | ||
|
|
||
| try { | ||
| [array]$uninstallKeys = Get-ChildItem -Path @($machineKey, $machineKey32on64) -ErrorAction SilentlyContinue | | ||
| ForEach-Object { Get-ItemProperty $_.PSPath -ErrorAction SilentlyContinue } | ||
|
|
||
| $foundUninstaller = $false | ||
| foreach ($key in $uninstallKeys) { | ||
| if ($key.DisplayName -eq $softwareName -and $key.Publisher -eq $softwarePublisher) { | ||
| $foundUninstaller = $true | ||
| $uninstallCommand = if ($key.QuietUninstallString) { $key.QuietUninstallString } else { $key.UninstallString } | ||
|
Comment on lines
+16
to
+19
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch — fixed. The lookup now matches the DisplayName exactly and also requires The publisher value is verified, not assumed: the installer's PE version resource has Also added |
||
| if ($uninstallCommand -match '^\s*"([^"]+)"\s*(.*)$') { | ||
| $uninstallCommand = $Matches[1]; if ($Matches[2]) { $uninstallArgs = "$($Matches[2]) $uninstallArgs".Trim() } | ||
| } elseif ($uninstallCommand -match '(?i)^\s*(.+?\.exe)\s*(.*)$') { | ||
| $uninstallCommand = $Matches[1]; if ($Matches[2]) { $uninstallArgs = "$($Matches[2]) $uninstallArgs".Trim() } | ||
| } elseif ($uninstallCommand -match '^\s*(\S+)\s*(.*)$') { | ||
| $uninstallCommand = $Matches[1]; if ($Matches[2]) { $uninstallArgs = "$($Matches[2]) $uninstallArgs".Trim() } | ||
| } | ||
| Write-Host "Uninstall command: $uninstallCommand"; Write-Host "Uninstall args: $uninstallArgs" | ||
| $processOptions = @{ FilePath = $uninstallCommand; PassThru = $true; Wait = $true } | ||
| if ($uninstallArgs -ne '') { $processOptions.ArgumentList = $uninstallArgs } | ||
| $process = Start-Process @processOptions | ||
| $exitCode = $process.ExitCode; Write-Host "Uninstall exit code: $exitCode"; break | ||
| } | ||
| } | ||
| if (-not $foundUninstaller) { Write-Host "Uninstall entry not found for '$softwareName'."; Exit 0 } | ||
| } catch { Write-Host "Error: $_"; Exit 1 } | ||
|
|
||
| Exit $exitCode | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "versions": [ | ||
| { | ||
| "version": "8.4.0.0", | ||
| "queries": { | ||
| "exists": "SELECT 1 FROM programs WHERE name = 'AOMEI Backupper' AND publisher = 'AOMEI International Network Limited.';", | ||
| "patched": "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM programs WHERE name = 'AOMEI Backupper' AND publisher = 'AOMEI International Network Limited.' AND version_compare(version, '8.4.0.0') < 0);" | ||
| }, | ||
| "installer_url": "https://www2.aomeisoftware.com/download/adb/AOMEIBackupperStd.exe", | ||
| "install_script_ref": "03d967ed", | ||
| "uninstall_script_ref": "e92f2668", | ||
| "sha256": "a9b347b8e43a5ef626adad9eda2e5713df7ca86da11438ada7c0a90453a724d2", | ||
| "default_categories": [ | ||
| "Utilities" | ||
| ] | ||
| } | ||
| ], | ||
| "refs": { | ||
| "03d967ed": "# Learn more about .exe install scripts:\n# http://fleetdm.com/learn-more-about/exe-install-scripts\n\n$exeFilePath = \"${env:INSTALLER_PATH}\"\n\ntry {\n\n# AOMEI Backupper Standard uses Inno Setup\n$processOptions = @{\n FilePath = \"$exeFilePath\"\n ArgumentList = \"/VERYSILENT /SUPPRESSMSGBOXES /NORESTART\"\n PassThru = $true\n Wait = $true\n}\n\n$process = Start-Process @processOptions\n$exitCode = $process.ExitCode\n\nWrite-Host \"Install exit code: $exitCode\"\nExit $exitCode\n\n} catch {\n Write-Host \"Error: $_\"\n Exit 1\n}\n", | ||
| "e92f2668": "# The ARP DisplayName is \"AOMEI Backupper\" (no \"Standard\" suffix since ~v7.4).\n# Match name and publisher exactly so add-ons sharing the name prefix aren't hit.\n$softwareName = \"AOMEI Backupper\"\n$softwarePublisher = \"AOMEI International Network Limited.\"\n$uninstallArgs = \"/VERYSILENT /SUPPRESSMSGBOXES /NORESTART\"\n\n$machineKey = 'HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*'\n$machineKey32on64 = 'HKLM:\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\*'\n$exitCode = 0\n\ntry {\n [array]$uninstallKeys = Get-ChildItem -Path @($machineKey, $machineKey32on64) -ErrorAction SilentlyContinue |\n ForEach-Object { Get-ItemProperty $_.PSPath -ErrorAction SilentlyContinue }\n\n $foundUninstaller = $false\n foreach ($key in $uninstallKeys) {\n if ($key.DisplayName -eq $softwareName -and $key.Publisher -eq $softwarePublisher) {\n $foundUninstaller = $true\n $uninstallCommand = if ($key.QuietUninstallString) { $key.QuietUninstallString } else { $key.UninstallString }\n if ($uninstallCommand -match '^\\s*\"([^\"]+)\"\\s*(.*)$') {\n $uninstallCommand = $Matches[1]; if ($Matches[2]) { $uninstallArgs = \"$($Matches[2]) $uninstallArgs\".Trim() }\n } elseif ($uninstallCommand -match '(?i)^\\s*(.+?\\.exe)\\s*(.*)$') {\n $uninstallCommand = $Matches[1]; if ($Matches[2]) { $uninstallArgs = \"$($Matches[2]) $uninstallArgs\".Trim() }\n } elseif ($uninstallCommand -match '^\\s*(\\S+)\\s*(.*)$') {\n $uninstallCommand = $Matches[1]; if ($Matches[2]) { $uninstallArgs = \"$($Matches[2]) $uninstallArgs\".Trim() }\n }\n Write-Host \"Uninstall command: $uninstallCommand\"; Write-Host \"Uninstall args: $uninstallArgs\"\n $processOptions = @{ FilePath = $uninstallCommand; PassThru = $true; Wait = $true }\n if ($uninstallArgs -ne '') { $processOptions.ArgumentList = $uninstallArgs }\n $process = Start-Process @processOptions\n $exitCode = $process.ExitCode; Write-Host \"Uninstall exit code: $exitCode\"; break\n }\n }\n if (-not $foundUninstaller) { Write-Host \"Uninstall entry not found for '$softwareName'.\"; Exit 0 }\n} catch { Write-Host \"Error: $_\"; Exit 1 }\n\nExit $exitCode\n" | ||
| } | ||
| } |
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: fleetdm/fleet
Length of output: 50370
🏁 Script executed:
Repository: fleetdm/fleet
Length of output: 526
Do not treat every registry read error as “not installed.”
SilentlyContinuesuppresses registry enumeration/provider failures, soExit 0on “uninstall entry not found” can report success when AOMEI may still be installed. Handle absent registry views separately, and useErrorAction Stopfor expected registry access failures.🤖 Prompt for AI Agents