Function ZTIProcess()
Dim sName, sPackage, sFullName, sVEditor, sDate
sName = "CMCB Agent"
sPackage = "CMCBMAgent"
sFullName = "CMCB Agent"
sVEditor = "5.00.8540.1006"
sDate = Date
Dim sSetupFile, sArguments
Dim sSourcePath
' Set Source Path Folder (Where source file must be stored in MDT)
sSourcePath = oUtility.ScriptDir & "\Source"
sSetupFile = sSourcePath & "\ccmsetup.exe"
'sArguments = "/noservice /Source:""" & sSourcePath & """ CCMHTTPPORT=2089 SMSCACHESIZE=3072"
sArguments = "/noservice /Source:""" & sSourcePath & """"
'Add Site Code to command line argument
if oEnvironment.Exists("SG_SCCM_SITE_CODE") then
sArguments = sArguments & " SMSSITECODE=" & oEnvironment.Item("SG_SCCM_SITE_CODE")
End if
oLogging.CreateEntry oUtility.ScriptName & ": Starting installation", LogTypeInfo
If not oFSO.FileExists(sSetupFile) then
oLogging.CreateEntry oUtility.ScriptName & ": " & sSetupFile & " was not found, unable to install", LogTypeError
ZTIProcess = Failure
Exit Function
End If
iRetVal = oUtility.RunWithHeartbeat("""" & sSetupFile & """ " & sArguments)
if (iRetVal = 0) or (iRetVal = 3010) then
' Add Applications Info for CMCB
'oLogging.CreateEntry "Adding registry entry for SCCM", LogTypeInfo
'oShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\SG\Applications\" & sPackage & "\Installation Date", sDate, "REG_SZ"
'oShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\SG\Applications\" & sPackage & "\Long Name", sFullName, "REG_SZ"
'oShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\SG\Applications\" & sPackage & "\Editor Version", sVEditor, "REG_SZ"
ZTIProcess = Success
Else
ZTIProcess = Failure
End If
oLogging.CreateEntry oUtility.ScriptName & ": Return code from command = " & iRetVal, LogTypeInfo
oLogging.CreateEntry oUtility.ScriptName & ": Finished installation", LogTypeInfo
End Function