How to Automate FileZilla Pro Installation with PowerShell

You can automate the installation and uninstallation and also the registration and deregistration of FileZilla Pro on Windows using PowerShell scripts.

The PowerShell script below installs and registers FileZilla Pro:

Note: The script expects the installation file to be in the same directory as the script.

# install.ps1
# Install and register FileZilla Pro

$FileZillaProInstallPath = Join-Path -Path $PSScriptRoot -ChildPath “FileZilla_Pro_3.
˓→69.1_win64-setup.exe”

# Silent install
$Process = Start-Process -FilePath $FileZillaProInstallPath -ArgumentList “/S /
˓→ user=all” -PassThru -Wait

if ($Process.ExitCode -eq 0) {

    Write-Host “Installation successful, registering…”

    $registrationKey = “XXXX-XXXX-XXXX-XXXX-XXXX”

    Start-Process -FilePath “C:\Program Files\FileZilla Pro\FileZilla.exe”

˓→ArgumentList “–register –regkey=silent,$registrationKey” -Wait
}
else {

    Write-Host “Installation failed”

}

The PowerShell script below deregisters and uninstalls FileZilla Pro.

Note: The script expects FileZilla Pro to be installed in the standard location under C:\Program Files\
FileZilla Pro
.

# uninstall.ps1
# Unregister and uninstall FileZilla Pro

$registrationKey = “XXXX-XXXX-XXXX-XXXX-XXXX”

Start-Process-FilePath “C:\Program Files\FileZilla Pro\FileZilla.exe”-ArgumentList
˓→ “–deregister –regkey=$registrationKey” -Wait

Start-Process -FilePath “C:\Program Files\FileZilla Pro\uninstall.exe” -ArgumentList
˓→ “/s”-Wait -Verb RunAs

The scripts can be manually launched from the PowerShell prompt, for example:

.\install.ps1

Or as parameter to powershell.exe, for example, for Windows Intune:

powershell.exe -ExecutionPolicy Bypass -File .\install.ps1

Tags: ,