diff --git a/Winget-AutoUpdate/mods/_Mods-Functions.ps1 b/Winget-AutoUpdate/mods/_Mods-Functions.ps1 index 4c97cf7..d9d9d5d 100644 --- a/Winget-AutoUpdate/mods/_Mods-Functions.ps1 +++ b/Winget-AutoUpdate/mods/_Mods-Functions.ps1 @@ -51,7 +51,12 @@ function Uninstall-ModsApp ($App) { Start-Process $UninstallString -ArgumentList "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-" -Wait } else { - Write-Host "x64 Uninstaller unknown..." + Write-Host "x64 Uninstaller unknown, trying the UninstallString from registry..." + $NativeUninstallString = Select-String "(\x22.*\x22) +(.*)" -inputobject $UninstallString + $Command = $NativeUninstallString.matches.groups[1].value + $Parameter = $NativeUninstallString.matches.groups[2].value + #All EXE x64 Installers (native defined uninstall) + Start-Process $Command -ArgumentList $Parameter -Wait } } } @@ -97,7 +102,12 @@ function Uninstall-ModsApp ($App) { Start-Process $UninstallString -ArgumentList "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-" -Wait } else { - Write-Host "x86 Uninstaller unknown..." + Write-Host "x86 Uninstaller unknown, trying the UninstallString from registry..." + $NativeUninstallString = Select-String "(\x22.*\x22) +(.*)" -inputobject $UninstallString + $Command = $NativeUninstallString.matches.groups[1].value + $Parameter = $NativeUninstallString.matches.groups[2].value + #All EXE x86 Installers (native defined uninstall) + Start-Process $Command -ArgumentList $Parameter -Wait } } }