Patching Foxit

  • 5 January 2023
  • 0 replies
  • 57 views

Badge

We patch Foxit PDF Editor with a Worklet.

 

Note:

This method is using the MSI, and the MST. Using Volume Licensing.

You will have to upload the following files to the worklet, or edit to keep and call from a location of your choosing.

Scope:

###################################
$AppVersion = "11.2.1.53537"
$AppName = "Foxit PDF Editor"
###################################

#Get List of installed Packages
$PSVer = $PSVersionTable.PSVersion
Write-Output "PowerShell Version: $PSVer"
if($PSVer.Major -ge 5)
{
$InstalledPackages = Get-Package
}
else
{
$InstalledPackages = Get-WmiObject win32_product
}

$InstalledAppVer = ($InstalledPackages | where {$_.Name -eq $AppName}).version

if (!$InstalledAppVer)
{
Write-Output "Software not found"
exit 1
}
elseif ($InstalledAppVer -eq $AppVersion)
{
Write-Output "Correct version already installed - Exiting"
Exit 0
}
else
{
Write-Output "Installed $AppName version $InstalledAppVer is older than $AppVersion - Updating"
exit 1
}

 

Remediation:

###################################
$AppVersion = "11.2.1.53537"
$AppName = "Foxit PDF Editor"
$InstallerName = "FoxitPDFEditor1121_enu_Setup.msi"
$InstallerArgs = "/norestart /qn TRANSFORMS=FoxitEditor11_x_FCT.mst"
####################################

#Get List of installed Packages
$PSVer = $PSVersionTable.PSVersion
Write-Output "PowerShell Version: $PSVer"
if($PSVer.Major -ge 5)
{
$InstalledPackages = Get-Package
}
else
{
$InstalledPackages = Get-WmiObject win32_product
}

$InstalledAppVer = ($InstalledPackages | where {$_.Name -eq $AppName}).version

if (!$InstalledAppVer)
{
Write-Output "Software not found"
}
elseif ($InstalledAppVer -eq $AppVersion)
{
Write-Output "Correct version already installed - Exiting"
Exit 0
}
else
{
Write-Output "Installed $AppName version $InstalledAppVer is older than $AppVersion - Updating"
}

# Pathing variables
$ScriptDir = split-path $SCRIPT:MyInvocation.MyCommand.Path -parent
$Installer = "$ScriptDir\$InstallerName"

# Installer
Write-Output "Installing $AppName version $AppVersion"
$process = Start-Process -FilePath "$Installer" -ArgumentList "$InstallerArgs" -wait

$exitCode = $process.ExitCode
Write-Output "Exit Code: $exitCode"
Exit $exitCode

 


0 replies

Be the first to reply!

Reply