How to install Leapwork using the command line interface
How to install Leapwork using the command line interface
Introduction
A silent install is the installation of a software program that requires no user interaction. It is a convenient way to streamline the installation process of a desktop application; users can create a custom script using which silent installation of the Leapwork Agent can be performed on multiple machines at once.
Standard command for MSI installation is as follows:
msiexec.exe [MSI COMMAND] [MSI INSTALLER FILE PATH] [MSI COMMAND OPTIONS] [INSTALLER PACKAGE PARAMETERS]
[MSI COMMAND]
- /i -- installation;
- /u -- uninstallation.
[MSI INSTALLER FILE PATH]:
- a (quoted if contains spaces) path to the installer file;
[MSI COMMAND OPTIONS]
- /qn -- quiet/no UI installation;
- /norestart -- no restart;
- /forcerestart -- forced restart;
- /l*v -- enables verbose logging;
[INSTALLER PACKAGE PARAMETERS]: An optional list of the package parameters. It may contain a list of required "features" and other parameters like ports, shortcuts, paths, etc. Any parameter's value should be quoted if contains spaces.
- List of features
- AgentFeature -- the agent;
- ControllerFeature -- the controller;
- StudioFeature -- the studio.
- Properties
- ADDLOCAL -- a comma-separated list of features to be installed. Default: all features;
- List of features
LEAPWORK_AGENT_PORT -- a TCP port to be used by the Agent. Possible values: any valid TCP port. Default: 6777;
LEAPWORK_AGENT_FIREWALLEXCEPTION -- indicates whether to create a rule for the Agent's port in the firewall. Possible values: true/false. Default: true;
LEAPWORK_AGENT_PASSWORD -- a password that secures connection to the Agent. Possible values: any string. Default: empty string;
LEAPWORK_CONTROLLER_PORT -- a TCP port to be used by the Controller. Possible values: any valid TCP port. Default 9000.
LEAPWORK_CONTROLLER_API_PORT – a TCP port for Public REST API endpoints. Possible values: any valid TCP port. Default 9001.
LEAPWORK_CONTROLLER_PASSWORD – initial password for LEAPWORK administrator by default called "admin".
LEAPWORK_CONTROLLER_FIREWALLEXCEPTION -- indicates whether to create a rule for the Controller's port in the firewall. Possible values: true/false. Default: true;
LEAPWORK_ASSETS_DIR -- a path to a folder where all assets will be stored. Possible values: string, any valid path. Default: C:\Program Files\LEAPWORK\Assets;
LEAPWORK_STUDIO_SHORTCUT -- indicates whether to create shortcuts for the Studio on the desktop and in the Start menu. Possible values: true/false. Default: true;
LEAPWORK_LOGS_DIR -- a path to a folder where all application logs will be written. Possible values: string, any valid path. Default: C:\Program Files\LEAPWORK\Logs.
For more information about MSI installation, see Microsoft Command-Line Option 1 and Microsoft Command-Line Option 2.
Enterprise Installation
To install Enterprise version, use the following commands.
msiexec /i "C:\Leapwork_Release_x64_2022.2.700.msi" /qn /norestart /L*V "C:\logs\exampleSilent.log" API_ACCESS_KEY="yYjxcgMdT53ueZOc" LEAPWORK_AGENT_PORT="6777" LEAPWORK_CONTROLLER_PORT="9000" LEAPWORK_CONTROLLER_API_PORT="9001" LEAPWORK_MSSQL_ASSET_DB_NAME="AssetTest" LEAPWORK_MSSQL_REPORT_DB_NAME="ReportTest" LEAPWORK_MSSQL_CONNECTION_TYPE="StandardSecurity" LEAPWORK_MSSQL_INITIAL_CATALOG="master" LEAPWORK_MSSQL_INTEGRATED_SECURITY="SSPI" LEAPWORK_MSSQL_SERVER_ADDRESS="localhost" LEAPWORK_CONTROLLER_PASSWORD="admin" LEAPWORK_MSSQL_USER_NAME="username" LEAPWORK_MSSQL_PASSWORD="password" FORCE_SILENT_ENTERPRISE_INSTALL="true" ADDLOCAL="ControllerFeature,StudioFeature"
Platform Installation
To install Platform, use the following commands.
msiexec /i "C:\Leapwork_Release_x64_2023.1.71.msi" /qn /norestart /L*V"C:\logs\exampleSilent.log" LEAPWORK_CONTROLLER_PASSWORD="admin" LICENSE_KEY="9GNnrdWsiWZG+ZAtUlh2Daykr+H5vLzTeqXSsYXxKTSp6Q4MkkOQMT05txQ/7T1j6xNmIN2kAuYwCPXD6gJ0sYgtQiOda8YNhJEBavBI0/U=" FORCE_SILENT_PLATFORM_INSTALL="true" ADDLOCAL="ControllerFeature,StudioFeature"
Studio and Agent Installation
To install Studio and Agent, use the following commands.
msiexec.exe /i "C:\Share\LEAPWORK_Release_x64_2023.1.71.msi" /qn /norestart /l*V "C:\Share\log.txt" ADDLOCAL=StudioFeature,AgentFeature
Examples
Install command in CMD
Install
- Windows 8 and above, Windows Server 2012 and above:
msiexec.exe /i "path\to\installer.msi" /qn /norestart - Windows 7 and Windows Server 2008 R2:
msiexec.exe /i "path\to\installer.msi" /qn /forcerestart
Install with logs
- Windows 8 and above, Windows Server 2012 and above:
msiexec.exe /i "path\to\installer.msi" /qn /norestart /l*v "path\to\log.txt" - Windows 7 and Windows Server 2008 R2:
msiexec.exe /i "path\to\installer.msi" /qn /forcerestart /l*v "path\to\log.txt"
Install Agent and the Controller
- Windows 8 and above, Windows Server 2012 and above:
msiexec.exe /i "path\to\installer.msi" /qn /norestart /l*v "path\to\log.txt" ADDLOCAL=AgentFeature,ControllerFeature - Windows 7 and Windows Server 2008 R2:
msiexec.exe /i "path\to\installer.msi" /qn /forcerestart /l*v "path\to\log.txt" ADDLOCAL=AgentFeature,ControllerFeature
Install Studio
- Windows 8 and above, Windows Server 2012 and above:
msiexec.exe /i "path\to\installer.msi" /qn /norestart /l*v "path\to\log.txt" ADDLOCAL=StudioFeature - Windows 7 and Windows Server 2008 R2:
msiexec.exe /i "path\to\installer.msi" /qn /forcerestart /l*v "path\to\log.txt" ADDLOCAL=StudioFeature
Install with custom parameters
- Windows 8 and above, Windows Server 2012 and above:
msiexec.exe /i "path\to\installer.msi" /qn /norestart /l*v "path\to\log.txt" LEAPWORK_AGENT_PORT=5432 LEAPWORK_LOGS_DIR="C:\some folder\some subfolder\log.txt" - Windows 7 and Windows Server 2008 R2:
msiexec.exe /i "path\to\installer.msi" /qn /forcerestart /l*v "path\to\log.txt" LEAPWORK_AGENT_PORT=5432 LEAPWORK_LOGS_DIR="C:\some folder\some subfolder\log.txt"
Uninstall command in CMD
- Windows 8 and above, Windows Server 2012 and above:
msiexec.exe /x "path\to\installer.msi" /qn /norestart - Windows 7 and Windows Server 2008 R2:
msiexec.exe /x "path\to\installer.msi" /qn /forcerestart
Note: Windows 7 and Windows Server 2008 requires a restart after installation which can be done manually or by adding the restart command in your command line script.