Installing Gen Windows PTFs in silent/unattended mode
search cancel

Installing Gen Windows PTFs in silent/unattended mode

book

Article ID: 216266

calendar_today

Updated On:

Products

Gen - Workstation Toolset Gen Gen - Host Encyclopedia Gen - Run Time Distributed

Issue/Introduction

It is required to create an automatic unattended process to install CA Gen 8.6 Toolset for Windows and its PTFs.
The base product install has a silent/unattended option, but the PTFs do not e.g. installation of Gen 8.6 Complete PTF WKS86200 requires user input 'I' (to install).
Is there any way to install PTFs in silent mode, without any user input? 

Environment

Release : 8.6

Component : CA Gen General Misc. Questions

Resolution

There is no official option to install Gen Windows PTFs in silent mode.
Support has run these custom steps which have been successful:

1. Execute self-extracting zip file WKS86200.EXE to unzip the files:
WKS86200README.txt
WKS86200Z.exe

2. Do not execute self-extracting WKS86200Z.exe (to avoid it automatically running the setup.bat file)
Instead, open it with a zip file utility like 7-Zip or WinZip and extract the 4 files:
setup.bat
uninstall.bat
WKS86200A.exe
WKS86200.ctl

3. Take a backup copy of setup.bat and name it setup_custom.bat.
Edit setup_custom.bat and make 2 changes:
a. Stop the prompt for "(I) Install, (Q) Quit"
In section ":request_action_make_choice_setup"
CHANGE:
   set /p choice_entered=[I,Q]?
TO:
   set choice_entered=I
b. Comment out the pause before "press any key to exit"
In section ":self_delete"
CHANGE:
pause > nul | echo press any key to exit
TO:
REM pause > nul | echo press any key to exit

4. Then run setup_custom.bat.

5. The package of the 4 files could then be distributed to all users:
setup_custom.bat
uninstall.bat
WKS86200A.exe
WKS86200.ctl

Additional Information

NOTES:
1. As this is not an official solution it is recommended to take a backup of the Gen 8.6 install directory "C:\Program Files (x86)\CA\Gen86" (%Gen86%) before testing the PTF install using the above steps.

2. After the PTF install the "C:\Program Files (x86)\CA\Gen86\PTF_Backups" directory will contain an updated PTF_maintenance.log and the sub-directory WKS86200.BAK will contain log file WKS86200.log.

3. The same steps can be used for any PTF i.e. in all the above steps just substitute string WKS86200 with the PTF name.

4. Gen 8.6 silent/unattended install steps are documented here: CA Gen 8.6 > Installing > Install CA Gen on Windows > Installing CA Gen on the Windows Platform > Silently Install CA Gen Product Software

5. Some problems have been reported with the PTF silent install failing after the product silent install because the new Gen86 environment variable created by the product install is not being picked up (message is "GEN86% is not defined"). An existing command prompt (cmd.exe) won't pick up any of the new Gen 8.6 environment variables, but a new instance started after the install should.
However, support ran some tests on Windows 10 and also found some problems with a new instance of cmd.exe also not always picking up the new Gen 8.6 related environment variables. From reading the web a Windows Explorer session is supposed to pick up the environment variable changes automatically, but the behaviour can be somewhat unpredictable for new cmd.exe instances depending on how they are started.
The most reliable solution is to use a script named RefreshEnv.cmd which is available from GitHub here:
https://github.com/chocolatey/choco/blob/master/src/chocolatey.resources/redirects/RefreshEnv.cmd
That will refresh all current environment variables in the current cmd.exe instance
So a sequence of silent install followed by RefreshEnv.cmd will then allow the silent PTF install to be executed successfully, all in the same cmd.exe instance.

In the following example:
a. Gen 8.6 install media for Windows file DVD03145911E.iso is in directory C:\temp and has been extracted to directory C:\temp\DVD03145911E, so the msi file and the other required install files it uses are in directory C:\temp\DVD03145911E\Gen.
b. The file run_silent_install_all.cmd contains the single line:
msiexec /i "CA Gen 8.6.msi" ADDLOCAL=ALL /qn
c. C:\temp\WKS86200 is the directory containing the WKS86200 files (setup_custom.bat, uninstall.bat, WKS86200A.exe, WKS86200.ctl) and RefreshEnv.cmd


