' $Header: install.vbs 22-may-2006.22:53:27 nemalhot Exp $ ' ' install.vbs ' ' Copyright (c) 2006, Oracle. All rights reserved. ' ' NAME ' install.vbs - CCR Package install software script ' ' DESCRIPTION ' This script is invoked by the Oracle CCR package deployment ' process and is used to unpack the distribution in the target ' directory. ' ' MODIFIED (MM/DD/YY) ' nemalhot 05/22/06 - Fixing null value checks ' ndutko 05/15/06 - ' jsutton 05/12/06 - Alternate approach to getting output from ' subprocesses ' ndutko 05/12/06 - Handle case of spaces in JAVA_HOME ' nemalhot 05/08/06 - convert OracleHome to lowercase ' jsutton 05/05/06 - Remove extra print of error info ' jsutton 01/24/06 - Creation; lifted from unix .sh variant ' ' ' LiveLink installation and deployment of the LiveLink scripts package ' Dim WshShell,WshEnv Dim ExecCommand Dim oExec,oStdErr,oStdOut Dim FSO Const ForReading = 1 Const ForWriting = 2 Const ForAppending = 8 Dim CCRHome,OracleHome,JavaHome,javaHomeEnv Set WshShell = WScript.CreateObject("WScript.Shell") Set FSO = CreateObject("Scripting.FileSystemObject") Set WshEnv = WshShell.Environment("PROCESS") ' Include core utility IncludeCoreUtils CCRHome = WshEnv("CCR_HOME") If (isUninitialized(CCRHome)) Then WScript.Echo "CCR Home is not defined" WScript.Quit(1) End If OracleHome = LCase(FSO.GetParentFolderName(CCRHome)) javaHomeEnv = UnquoteString(WshEnv("JAVA_HOME")) If (isUninitialized(javaHomeEnv)) Then javaHomeEnv = OracleHome & "\jdk" Else If (FSO.FolderExists(javaHomeEnv)) Then javaHomeEnv = FSO.GetFolder(javaHomeEnv).ShortPath End If End If JavaHome = javaHomeEnv & "\bin" Dim KITLOC, currDir KITLOC = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName,"\")) currDir = FSO.GetFolder(".") ' ' Unpack the payload ZIP file directly into the CCR home ' WshShell.CurrentDirectory = CCRHome Call runProc(JavaHome & "\jar"," xf " & KITLOC & "\payload.zip") WshShell.CurrentDirectory = currDir WScript.Quit(0) ' Includes the core utility file. Private Sub IncludeCoreUtils Dim CoreUtils ' get directory context of this script, coreutils must be in the same directory CoreUtils = LCase(Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName,"\"))) CoreUtils = CoreUtils & "coreutil.vbs" IncludeFileAbs CoreUtils End Sub ' Includes a file in the global namespace of the current script. ' The file can contain any VBScript source code. ' The path of the file name must be specified absolute (or ' relative to the current directory). Private Sub IncludeFileAbs (ByVal FileName) Dim f: set f = FSO.OpenTextFile(FileName,ForReading) Dim s: s = f.ReadAll() ExecuteGlobal s End Sub