As a systems administrator, you have probably dealt with issues caused by having a wide variety of web browsers. This is usually fine, but enough web-based applications and your users might be having vastly different experiences based on which browser they are using. Inconsistent experience may lead you to pick a company-wide browser and run with that. When it comes to removing those, you can usually find the silent uninstall string, deploy it out, and you are done. However, with Firefox, if a user attempts to install it and does not have install permissions, it will just install it in the user data folder, making it way more of a hassle than you are expecting.
Let’s take a look at how we can remove Firefox, no matter how it has been installed.
Removing Machine Level Install
This method is the quickest and most direct if this has been installed with admin privileges. This will install in the Program Files. The uninstall for this is always the same, with the only thing that changes are the install locations based on architecture. The fastest way to do this is to use PDQ Deploy; we have a prebuilt package that you can download and deploy out to all your systems in under 5 minutes.
If however you hate things being easy and want to do this on your own, we can break this down step by step. You are looking for the helper.exe file in your Firefox folder and adding the silent parameters (-ms).
Uninstall for 32-bit or 64-bit
"%ProgramFiles%\Mozilla Firefox\uninstall\helper.exe" -ms
32-bit installed on a 64-bit system
"%ProgramFiles(x86)%\Mozilla Firefox\uninstall\helper.exe" -ms
That is all there is, from here on out things get a little bit more complex to remove.
Remove Per-User Install When Logged-on
Firefox allowing a per-user install makes it a little more complicated. Deploying an uninstall as normal will try to uninstall it from the system account and not install. One option is you can Deploy as the logged-on user. This will remove it for that particular user as long as they are currently logged into the system. To track this down, let’s first build a scanner that will find machines with the per-user version installed and then remove it from those.
Open Inventory and click on new scanner and select PowerShell
You can name it whatever you want, and copy in the following PowerShell.
#Application names
$AppName = "*Firefox*"
$Path = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
#Search for Application that meets the criteria
$Search = Get-ChildItem -Path $Path -ErrorAction SilentlyContinue | Get-ItemProperty | Where-Object {$_.DisplayName -like $AppName}
[PSCustomObject]@{
Firefox = $search.DisplayName
Uninstall = $Search.UninstallString
}
Now that we have everything we need in a scanner, the next step is building a scan profile. Click “Scan Profiles” on the task bar and select “New”.
Now we want to add the computer details scanner as well as the PowerShell scanner we just built. This will update the currently logged-on user, as well as scan that computer for the per-user version of Firefox. Make sure you change the scan as “Logged On User”
Use this to scan your machines and it will grab all machines that have a user currently logged on and have the Per-User Firefox installed. A Dynamic Collection will allow you to see all of them in one location.
The last step is to create a package you can run to remove Firefox from all of the machines that show up in that collection. This is a simple PowerShell step running the following code
$UninstallString = $env:LOCALAPPDATA + "\Mozilla Firefox\uninstall\helper.exe"
$Arguments = "-ms"
Start-Process -FilePath $UninstallString -ArgumentList $Arguments
This will grab the uninstall file from the Appdata\local folder and supply the silent parameters. Please make sure that it is set to run as logged on User
Install (and uninstall) without disruption
Try PDQ Deploy & Inventory — free for 14 days.
Removing Per User For All Users
This is something you absolutely can do, but we are going to put it behind a massive disclaimer. To uninstall from all users, whether they are logged in or not, requires loading the HKEY_Users registry in your PowerShell and performing the removal there. While we have gotten this to work, know that you are diving into an area where things can go very wrong. If you are still comfortable with the attempt, download the package titled “Uninstall Firefox(Per-User).” I would recommend you read through the PowerShell in the second step before running. Make sure you know what you are running.