Steps to run:
C:\>cd C:\temp\DVD03145911E\Gen
C:\temp\DVD03145911E\Gen>run_silent_install_all.cmd
C:\temp\DVD03145911E\Gen>cd C:\temp\WKS86200
C:\temp\WKS86200>RefreshEnv.cmd
C:\temp\WKS86200>setup_custom.bat

I tested those steps per below with additional environment variable checks at the different stages using set and find commands:
+++
C:\temp\DVD03145911E\Gen>run_silent_install_all.cmd

C:\temp\DVD03145911E\Gen>msiexec /i "CA Gen 8.6.msi" ADDLOCAL=ALL /qn

C:\temp\DVD03145911E\Gen>set |find /i "gen86"

C:\temp\DVD03145911E\Gen>cd C:\temp\WKS86200

C:\temp\WKS86200>RefreshEnv.cmd
Refreshing environment variables from registry for cmd.exe. Please wait...Finished..

C:\temp\WKS86200>set |find /i "gen86"
Gen86=C:\Program Files (x86)\CA\Gen86\
Gen86JRE=C:\Program Files (x86)\CA\SharedComponents\JRE\1.8.0_60\
IEFH=C:\Program Files (x86)\CA\Gen86\GEN
Path=c:\Program Files (x86)\CA\SC\CAWIN\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;c:\Program Files (x86)\CA\SC\Csam\SockAdapter\bin;c:\Program Files (x86)\CA\DSM\bin;c:\Program Files (x86)\CA\SC\CBB\;c:\PROGRA~2\CA\SC\CAM\bin;C:\utilities;C:\utilities\gnu_utils;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\ibm\gsk8\lib64;C:\Program Files (x86)\ibm\gsk8\lib;c:\Program Files (x86)\CA\SC\Csam\SockAdapter\bin64;C:\Program Files (x86)\ooRexx;C:\Program Files\dotnet\;C:\Program Files (x86)\CA\Gen86\Gen\;C:\Program Files (x86)\CA\Gen86\Client\;C:\Program Files (x86)\CA\Gen86\CSE\bin;C:\Program Files (x86)\CA\Gen86\;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;
Path_HKLM=c:\Program Files (x86)\CA\SC\CAWIN\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;c:\Program Files (x86)\CA\SC\Csam\SockAdapter\bin;c:\Program Files (x86)\CA\DSM\bin;c:\Program Files (x86)\CA\SC\CBB\;c:\PROGRA~2\CA\SC\CAM\bin;C:\utilities;C:\utilities\gnu_utils;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\ibm\gsk8\lib64;C:\Program Files (x86)\ibm\gsk8\lib;c:\Program Files (x86)\CA\SC\Csam\SockAdapter\bin64;C:\Program Files (x86)\ooRexx;C:\Program Files\dotnet\;C:\Program Files (x86)\CA\Gen86\Gen\;C:\Program Files (x86)\CA\Gen86\Client\;C:\Program Files (x86)\CA\Gen86\CSE\bin;C:\Program Files (x86)\CA\Gen86\

C:\temp\WKS86200>setup_custom.bat

______________________________________________________________________________

                CA Gen Windows PTF procedure for WKS86200

This procedure will install PTF WKS86200.

An Install will copy and/or provide new files that have been delivered in
this PTF. Original copies of these files will be backed up under a matching
PTF subdirectory under the PTF_Backups directory.

A log file will exist in the PTF subdirectory under the PTF_Backups directory
that will detail the activities that occurred as a result of the install
of the PTF.  Also note that a master log file will reside in the PTF_Backups
directory that list a summary of all PTF activity.

______________________________________________________________________________

NOTE: Before installation or backout, please ensure that all Gen
      applications and utilities have been stopped.

Please select one of the following actions for this PTF maintenance:

(I) Install
(Q) Quit


Performing Install of WKS86200...

Installation Directory C:\Program Files (x86)\CA\Gen86 will be used for this PTF.
................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
PTF WKS86200 has been successfully applied.

Any original files replaced by this PTF have been moved to the WKS86200.BAK
directory under C:\Program Files (x86)\CA\Gen86\PTF_Backups.
To back out this PTF, run the uninstall.bat file in the directory
{install_dir}\PTF_Backups\WKS86200.BAK and select 'Backout'.

C:\temp\WKS86200>
+++