none
Remove All version of Mozilla Firefox expect for the latest one RRS feed

  • Question

  • Hi, I need to remove all of the version of Mozilla Firefox from the PC.

    1. Remove from X86 Programs files
    2. Remove for x64 systesm
    3. Remove from local app folder

    I need to make sure the latest one is not remove but all other version are removed.

    I use following batch file to remove the Mozilla Firefox but its not working and the PC which I have try it manully it removes all versions

    C:\Program Files\Mozilla Firefox\uninstall\helper.exe /S
    C:\Program Files (x86)\Mozilla Firefox\uninstall\helper.exe /S

    Sunday, July 7, 2019 4:46 PM

All replies

  • Hi,

    I suggest to you to create 2 query-based collections devices:

    • All devices with Mozilla FireFox x64 (previous version).
    • All devices with Mozilla FireFox x86 (previous version).

    Now, you push the latest version of Mozilla FireFox on the two collections and specify a dependence, that requires that all previous version are uninstalled.

    The command-line to uninstall Mozilla is correct.

    Regards,

    SAAD Youssef

    Sunday, July 7, 2019 5:25 PM
  • I would create a single application using the PowerShell appdeployment toolkit.

    Example here:

    https://www.nyhu.us/powershell/psadt/uninstall-exe-applications-with-psadt/

    The function also returns the version which you can use for filtering. Once you get used to using this kit you will never look back.


    Richard Knight | Collection Refresh Manager | Automate detection rules for patch \ msp files | Twitter

    Sunday, July 7, 2019 7:30 PM
  • This is what i'm doing.

    Created a collection for firefox PC (One Collection). We only need x64 version now, x86 is not needed anymore.

    Then created app to remove firefox using powershell script.

    Script to remove

    if (Test-Path ($env:USERPROFILE + "\AppData\Local\Mozilla Firefox\uninstall\helper.exe") )
    {
        taskkill.exe /f /im firefox.exe
        $setup = $env:USERPROFILE + "\AppData\Local\Mozilla Firefox\uninstall\helper.exe"
        $args = " /s"
        $uninst = Start-Process $setup -PassThru -ArgumentList $args -wait
        $uninst.WaitForExit()
    
    }
    
    if (Test-Path (${env:ProgramFiles(x86)} + "\Mozilla Firefox\uninstall\helper.exe") )
    {
        taskkill.exe /f /im firefox.exe
        $setup = ${env:ProgramFiles(x86)} + "\Mozilla Firefox\uninstall\helper.exe"
        $args = " /s"
        $uninst = Start-Process $setup -PassThru -ArgumentList $args -wait
        $uninst.WaitForExit()
    
    }
    
    if (Test-Path ($env:ProgramFiles + "\Mozilla Firefox\uninstall\helper.exe") )
    {
        taskkill.exe /f /im firefox.exe
        $setup = $env:ProgramFiles + "\Mozilla Firefox\uninstall\helper.exe"
        $args = " /s"
        $uninst = Start-Process $setup -PassThru -ArgumentList $args -wait
        $uninst.WaitForExit()
    
    }

    Dectetion

    if (
            -not (Test-Path ($env:ProgramFiles + "\Mozilla Firefox\uninstall\helper.exe") ) -and 
            -not (Test-Path ($env:USERPROFILE + "\AppData\Local\Mozilla Firefox\uninstall\helper.exe") ) -and
            -not (Test-Path (${env:ProgramFiles(x86)} + "\Mozilla Firefox\uninstall\helper.exe") )
        )
    {
        Write-Host "not installed"
    }

    Then created app for install firefox (New Version) and put the remove app as dependencies

    Then assign the install firefox to collection

    Just waiting for it to see if this work.

    Monday, July 8, 2019 10:50 AM
  • Nice,

    Your detection rule outputs Not installed, ideally you don't want any output.

    https://david-obrien.net/2013/12/configmgr-powershell-application-detection-methods/

    Example

    if (Test-Path C:\Apps\Test.html)
        {
            Write-Host "Installed"
        }
    else
        {
        }


    Richard Knight | Collection Refresh Manager | Automate detection rules for patch \ msp files | Twitter




    Thursday, July 11, 2019 6:48 AM