How to configure a silent uninstaller?

windows

#1

Requirement to configure uninstaller for use with mass deployments.

We are creating a package to install the Brave browser via SCCM, as part of this package there is a requirement to have an uninstall configured for any occasion where Brave may need to be removed.

Please can someone advise on the command to achieve this, or if there is a removal tool available.

I have tried the C:\Program Files (x86)\BraveSoftware\Brave-Browser\Application\brave.exe --uninstall command, but this hasn’t actually removed anything after the Uninstall button has been clicked.

Any guidance on this will be greatly appreciated.


#2

@Flint, thanks for reaching out!
Sorry for the late response. I’m going to see if I can grab a dev to answer this question - want to make sure I give you the right/most accurate information.
Thanks for being patient!


#3

Hi @Flint

I think I have an answer that should always work

Depending on how the install was done, you can get the uninstall command via the registry.

  • If the install was done where UAC was shown (and user clicked yes), it will install Brave system-wide (for all users). In this case the registry key is: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\BraveSoftware Brave-Browser
  • If the install was done either by a non-admin user OR if the person clicked “No” when UAC prompt is shown, they can install for ONLY their user. In this case, it can be found in: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\BraveSoftware Brave-Browser

When you have a handle to that key, you can read the sub-key called UninstallString. This will have the command you can run to clean up Brave. On my test machine, it has the following value:
"C:\Program Files (x86)\BraveSoftware\Brave-Browser\Application\70.0.56.15\Installer\setup.exe" --uninstall --system-level

If you did a user-level install (ex: non-admin or pick no on UAC prompt), it’ll look like this:
"C:\Users\brian\AppData\Local\BraveSoftware\Brave-Browser\Application\71.0.57.16\Installer\setup.exe" --uninstall

Hope this helps :smile: