Created
March 9, 2022 16:56
-
-
Save wise-io/8c8f4aabd820666df372cce0936c9fcf to your computer and use it in GitHub Desktop.
Installs Foxit Reader Silently
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Installs Foxit Reader Enterprise | |
# Register here: https://www.foxit.com/pdf-reader/enterprise-register.html | |
param( | |
[switch]$Default # Attempt to set Foxit as the default PDF reader | |
) | |
$Installer = "$env:temp\FoxitReaderSetup.msi" | |
$DownloadURL = 'https://www.foxit.com/downloads/latest.html?product=Foxit-Enterprise-Reader&platform=Windows&package_type=msi&language=English' | |
if ($Default) { $DefaultValue = 1 } else { $DefaultValue = 0 } | |
# Installer Arguments | |
$ArgumentList = @( | |
'/i', | |
"$Installer", | |
'/quiet', | |
"MAKEDEFAULT=$DefaultValue", | |
'DESKTOP_SHORTCUT=0', | |
"LAUNCHCHECKDEFAULT=$DefaultValue", | |
'AUTO_UPDATE=2', | |
'DISABLE_UNINSTALL_SURVEY=1' | |
) | |
try { | |
# Download Installer | |
Invoke-WebRequest -Uri $DownloadURL -OutFile $Installer | |
# Install Program | |
Start-Process -Wait msiexec -ArgumentList $ArgumentList | |
} | |
catch { throw } | |
finally { | |
# Remove Installer | |
Remove-Item $Installer -Force -ErrorAction Ignore | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment