As the Flow Installer is a Microsoft Software Installer file., we can use the common MSI command to silently install or upgrade an existing Flow installation.
The MSI command can be executed from a command prompt or even from a batch script.
Certain parameters can be specified against the msiexec command to make the installation silent. This means that there will be no GUI interface to drive the installation procedure - all will be handled by the default options.
See an example command below for a silent install without restarting the node after the installation is complete:
msiexec /i <LocationOfTheMSIInstaller> /quiet /qn /norestart
The parameters provided are:
- /i - specifies a normal installation
- /quiet /qn - The installer will not present any GUI/pop-up during the installation process
- /norestart - Denotes not to restart the node after the installation procedure is complete.
The entire process can also be executed in a .bat script. An example of this script is provided below. This script will only run the install process and do an upgrade if the current version is not the same as the installer. Also, as per best practice, the script will stop the Flow Bootstrap Service before executing the installer.
Please ensure all config tools are also closed before executing this script.
The script takes 3 arguments:
- Location of the Flow Config tool to understand the current version installed. In the example, the default location of the Config tool is specified (C:\Program Files\Flow Software\Flow\Config\Flow Config.exe)
- Location of the MSI file. In the example, the MSI (i.e., the Flow Installer file) path is C:\Flow RC 7.0.2463.370.msi
- Version to be installed. In the example, version 7.0.2 is being installed.
C:\> SilentFlowInstaller.bat "C:\Program Files\Flow Software\Flow\Config\Flow Config.exe" "c:\Flow RC 7.0.2463.370.msi" "7.0.2"
@echo off
setlocal enableextensions
set "file=%~1"
if not defined file goto :eof
if not exist "%file%" goto :eof
set "msi=%~2"
if not defined msi goto :eof
if not exist "%msi%" goto :eof
set "newVersion=%~3"
if not defined newVersion goto :eof
set "vers="
FOR /F "tokens=2 delims==" %%a in ('
wmic datafile where name^="%file:\=\\%" get Version /value
') do set "vers=%%a"
Rem echo(%file% = %vers:.=%
Rem echo %newVersion:.=%
set var1=%vers:~0,5%
set var2=%newVersion:~0,5%
set var3=%var1:.=%
set var4=%var2:.=%
echo Current Version is: %var3%
echo New Version is: %var4%
if %var4% == %var3% goto E if NOT goto I
:I
echo stopping Flow Bootstrap Service
NET STOP "Flow Bootstrap"
echo Flow Bootstrap Service Stopped
echo Installing
msiexec /i "%msi%" /quiet /qn /norestart
echo Installing Done!
goto :eof
:E
echo The version you are trying to install is the same version.
goto :eof
endlocal
Note: If any non-default files are placed in the Flow installation locations, the installer will provide a pop-up stating "not all files could be replaced by the installer". This dialog must be confirmed for the installation to complete. To prevent this behavior, do not store other files in the Flow installation locations.
Code below: