Using batch file to automate silent installation
In practice, there are occasions where you might need to write and schedule a batch (.bat) file to automate the tasks of silent TestArchitect uninstallation and installation. This topic shows a basic template to follow.
Ensure that the following requirements are met:
Be familiar with silent installation and uninstallation.
Create installation and uninstallation response files.
Back up abt.ini and automation.ini from the computer creating the response files.
Note:- abt.ini stores information such as, repository server, license server, such as, automation harness. Location:
- C:\Users\Public\LogiGear\TestArchitect\controller
- C:\Users\Public\LogiGear\TestArchitect\Data
- C:\Users\Public\LogiGear\TestArchitect\LicenseServer
- C:\Users\Public\LogiGear\TestArchitect\RS
- automation.ini store automation information. Location: C:\Users\Public\LogiGear\TestArchitect\Data
- abt.ini stores information such as, repository server, license server, such as, automation harness. Location:
Assign TestArchitect version to the following variables
For example, enter the code lines below.
set ta_version=TestArchitect_8.3.0.145_x64.exe
Terminate all TestArchitect-related processes, if running.
Enter the code lines below.
taskkill /IM TAControllerGUI.exe /F /T taskkill /IM TAController.exe /F /T taskkill /IM TAClient.exe /F /T taskkill /IM TARegisterServer.exe /F /T taskkill /IM tars.exe /F /T taskkill /IM TARepository.exe /F /T taskkill /IM TestArchitectHelp.exe /F /T
Uninstall previously installed TestArchitect by entering the following command.
<UninstallString value> /s /f1<path_to_response_file>\<respone_file>.iss /f2<path_to_log_file>\<log_file>.log
(Learn more.)Note:If you do not installTestArchitect yet, proceed to step #6.For example, enter the code line below.
echo Uninstall TA "C:\Program Files (x86)\InstallShield Installation Information\{5036B92D-2051-46CA-AF28-9097F8F97E63}\setup.exe" -runfromtemp -l0x0409 -removeonly /s /f1"\\PC01\Silent installation\uninstall.iss" /f2"\\PC01\Silent installation\uninstall.log"
Where:
- UninstallString value:
"C:\Program Files (x86)\InstallShield Installation Information\{5036B92D-2051-46CA-AF28-9097F8F97E63}\setup.exe" -runfromtemp -l0x0409 -removeonly
- Shared path to the response file: \\PC01\Silent installation\uninstall.iss
- Shared path to the log file over your network: \\PC02\Silent installation\uninstall.log
- UninstallString value:
Wait until InstallShield of uninstallation process is closed.
Enter the code lines below.
:loop tasklist /fi "imagename eq setup.exe" |find ":" > nul if errorlevel 1 goto loop
Wait until uninstallation is done.
Enter the code line below.
ping 127.0.0.1 -n 31 > nul
Begin to install a newer version of TestArchitect by entering the following command.
<path_to_installation_file>\<TestArchitect_installation_file.exe> /s /f1<path_to_response_file>\<respone_file>.iss /f2<path_to_log_file>\<log_file>.log
(Learn more.)For example, enter the code line below.
echo Install TA "\\computerone\Silent installation\TestArchitect Build\%ta_version%" /s/ /f1"\\computerone\Silent installation\Silent files\install.iss" /f2"\\computerone\Silent installation\Silent files\install.log"
Where:
- Shared path to the executable TestArchitect installation file over your network: \\computerone\Silent installation\TestArchitect Build\%ta_version%
- Shared path to the response file: \\computerone\Silent installation\Silent files\install.iss
- Shared path to the log file over your network: \\computerone\Silent installation\Silent files\install.log
Wait until installation is done.
Enter the code line below.
ping 127.0.0.1 -n 31 > nul
Copy abt.ini and automation.ini from the original computer, which created response files, into the computer that has just installed TestArchitect.
abt.ini’s location:
C:\Users\Public\LogiGear\TestArchitect\controller
C:\Users\Public\LogiGear\TestArchitect\Data
C:\Users\Public\LogiGear\TestArchitect\LicenseServer
C:\Users\Public\LogiGear\TestArchitect\RS automation.ini’s location:
C:\Users\Public\LogiGear\TestArchitect\Data
Note:Remember to copy exact abt.ini and automation.ini to the same folders as the original computer on the target machine (physical machines, cloud instances, virtual machines, etc.)
For example, enter the code lines below:
echo Copy abt.ini copy /y "\\computerone\Silent installation\TestArchitect\controller\abt.ini" "C:\Users\Public\LogiGear\TestArchitect\controller" copy /y "\\computerone\Silent installation\TestArchitect\Data\abt.ini" "C:\Users\Public\LogiGear\TestArchitect\Data" copy /y "\\computerone\Silent installation\TestArchitect\LicenseServer\abt.ini" "C:\Users\Public\LogiGear\TestArchitect\LicenseServer" copy /y "\\computerone\Silent installation\TestArchitect\RS\abt.ini" "C:\Users\Public\LogiGear\TestArchitect\RS" echo Copy automation.ini copy /y "\\computerone\Silent installation\TestArchitect\Data\automation.ini" "C:\Users\Public\LogiGear\TestArchitect\Data"
Overall, the snippet of code should resemble the following:
@echo off
:: TA build version to be removed
set current_ta_version=TestArchitect_8.3.0.143_x64.exe
:: TA build version to be installed
set ta_version=TestArchitect_8.3.0.145_x64.exe
:: Kill all TA processes
taskkill /IM TAControllerGUI.exe /F /T
taskkill /IM TAController.exe /F /T
taskkill /IM TAClient.exe /F /T
taskkill /IM TARegisterServer.exe /F /T
taskkill /IM tars.exe /F /T
taskkill /IM TARepository.exe /F /T
taskkill /IM TestArchitectHelp.exe /F /T
:: Unistall TA
echo Uninstall TA
"C:\Program Files (x86)\InstallShield Installation Information\{5036B92D-2051-46CA-AF28-9097F8F97E63}\setup.exe"
-runfromtemp -l0x0409 -removeonly
/s /f1"\\PC01\Silent installation\uninstall.iss" /f2"\\PC01\Silent installation\uninstall.log"
:: Wait until InstallShield is closed
:loop
tasklist /fi "imagename eq setup.exe" |find ":" > nul
if errorlevel 1 goto loop
:: Wait until Uninstallation completes
ping 127.0.0.1 -n 31 > nul
:: Install TA
echo Install TA
"\\computerone\Silent installation\TestArchitect Build\%ta_version%"
/s/ /f1"\\computerone\Silent installation\Silent files\install.iss"
/f2"\\computerone\Silent installation\Silent files\install.log"
:: Wait until Installation completes
ping 127.0.0.1 -n 31 > nul
::Copy abt.ini to target computer
echo Copy abt.ini files
copy /y "\\computerone\Silent installation\TestArchitect\controller\abt.ini" "C:\Users\Public\LogiGear\TestArchitect\controller"
copy /y "\\computerone\Silent installation\TestArchitect\Data\abt.ini" "C:\Users\Public\LogiGear\TestArchitect\Data"
copy /y "\\computerone\Silent installation\TestArchitect\LicenseServer\abt.ini" "C:\Users\Public\LogiGear\TestArchitect\LicenseServer"
copy /y "\\computerone\Silent installation\TestArchitect\RS\abt.ini" "C:\Users\Public\LogiGear\TestArchitect\RS"
::Copy automation.ini to target computer
echo Copy automation.ini
copy /y "\\computerone\Silent installation\TestArchitect\Data\automation.ini" "C:\Users\Public\LogiGear\TestArchitect\Data"