Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FlorianHeigl/41dc7c6616729e50b60451a8153f3375 to your computer and use it in GitHub Desktop.
Save FlorianHeigl/41dc7c6616729e50b60451a8153f3375 to your computer and use it in GitHub Desktop.
force uninstall chromium
$AllRegAppEntries = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall,HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall | ForEach-Object {Get-ItemProperty -Path $_.pspath}
$FilteredApps = New-Object System.Collections.ArrayList
foreach ($App in $AllRegAppEntries) {
if ($App.DisplayName -ilike "*chromi*") {
Write-Host $App
try {
$DisplayVersionAsVersion = New-Object System.Version $App.DisplayVersion
} catch {
$DisplayVersionAsVersion = New-Object System.Version
}
$VersionToCheck = New-Object System.Version "111.0.5563.71"
if ($DisplayVersionAsVersion -lt $VersionToCheck) {
[void]$FilteredApps.Add($App)
}
}
}
foreach ($App in $FilteredApps) {
# Make sure uninstall string uses MSIEXEC
if ($App.UninstallString -ilike "msiexec*") {
$GUID = $App.UninstallString.Substring($App.UninstallString.IndexOf("{"))
$GUID = $GUID.Substring(0, $GUID.IndexOf("}") + 1)
Write-Host "Running the following command: msiexec.exe /x $GUID /qn /norestart"
Start-Process "msiexec.exe" "/x $GUID /qn /norestart" -Wait
}
if ($App.UninstallString -ilike "*setup.exe*") {
Write-Host "Running the followng command: lala"
c
}
}
@FlorianHeigl
Copy link
Author

in the end I went with the second option

@FlorianHeigl
Copy link
Author

    - name: Uninstall Chromium forcibly
      tags: chromium
      win_command: '"C:\Program Files (x86)\Chromium\Application\108.0.5359.125\Installer\setup.exe" --uninstall --system-level --force-uninstall'
      args:
          removes: "C:\\Program Files (x86)\\Chromium\\Application\\108.0.5359.125"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment