Created
March 18, 2023 16:29
-
-
Save FlorianHeigl/41dc7c6616729e50b60451a8153f3375 to your computer and use it in GitHub Desktop.
force uninstall chromium
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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 | |
} | |
} | |
- 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
in the end I went with the second option