How to configure a silent uninstaller?

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\\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\\Installer\setup.exe" --uninstall

Hope this helps :smile: