For example,
mssqlVersion.vbs
contains the code to obtain the actual value for
the MS SQL server prerequisite property on the Windows machine.
2.
Using a VBScript editor, add the code to obtain the value for the prerequisite
property. Use VBScript COM and functions to access elements of the Windows
environment and run in the Windows Script Host environment. Ensure the
check returns standard output as follows:
WScript.Echo "
property_name
=" &
var_for_value
v
property_name
that represents the prerequisite property as written in the
configuration file, for example,
env.tcrhome
.
v
var_for_value
, that is, the VBScript variable for the actual value that the
collector obtains for the prerequisite property.
To check whether the
TCR_HOME
environment exists and return the actual value,
where the prerequisite property name is
env.tcrhome
:
set wshShell = WScript.CreateObject("WScript.Shell")
tcr_home=WshShell.ExpandEnvironmentStrings("%TCR_HOME%")
WScript.Echo "env.tcrhome=" & tcr_home
To check whether the JRE is set in the PATH variable, where the prerequisite
property name is
env.path.jre
:
Set wshShell = WScript.CreateObject("WScript.Shell")
path = WshShell.ExpandEnvironmentStrings("%PATH%")
Set objRegEx = new RegExp
objRegEx.Pattern = "(^|([:;\\/]))(C:\Program Files\IBM\Java60\jre\bin)($|[:;])"
objRegEx.IgnoreCase = True
objRegEx.Global = True
Set matches = objRegEx.Execute(path)
WScript.Echo "env.path.jre=" & (matches.Count > 0)
To check the version of Tivoli Directory Integrator installed, where the
prerequisite property name is
installedSoftware.TDI.version
:
strComputer = "."
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
regDisName = "DisplayName"
regDisVer = "DisplayVersion"
Set oReg = GetObject("winmgmts:{impersonationLevel=Impersonate}!\\" &
strComputer & "\root\default:StdRegProv")
Set sftReg = new RegExp
sftReg.pattern = "Tivoli Directory Integrator"
sftReg.Global=False
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
For Each subkey In arrSubKeys
searchkey = strKeyPath & "\" & subkey
oReg.GetStringValue HKEY_LOCAL_MACHINE, searchkey, regDisName, strName
oReg.GetStringValue HKEY_LOCAL_MACHINE, searchkey, regDisVer, strVersion
If Not IsNull(strName) Then
Set matches = sftReg.Execute(strName)
If matches.Count > 0 Then
Wscript.Echo "installedSoftware.TDI.version=" & strVersion
End If
End If
Next
3.
Run the VBScript collector to ensure that there are no runtime errors and debug
as necessary.
4.
Create a custom evaluator only if the standard compare functions cannot
compare the actual and expected values.
Chapter 3. Extending Prerequisite Scanner
47
Содержание Prerequisite Scanner
Страница 1: ...Prerequisite Scanner Version 1 1 1 10 User s Guide ...
Страница 2: ......
Страница 3: ...Prerequisite Scanner Version 1 1 1 10 User s Guide ...
Страница 8: ...vi Prerequisite Scanner User s Guide ...
Страница 10: ...viii Prerequisite Scanner User s Guide ...
Страница 40: ...Figure 6 result txt file on Windows systems 30 Prerequisite Scanner User s Guide ...
Страница 46: ...36 Prerequisite Scanner User s Guide ...
Страница 68: ...58 Prerequisite Scanner User s Guide ...
Страница 78: ...Figure 11 precheck log file with the debug data 68 Prerequisite Scanner User s Guide ...
Страница 84: ...74 Prerequisite Scanner User s Guide ...
Страница 88: ...78 Prerequisite Scanner User s Guide ...
Страница 92: ...82 Prerequisite Scanner User s Guide ...
Страница 116: ...106 Prerequisite Scanner User s Guide ...
Страница 122: ...112 Prerequisite Scanner User s Guide ...
Страница 136: ...126 Prerequisite Scanner User s Guide ...
Страница 138: ...128 Prerequisite Scanner User s Guide ...
Страница 140: ...130 Prerequisite Scanner User s Guide ...
Страница 158: ...148 Prerequisite Scanner User s Guide ...
Страница 164: ...154 Prerequisite Scanner User s Guide ...
Страница 166: ...156 Prerequisite Scanner User s Guide ...
Страница 170: ...160 Prerequisite Scanner User s Guide ...
Страница 171: ......
Страница 172: ... Printed in USA ...