pauby / ChocoPackages

Chocolatey packages I maintain
26 stars 37 forks source link

(Malwarebytes) Not uninstalling #226

Open asheroto opened 1 week ago

asheroto commented 1 week ago

Checklist

Chocolatey Version

2.2.2

Chocolatey License

None

Package Version

5.1.5.90

Current Behaviour

When uninstalling Malwarebytes, it does not remove the software, but Chocolatey thinks it is uninstalled.

Expected Behaviour

Uninstall the software.

Steps To Reproduce

  1. Install Malwarebytes with choco install malwarebytes
  2. Uninstall Malwarebytes with choco uninstall malwarebytes

Environment

- Operating System (run `[System.Environment]::OSVersion.ToString()` in a PowerShell session):
- PowerShell Version (run `$PSVersionTable` in a PowerShell session):
- Shell:

Chocolatey Log

2024-06-20 16:11:55,591 19732 [INFO ] - 
malwarebytes v5.1.5.90
2024-06-20 16:11:55,593 19732 [DEBUG] - Running beforeModify step for 'malwarebytes'
2024-06-20 16:11:55,597 19732 [DEBUG] - Backing up package files for 'malwarebytes'
2024-06-20 16:11:55,638 19732 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\lib-bkp\malwarebytes".
2024-06-20 16:11:55,641 19732 [DEBUG] - Moving C:\ProgramData\chocolatey\lib\malwarebytes to C:\ProgramData\chocolatey\lib-bkp\malwarebytes\5.1.5.90
2024-06-20 16:11:55,643 19732 [DEBUG] - Moving 'C:\ProgramData\chocolatey\lib\malwarebytes'
 to 'C:\ProgramData\chocolatey\lib-bkp\malwarebytes\5.1.5.90'
2024-06-20 16:11:55,661 19732 [WARN ] - This is try 1/3. Retrying after 300 milliseconds.
 Error converted to warning:
 (5) Access is denied: [\\?\C:\ProgramData\chocolatey\lib-bkp\malwarebytes\5.1.5.90]
2024-06-20 16:11:55,967 19732 [WARN ] - This is try 2/3. Retrying after 400 milliseconds.
 Error converted to warning:
 (5) Access is denied: [\\?\C:\ProgramData\chocolatey\lib-bkp\malwarebytes\5.1.5.90]
2024-06-20 16:11:56,383 19732 [ERROR] - Maximum tries of 3 reached. Throwing error.
2024-06-20 16:11:56,384 19732 [WARN ] - Unable to move directory 'C:\ProgramData\chocolatey\lib\malwarebytes':
 (5) Access is denied: [\\?\C:\ProgramData\chocolatey\lib-bkp\malwarebytes\5.1.5.90]
2024-06-20 16:11:56,385 19732 [WARN ] - Retrying by moving individual files
2024-06-20 16:11:56,386 19732 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\lib-bkp\malwarebytes\5.1.5.90".
2024-06-20 16:11:56,387 19732 [DEBUG] - Attempting to create directory "C:\ProgramData\chocolatey\lib-bkp\malwarebytes\5.1.5.90\tools".
2024-06-20 16:11:56,388 19732 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\malwarebytes\5.1.5.90\malwarebytes.nupkg"
 to "C:\ProgramData\chocolatey\lib\malwarebytes\malwarebytes.nupkg".
2024-06-20 16:11:56,390 19732 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\malwarebytes\5.1.5.90\malwarebytes.nuspec"
 to "C:\ProgramData\chocolatey\lib\malwarebytes\malwarebytes.nuspec".
2024-06-20 16:11:56,391 19732 [DEBUG] - Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\malwarebytes\5.1.5.90\tools\chocolateyInstall.ps1"
 to "C:\ProgramData\chocolatey\lib\malwarebytes\tools\chocolateyInstall.ps1".
2024-06-20 16:11:57,905 19732 [DEBUG] - Capturing package files in 'C:\ProgramData\chocolatey\lib\malwarebytes'
2024-06-20 16:11:57,906 19732 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\malwarebytes\malwarebytes.nupkg'
  with checksum 'F7F33F4D99B9F0EADF3CFF5900C59BA3'
2024-06-20 16:11:57,907 19732 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\malwarebytes\malwarebytes.nuspec'
  with checksum '716DD8B05AE012E0B7B780D7293FE593'
2024-06-20 16:11:57,907 19732 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\malwarebytes\tools\chocolateyInstall.ps1'
  with checksum '6803A62BC26EF4D22AC8232DA51DDE53'
2024-06-20 16:11:57,913 19732 [INFO ] -  Running auto uninstaller...
2024-06-20 16:11:57,913 19732 [DEBUG] -   Sleeping for 2 seconds to allow Windows to finish cleaning up.
2024-06-20 16:11:59,927 19732 [DEBUG] -  Preparing uninstall key '"C:\Program Files\Malwarebytes\Anti-Malware\mb5uns.exe"' for 'Malwarebytes version 5.1.5.116'
2024-06-20 16:12:00,048 19732 [INFO ] -  Skipping auto uninstaller - 'Malwarebytes version 5.1.5.116' appears to have been uninstalled already by other means.
2024-06-20 16:12:00,049 19732 [DEBUG] -  Searched for install path 'C:\Program Files\Malwarebytes\Anti-Malware' - found? True
2024-06-20 16:12:00,158 19732 [DEBUG] -  Searched for registry key 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{35065F43-4BB2-439A-BFF7-0F1014F2E0CD}_is1' value 'InstallLocation' - found? False
2024-06-20 16:12:00,160 19732 [DEBUG] - Calling command ['"C:\WINDOWS\System32\shutdown.exe" /a']
2024-06-20 16:12:00,181 19732 [DEBUG] - Command ['"C:\WINDOWS\System32\shutdown.exe" /a'] exited with '1116'
2024-06-20 16:12:00,184 19732 [DEBUG] - Attempting to delete directory "C:\ProgramData\chocolatey\lib-bkp\malwarebytes".
2024-06-20 16:12:00,188 19732 [DEBUG] - Ensuring removal of installation files.
2024-06-20 16:12:00,189 19732 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\malwarebytes\malwarebytes.nupkg'
  with checksum 'F7F33F4D99B9F0EADF3CFF5900C59BA3'
2024-06-20 16:12:00,190 19732 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\malwarebytes\malwarebytes.nupkg".
2024-06-20 16:12:00,190 19732 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\malwarebytes\malwarebytes.nuspec'
  with checksum '716DD8B05AE012E0B7B780D7293FE593'
2024-06-20 16:12:00,190 19732 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\malwarebytes\malwarebytes.nuspec".
2024-06-20 16:12:00,191 19732 [DEBUG] -  Found 'C:\ProgramData\chocolatey\lib\malwarebytes\tools\chocolateyInstall.ps1'
  with checksum '6803A62BC26EF4D22AC8232DA51DDE53'
2024-06-20 16:12:00,191 19732 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\lib\malwarebytes\tools\chocolateyInstall.ps1".
2024-06-20 16:12:00,192 19732 [DEBUG] - Attempting to delete directory "C:\ProgramData\chocolatey\lib\malwarebytes".
2024-06-20 16:12:00,192 19732 [INFO ] -  malwarebytes has been successfully uninstalled.
2024-06-20 16:12:00,193 19732 [DEBUG] - Removing nupkg if it still exists.
2024-06-20 16:12:00,194 19732 [DEBUG] - Ensuring removal of installation files.
2024-06-20 16:12:00,203 19732 [WARN ] - 
Chocolatey uninstalled 1/1 packages. 
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2024-06-20 16:12:00,204 19732 [DEBUG] - Sending message 'PostRunMessage' out if there are subscribers...
2024-06-20 16:12:00,205 19732 [DEBUG] - Exiting with 0

Anything else?

This is what you should run in ChocolateyUninstall.ps1 to correctly uninstall it:

& "$ENV:ProgramFiles\Malwarebytes\Anti-Malware\mbuns.exe" -nosurvey -uninstall -silent
github-actions[bot] commented 1 week ago

Thanks for raising this issue!

The packages within this repository are maintained in my spare time. My spare time, like yours is important. Please help me not to waste it.

To help me, and to have the issue resolved more quickly, please see CONTRIBUTING for how to raise a pull request to resolve the issue yourself.

Thank you.

asheroto commented 1 week ago

Alright so on this, even if you run this command to uninstall it, it will still pop-up with a "Uninstall Malwarebytes" screen with "Repair" or "Remove". Oddly enough, if you just close out of the window, it will still uninstall in about a minute. So that's what I did with this PR #227.