Run Book for NSS Installation Script
Introduction
Over View:
This document contains the instructions to execute an error-free, installation script which
has initially been designed to simplify the automation of an installation without having to
write, compile and debug code. It has been observed to provide several additional benefits:
Sequence multiple installations.
Standardize logging and error handling for each of the actions performed.
Support for Windows Installer (MSI), InstallShield, executable, and script based
installations.
Performs several processes mandatory for application packaging, such as, ProcessKill,
Creating and Deleting Registry, File Folder etc.
Work Instructions Scope
The purpose of the document is to provide instructions related to the usage of the script. It
is expected that the users will save time and increase accuracy considerably.
Script Description
The beginning of the Script contains file system objects and variables that are declared.
This particular section of the script should not be modified. Modification of this section will
affect the functionality of the script.
The “Registry stamping data” section of the script contains data that has to be updated
according to every application.
They include the following data:
ApplicationActualName = ""
licenseSupplier = ""
manufacturerName = ""
applicatonVersion = ""
supplierID = ""
bit = ""
exeName = ""
Before the install section begins, Log File is created. The Log File Creation is taken care of
by the script in the specific location. (Windowsdir & "\NSSAppLogs\" &
manufacturerName & "\"& ApplicationActualName &"\")
LogFileOpening
Install Section :
The install section of the script contains all the processes necessary for application
packaging. It includes processes such as the following :
ProcessKill
InstallMSI
InstallMSID (D Drive)
InstallMST
InstallMSTD (D Drive)
UninstallMSI
RunExe (Without parameters)
RunExe (With parameters)
InstallISS (InstallShieldResponse File)
FileCopy
FolderCopy
DeleteFile
DeleteFolder
RunVbs
AddReg
Delreg
set_Regstamp
ProcessKill:
ProcessKill is used for the termination of a specified process. It is used when a
process that hinders the installation or uninstallation of an application has to be forcefully
terminated.
Syntax:
ProcessKill("Process Name")
Parameters:
Process Name is the title of the process that has to be terminated. Process Name is the
name of the exe without their full path. For instance: [Link] , [Link] etc.
Examples:
ProcessKill("[Link]")
ProcessKill("[Link]")
ProcessKill("[Link]")
ProcessKill("[Link]")
InstallMSI:
The InstallMSI process is used for the silent installation of an MSI.
Syntax:
call InstallMSI("MSIPath")
Parameters:
MSIPath is the full path of the MSI that has to be installed.
Examples:
call InstallMSI(ScriptPath & "\[Link]")
InstallMSID:
The InstallMSI process is used for the silent installation of an MSI in D drive .
Syntax:
call InstallMSID("MSIPath" , "Installation directory property" , "Installation directory
path")
Parameters:
MSIPath denotes the full path of the MSI that has to be installed.
Installation directory property denotes the directory property , for example ,
“INSTALLDIR”
Installation directory path denotes the complete path of the directory property
Examples:
call InstallMSID(ScriptPath & "\[Link]" , "INSTALLDIR" ,"D:\Program Files\
Java\jdk1.7.0\")
InstallMST:
InstallMST process is used for the silent installation of an MSI with its transforms.
Syntax:
Call InstallMST("MSIPath" , "MSTPath")
Parameters:
MSIPath and MSTPath denote the complete path of the MSI and its Transform.
Examples:
Call InstallMST(ScriptPath & "\ CiscoVPNClient \Cisco_VPNClient_5.[Link]",ScriptPath & "\
CiscoVPNClient \FW-Cisco-VPN [Link]")
InstallMSTD:
InstallMST process is used for the silent installation of an MSI with its transforms for
D Drive.
Syntax:
Call InstallMST("MSIPath" , "MSTPath" , "Installation directory property" ,
"Installation directory path")
Parameters:
MSIPath and MSTPath denote the complete path of the MSI and its Transform.
Installation directory property denotes the directory property , for example ,
“INSTALLDIR”
Installation directory path denotes the complete path of the directory property
Examples:
Call InstallMSTD(ScriptPath & "\Citrix_DesktopReceiver_11.[Link]",ScriptPath & "\FW-
Citrix-Citrix Desktop [Link]", "CITRIX_DIR" ,"D:\Program Files\Citrix\")
UninstallMSI:
UninstallMSI is used for the silent uninstallation of an MSI using its product code.
Syntax:
Call UninstallMSI("ProductCode")
Parameters:
ProductCode of MSI that has to be uninstalled.
Examples:
Call UninstallMSI("{518487D9-7D70-41D7-8292-1105E47A1145}")
RunExe: (Without parameters)
The RunEXE action launches an executable file and waits for it to complete.
Syntax:
Call RunExe(“Exepath")
Parameters:
Exepath is the path of the exe that has to be executed.
Examples:
Call RunExe(ScriptPath & "\[Link]")
RunExe: (With parameters)
The RunEXE action launches an executable file and waits for it to complete. Command line
parameters can be passed to the EXE file.
Syntax:
Call RunExeWithParam(“Exepath" ,"parameter")
Parameters:
Parameter is the switch that can be passed along with the exe.
Examples:
Call RunExeWithParam(Windowsdir & "\System32\[Link]" ,"/c")
Call RunExeWithParam(ScriptPath & "\[Link]" ,"-q" )
InstallISS:
InstallShield Setup files can be installed using response file using InstallISS.
Syntax:
Call InstallISS("EXEPath" , "ISSPath")
Parameters:
EXEPath is the path of the InstallShield [Link]
ISSPath is the path of the InstallShield response file.
Examples:
Call InstallISS(ScriptPath &"\iss\Package\erdpro\[Link]",ScriptPath &"\iss\Package\
Install_C.iss")
FileCopy:
FileCopy copies a file to a specified destination.
Syntax:
Call FileCopy("Source" , "Destination")
Parameters:
Source denotes the file along with its complete path.
Destination is the destination path into which the file has to be copied to.
Examples:
Call FileCopy(ScriptPath &"\[Link]", Desktop & "\copied\")
Call FileCopy(ScriptPath &"\[Link]", ProgramFiles & "\copied\")
FolderCopy:
FolderCopy copies the contents of a folder to a specified destination path.
Syntax:
Call FolderCopy("Source" , "Destination")
Parameters:
Source denotes the source folder along with its complete path.
Destination is the destination path into which the contents of the folder has to be copied
into.
Examples:
Call FolderCopy(ScriptPath &"\Folder Copy", Desktop & "\copied\")
Call FolderCopy(ScriptPath &"\FolderCopy", ProgramFiles & "\copied\")
DeleteFile:
DeleteFile deletes a file from a specified folder.
Syntax:
Call DeleteFile("File&Path")
Parameters:
File&Path – Complete path of a file that has to be deleted.
Examples:
Call DeleteFile(Desktop &"\[Link]")
DeleteFolder:
It removes the target folder and any files and subfolders it contains.
Syntax:
Call DeleteFolder("Folder&Path")
Parameters:
Folder&Path – Complete path of a folder that has to be deleted.
Examples:
Call DeleteFolder(ProgramData & "\Adobe")
RunVbs:
RunVbs is used to execute a VBScript.
Syntax:
Call RunVbs("VbsPath")
Parameters:
VbsPath – Vbscript file along with its complete path.
Examples:
Call RunVbs(ScriptPath & "\eclipse\[Link]-aspectj-1.6.6-32-Install_C.vbs")
AddReg:
AddReg creates a Registry Key or Registry Value.
Syntax:
Call AddReg("Registry Hive" ,"Registry Path\Registry Data" ,"Registry Value ","Registry
Type")
Examples:
Call AddReg("HKLM" ,"\Software\Cognizant\testing1" ,"1","REG_SZ")
Call AddReg("HKLM" ,"\Software\Microsoft\Active Setup\Installed Components\Citrix\
StubPath" ,"C:\Program Files\Citrix\[Link]","REG_SZ")
Call AddReg("HKLM" ,"\Software\Microsoft\Active Setup\Installed Components\Citrix\
Version" ,"1.0","REG_SZ")
DelReg:
DelReg deletes a Registry Key or Registry Value.
Syntax:
Call DelReg("Registry Hive" ,"Registry Path\Registry Data ")
Examples:
Call DelReg("HKLM" ,"\Software\Microsoft\Active Setup\Installed Components\Citrix\
StubPath")
Call DelReg("HKLM" ,"\Software\Microsoft\Active Setup\Installed Components\Citrix\
Version")
set_Regstamp:
Creates registry Branding according to standards.
Syntax:
Call set_Regstamp ("Branding Name")
Examples:
Call set_Regstamp ("SoapUI 4.6.4")
Branding Registry can be deleted during uninstall.
Call DelReg("HKLM" ,"\Software\Cognizant\Branding Name\")
The script closes with the log file
LogFileclosing
Example Script: A Basic install script for installing an msi with its transform will be
as follows:
‘The Registry Stamping data is updated as below:
UPNName = "FW-Microsoft-Visual Studio - SDK-2010-32"
ApplicationActualName = "Visual Studio - SDK"
licenseSupplier = "Free Ware"
manufacturerName = "Microsoft"
applicatonVersion = "2010"
supplierID = ""
bit = "32"
exeName = "[Link]"
‘The install section will have different sections depending on customization required
'---------------------------- Install section--------------------
' Log File creation
LogFileOpening()
' Install a Product with MST
Call InstallMST(ScriptPath & "\[Link]",ScriptPath & "\FW-Microsoft-Visual Studio -
[Link]")
' Filedelete
Call DeleteFile(ProgramData &"\Microsoft\Windows\Start Menu\Programs\
Microsoft Visual Studio 2010 SDK\Download Visual Studio Visualization and Modeling
[Link]")
Call DeleteFile(ProgramData &"\Microsoft\Windows\Start Menu\Programs\
Microsoft Visual Studio 2010 SDK\Microsoft Visual Studio 2010 SDK [Link]")
Call DeleteFile(ProgramData &"\Microsoft\Windows\Start Menu\Programs\Microsoft
Visual Studio 2010 SDK\Visual Studio [Link]")
Call DeleteFile(ProgramData &"\Microsoft\Windows\Start Menu\Programs\Microsoft
Visual Studio 2010 SDK\VSX Samples on Code [Link]")
Call DeleteFile(ProgramData &"\Microsoft\Windows\Start Menu\Programs\Microsoft
Visual Studio 2010 SDK\VSX Developer [Link]")
' Closing Log File
LogFileclosing()