Silent Installation - AskiaField
What is a "silent installation"?
A silent installation is when an application is installed to a user’s computer without any dialogs or user input. This means that once the installation starts, the user is not offered any options to change or edit the configuration of the installation process. Silent installations are useful for uniformity, as it helps to ensure all users have the same installation configuration.
Prerequisites:
Grab the latest AskiaField installers from here: https://installers.askia.com/helpdesk/askiafield/
"Field" refers to our Supervisor and CATI applications.
The .inf and .reg files shown below are attached at the bottom of this article.
⚠️Please ensure the .exe is "unblocked" prior to running the silent installation:
-
.exe > Right-Click > Properties > Unblock > OK
⚠️Please ensure the user you're running the silent installation as has full read/write access on the following directories:
-
\%AppData%\Roaming\Askia\
-
\%\Program Files%\Askia\
-
\%Program Files (x86)%\Askia\
-
%\ProgramData%\Askia\
⚠️Please ensure the .bat Command Prompt script is running as an "Administrator".
Silently installing AskiaField (Supervisor and CATI) applications:
A silent installation of CATI and/or Supervisor needs to be done in four phases.
Phase 1
Generate your own .inf file that includes all setup parameters (or download the attached .inf).
Run Setup.exe /SAVEINF="C:\Users\%username%\Desktop\SupervisorSetup.inf"
(or "CatiSetup.inf") to generate your own .inf file.
Below are the standard .inf configuration settings. In most circumstances, you should only need to change the "Lang" setting from "en" to "fr", depending on your desired language. Everything else can stay the same.
⚠️It is important to not use the "configure CATI now" ("configure_cati") or "configure Supervisor now" ("configure_supervisor") options in the "Tasks" section of the .inf, as that will result in errors during unattended silent installation.
Instead, you need to add the relevant configuration options to the Windows registry before starting the setup. This is where Phase 2 comes into play.
CatiSetup.exe /saveinf="C:\Users\%username%\Desktop\CatiSetup.inf" -->
[Setup]
Lang=en
Dir=C:\Program Files (x86)\AskiaField
Group=Askia
NoIcons=0
SetupType=full
Components=program_files_unicode,askiaclient_unicode,help_files_chm
Tasks=autostart_never
SupervisorSetup.exe /saveinf="C:\Users\%username%\Desktop\SupervisorSetup.inf" -->
[Setup]
Lang=en
Dir=C:\Program Files (x86)\AskiaField
Group=Askia
NoIcons=0
SetupType=full
Components=program_files_unicode,help_files_chm
Phase 2
Generate your own .reg file that includes all necessary setup parameters (or download the attached .reg).
On a computer where Supervisor and/or CATI are already configured, open "RegEdit.exe" and navigate to the following locations:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Peter Holmes\Supervisor\Settings
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Peter Holmes\Cati\Settings
Right-click on the "Settings" folder and choose to "Export" the entries to a .reg file.
Below are the standard .reg configuration settings. In most circumstances, you should only need to change the "RemoteHost", "RemotePortNr", and "LatestInstalledSetup" keys. Everything else can stay the same.
CATI:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Peter Holmes\Cati\Settings]
"LatestInstalledSetup"="5.5.3.1037"
"H323ErrorsToSuppress"=""
"AskiaPath"="C:\\Program Files (x86)\\AskiaField\\AskiaClient\\AskiaClient.exe"
"RemoteHost"="127.0.0.1"
"RemotePortNr"=dword:00000385
"Location"=dword:00000000
Supervisor:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Peter Holmes\Supervisor\Settings]
"RemoteHost"="127.0.0.1"
"RemotePortNr"=dword:00000387
"Location"=dword:00000000
"ShowNTAccount"=dword:00000001
"NewObjectDepth"=dword:00000005
"WindowProfile"=dword:00000000
"CallbackOption"=""
"StatsDatabase"=""
"MainDatabase"=""
"PreDefMessage"=""
"AppointmentSpan"=dword:0000001e
"ReportUseAccess"=dword:00000000
"LatestInstalledSetup"="5.5.3.1038"
⚠️Some comments about the registry entries shown above:
- "LatestInstalledSetup" should be set to the same version as indicated in the filename of the setup.exe
- "RemoteHost" and "RemotePortNr" are the CCA IP and Port
Default Supervisor Port = 903 (dword:00000387)
Encrypted Supervisor Port = 1903 (dword:0000076f)
Default CATI Port = 901 (dword:00000385)
Encrypted Cati Port = 1901 (dword:0000076d) - For CATI: "Location" can be set to "dword:00000000", which is equivalent to using the "ask at each start" option. You can also set it to contain a location ID corresponding to a specific location, or the value "ffffffff" to let CCA/CTArchitect decide
Phase 3
Once you have the .reg created, you can use the below Command Prompt script to import it into the Windows Registry on the new computer:
REG IMPORT "C:\Users\%username%\Desktop\SupervisorRegSettings.reg"
REG IMPORT "C:\Users\%username%\Desktop\CatiRegSettings.reg"
Or you can simply double-click on the .reg file and Windows will prompt you to import into the Windows Registry.
⚠️Importing a .reg file into the user's Registry may require Administrator privileges to complete.
Phase 4
Once you have the .inf file configured to your liking, and the .reg file has been successfully imported into the Windows Registry on the new PC, you can then run the silent installer using the following .bat script:
CATI:
@ECHO OFF
SET OriginalFieldExeName=[Askia] CATI-Setup v5.5.3.1037.exe
SET FieldExe=CATI-Setup.exe
SET myDir=C:\Users\%username%\Desktop
SET myReg=CatiRegSettings.reg
SET myInf=CatiSetup.inf
CD %myDir%
REG IMPORT "%myDir%\%myReg%"
COPY "%OriginalFieldExeName%" "%FieldExe%"
START /WAIT %FieldExe% /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /LOADINF="%myDir%\%myInf%" /LOG="%myDir%\InstallCATI.log"
ECHO Installation of CATI is complete..
ECHO Please check the "InstallCATI.log" for further details..
PAUSE
Supervisor:
@ECHO OFF
SET OriginalFieldExeName=[Askia] Supervisor-Setup v5.5.3.1038.exe
SET FieldExe=Supervisor-Setup.exe
SET myDir=C:\Users\%username%\Desktop
SET myReg=SupervisorRegSettings.reg
SET myInf=SupervisorSetup.inf
CD %myDir%
REG IMPORT "%myDir%\%myReg%"
COPY "%OriginalFieldExeName%" "%FieldExe%"
START /WAIT %FieldExe% /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /LOADINF="%myDir%\%myInf%" /LOG="%myDir%\InstallSupervisor.log"
ECHO Installation of Supervisor is complete..
ECHO Please check the "InstallSupervisor.log" for further details..
PAUSE
⚠️For simplicity, the above .bat script automatically imports the .reg files into the Windows Registry, and then makes a renamed copy of the original "[Askia]" Setup.exe - this is to remove all special characters from the file name, because the square brackets escape the Command Prompt script.
More info:
⚠️Our Field .exe installers are compiled and packaged using a tool called "Inno Setup". You can read through their help center here: https://jrsoftware.org/ishelp/index.php?topic=setupcmdline
The Supervisor or CATI setup executables can be run in Command Prompt with the "/help" command which will display the following prompt with all available CLI parameters:
/SP-
Disables the “This will install... Do you wish to continue?” prompt at the beginning of Setup.
/SILENT, /VERYSILENT
Instructs the Setup to be silent or very silent.
When Setup is silent, the wizard and the background window are not displayed but the installation progress window is.
When a setup is very silent the installation progress window is not displayed. Everything else is normal. For example error messages during installation are displayed and the startup is prompt (if you haven't disabled it with the '/SP-' command line option explained above)
If a restart is necessary and the '/NORESTART' command isn't used (see below) and Setup is silent, it will display a Reboot now? message box. If it's very silent it will reboot without asking.
/SUPPRESSMSGBOXES
Instructs the Setup to suppress message boxes.
Only has an effect when combined with '/SILENT' and '/VERYSILENT'.
The default response in situations where there's a choice is:
- “Yes” in Keep newer file? situation.
- “No” in a File exists, confirm overwrite situation.
- “Abort” in Abort/Retry situations.
- “Cancel” in Retry/Cancel situations.
- “Yes” (=continue) in DiskSpaceWarning, DirExists, DirDoesntExist, NoUninstallWarning, ExitSetupMessage and ConfirmUninstall situation.
- “Yes” (=restart) in FinishedRestartMessage/UninstalledAndNeedsRestart situation.
5 message boxes are not suppressible:
- The About Setup message box.
- The Exit Setup? message box.
- The FileNotInDir2 message box displayed when Setup requires a new disk to be inserted and the disk was not found.
- Any (error) message box displayed before Setup (or Uninstall) could read the command line parameters.
- Any message box displayed by [Code] support function MsgBox.
/NOCANCEL
Prevents the user from cancelling during the installation process, by disabling the cancel button and ignoring clicks on the close button. Useful along with '/SILENT' or '/VERYSILENT'.
/NORESTART
Instructs the Setup to do not reboot even if it's necessary.
/DIR="x:\dirname"
Overrides the default directory name displayed on the Select Destination Location wizard page.
A fully qualified pathname must be specified.
/NOICONS
Instructs Setup to initially check the Don't create any icons check box on the Select Start Menu Folder wizard page.
/LANG=en/fr/cz
Specifies the language to use.
When a valid /LANG parameter is used, the Select Language dialog will be suppressed.
Valid languages (depending on the setup): en, fr, cz.
Silently uninstalling AskiaField:
https://jrsoftware.org/ishelp/index.php?topic=uninstcmdline
CATI:
"C:\Program Files (x86)\AskiaField\CATI\unins000.exe" /SILENT /VERYSILENT /SUPPRESSMSGBOXES /SP- /Log="C:\Users\%username%\Desktop\UninstallCati.log"
Supervisor:
"C:\Program Files (x86)\AskiaField\unins000.exe" /SILENT /VERYSILENT /SUPPRESSMSGBOXES /SP- /Log="C:\Users\%username%\Desktop\UninstallSupervisor.log"