Skip to content
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

(Malwarebytes) Not uninstalling #226

Closed
2 tasks done
asheroto opened this issue Jun 20, 2024 · 7 comments
Closed
2 tasks done

(Malwarebytes) Not uninstalling #226

asheroto opened this issue Jun 20, 2024 · 7 comments
Labels
completed Issue has been completed. enhancement An enhancement to the package functionality.

Comments

@asheroto
Copy link

asheroto commented Jun 20, 2024

Checklist

  • I have checked for similar opened and closed issues.
  • The issue title is in the format (<PACKAGENAME>) <ISSUE SUMMARY>.

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
Copy link

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
Copy link
Author

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.

@pauby
Copy link
Owner

pauby commented Jul 27, 2024

Thanks for the issue and the PR. I've fixed this in 9906cda

I took a different route from your PR and used the default chocolateyUninstall.ps1 script and added a .skipAutoUninstaller file to stop Chocolatey Automatic Uninstaller from trying to uninstall it (as it's already been uninstalled at that point).

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".

I didn't see that in my testing - it just removed it as expected.

@pauby pauby closed this as completed Jul 27, 2024
@pauby pauby added the enhancement An enhancement to the package functionality. label Jul 27, 2024
@pauby pauby mentioned this issue Jul 27, 2024
10 tasks
@asheroto
Copy link
Author

So the reason I have the window closing in the script is because it will just stay open when uninstalling. Does it not do that now?

@pauby pauby added the completed Issue has been completed. label Jul 27, 2024
@pauby
Copy link
Owner

pauby commented Jul 27, 2024

I tested it here and the window did not open. It's possible it does that under certain conditions and I didn't meet them.

@asheroto
Copy link
Author

asheroto commented Jul 30, 2024

I tested it on Windows Sandbox and found that the screen sticks still on uninstall.

@asheroto
Copy link
Author

asheroto commented Jul 30, 2024

Nevermind! Sorry about that, jumped the gun!

The latest version works for install/uninstall. Good deal. :-)

Thanks for checking on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed Issue has been completed. enhancement An enhancement to the package functionality.
Projects
None yet
Development

No branches or pull requests

2 participants