Uninstall previous version of Forticlient

Hello Guys,

I tried uninstalling the previous version of forticlient before installing the new version.

When i insert this command:

    If((Get-InstalledApplication -ProductCode '{8DEDB631-3E1D-4DAF-AA5B-A91F8F95A6E9}' -exact $true) -and (Test-path -Path "HKLM:\Microsoft\Windows\CurrentVersion\Uninstall\{8DEDB631-3E1D-4DAF-AA5B-A91F8F95A6E9}"))
    {
        #Disinstallazione versione precedente
        Execute-MSI -Action 'Uninstall' -Path '{8DEDB631-3E1D-4DAF-AA5B-A91F8F95A6E9}'

        #Remove installdir folder
        Remove-Folder -Path "$envProgramFiles\Fortinet\FortiClient"

        #Removing remains folders if empty        
        If(Test-Path -Path "$envProgramFiles\Fortinet")
        {
            If((Get-ChildItem -Path "$envProgramFiles\Fortinet" | Select-Object -First 1 | Measure-Object).Count -eq 0 ) 
            {			
	            Remove-Folder -Path "$envProgramFiles\Fortinet" 
            }
        }

        #Remove left over driver
        Remove-PnPDrivers -Delinflist "ftsvnic"
		
		#Stop Services FortiClient
		Stop-service -name 'Forticlient'
    
	  }

during the process I see a message on powershell telling me that it has been skipped because it is a windows update. what can I do?

Disclaimer: [I’ve] never touched Forticlient

I would add logging to everything and stop the FortiClient service before uninstalling the MSI.

Another way would be to put pause statements between each step. at least you’d know which is causing the “Windows Update” message

Hello,

Some hints :

  • Are you sure that you are using the correct ProductId ?

  • Try using Get-InstalledApplication with the name of your app instead of the productID and check which productid you are getting

1 Like

Hi,

No issue here.just deregister forticlient first. No need removing pnpdrivers.
Which Forticlient version?

Thanks,

Hi guys,

@sulquendi: with “get -installedapplication” it uninstall correctly the previos version, and i’ve cheched again the product ID was correctly.

@Francois: previous version “7.2.2.0864”, new version "7.2.3.0929

@That-Annoying-Guy: i agree with of don’t touch Forticlient, but when i try to upgrade the version, i need to reboot twice the PC (one for the uninstall of the previous version and one for the install of the new version) and unfortunatelly with Intune is realy boring

Hi,

We are currently deploying 7.0.10.
Personally, I am not a big fan of Forticlient.

From 6 to 7 Un registering the version 6
$envProgramFiles\Fortinet\FortiClient\FortiESNAC.exe -c REG_UNREGISTER
No uninstall

Unregister 7 first
C:\Program Files\Fortinet\FortiClient\FortiESNAC.exe -u
Installing 7
C:\Program Files\Fortinet\FortiClient\FCConfig.exe -m all -f "C:\profile.xml" -o import -i l

Uninstalling 7
Unregister first
$envProgramFiles\Fortinet\FortiClient\FortiESNAC.exe -u
Then uninstalling the msi

Hi Francois,

Thank you for your answer but sorry I haven’t understand as set the script :sweat_smile:

why would you need to uninstall? Forticlient supports upgrade path I believe?
If you must uninstall, it is locked to EMS and therefore needs to be released from management before any uninstall can occur? or you can deploy from EMS itself.

Hi guys,

unfortunately I didn’t find a solution. in the end I released the software without closing the program and stopping the service, just the update.

unfortunately, with this solution the software requires two device restarts.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.