End If\r
End Function\r
\r
-' Move and then Delete a file. File is moved into %TEMP%\basename(filename)\r
-' then deleted; pesky files in 'system32\drivers'.\r
-\r
-Function FileMDelete(filename)\r
- Dim fso\r
- Set fso = CreateObject("Scripting.FileSystemObject")\r
- Err.clear\r
- If fso.FileExists(filename) Then\r
- Set WshShell = CreateObject("WScript.Shell")\r
- Return = WshShell.Run ("cmd.exe /c del /Q /F " & filename, 0, true)\r
- If Err Then\r
- msgbox "Could not delete: " & filename\r
- ' Display error number and description if applicable\r
- ShowError\r
- Err.clear\r
- End If \r
- End If\r
-End Function\r
-\r
Function FileMove(filename,destination)\r
Dim fso\r
Set fso = CreateObject("Scripting.FileSystemObject")\r
sSystemFolder = PropArray(1)\r
sInstalldir = PropArray(0)\r
Else\r
- Win = Session.Property("WINDOWS")\r
+ Win = Session.Property("WindowsFolder")\r
sSystem64Folder = Session.Property("System64Folder") \r
sInstalldir = Session.Property("INSTALLDIR") \r
sSystemFolder = Session.Property("SystemFolder") \r
' msgbox " sSystemFolder " & sSystemFolder\r
' msgbox " sSystem64Folder " & sSystem64Folder\r
\r
- FileMDelete(sDRIVERS & "ibbus.sys")\r
- FileMDelete(sDRIVERS & "mthca.sys")\r
- FileMDelete(sDRIVERS & "ipoib.sys")\r
- FileMDelete(sDRIVERS & "ibsrp.sys")\r
- FileMDelete(sDRIVERS & "vnic.sys")\r
+ FileDelete(sDRIVERS & "ibbus.sys")\r
+ FileDelete(sDRIVERS & "mthca.sys")\r
+ FileDelete(sDRIVERS & "ipoib.sys")\r
+ FileDelete(sDRIVERS & "ibsrp.sys")\r
+ FileDelete(sDRIVERS & "vnic.sys")\r
\r
If (MTARCH="amd64" Or MTARCH="ia64") Then\r
' System64Folder = System32, SystemFolder = Syswow64\r
\r
' returns an array of all Local Area Connections which\r
' were created for IPoIB.\r
+' This version works for Windows Server 2003 and Windows XP.\r
\r
-Function Find_IPOIB_LAC()\r
- Set WshShell = CreateObject("WScript.Shell")\r
+Function Find_IPOIB_LAC\r
+ Dim Conn, cmd, arrSize\r
+ Dim ibaDev()\r
\r
- Set ibaDevicesExec = WshShell.Exec ("cmd.exe /c reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network /f ""IBA\IPOIB"" /s /d | FIND ""Connection""")\r
- ibaDevices = split(ibaDevicesExec.StdOut.ReadAll, vbCrLF)\r
+ Set WshShell = CreateObject("WScript.Shell")\r
\r
- ' Getting the array Size\r
- dim arrSize\r
- arrSize = 0\r
- for each deviceCan in ibaDevices\r
- arrSize = arrSize + 1\r
- next\r
- 'Creating array of Local Area Connections based on IPoIB\r
- dim ibaDev()\r
- Redim ibaDev(arrSize - 1)\r
- index = 0\r
- for each deviceCan in ibaDevices\r
- ibaDev(index) = deviceCan\r
- index = index + 1\r
- next\r
- Find_IPOIB_LAC=ibaDev\r
+ cmd = "reg.exe query HKLM\SYSTEM\CurrentControlSet\Control\Network /s | FIND ""}\Connection"" "\r
+\r
+ Set connExec = WshShell.Exec("cmd.exe /C " & cmd)\r
+ If Err Then\r
+ msgbox "Err Shell.Exec(cmd.exe /C " & cmd\r
+ Find_IPOIB_LAC=ibaDev\r
+ Exit Function\r
+ End if\r
+ ipoibConn = split(connExec.StdOut.ReadAll, vbCrLF)\r
+\r
+ ' Determine the array Size\r
+ arrSize = 0\r
+ for each Conn in ipoibConn\r
+ arrSize = arrSize + 1\r
+ next\r
+ ' Any work to do?\r
+ If arrSize = 0 Then\r
+ Find_IPOIB_LAC=ibaDev\r
+ Exit Function\r
+ End if\r
+\r
+ ' Create an array of IPoIB Local Area Connection registry entries\r
+ ' filter out those LAC which are not IPoIB related.\r
+\r
+ Redim ibaDev(arrSize - 1)\r
+ index = 0\r
+\r
+ Dim rex,resp,re,delstr\r
+\r
+ for each Conn in ipoibConn\r
+ Set rex = WshShell.Exec ("cmd.exe /C reg.exe query " & Conn & " /v PnpInstanceID | FIND ""IBA\IPOIB"" ")\r
+ resp = split(rex.StdOut.ReadAll, vbCrLF)\r
+ For each re in resp\r
+ if Instr(re,"IPOIB") Then\r
+ ' set parent registry entry, suitable for deletion\r
+ ibaDev(index) = Left(Conn,Len(Conn)-Len("\Connection"))\r
+ index = index + 1\r
+ Exit For\r
+ End If\r
+ next\r
+ next\r
+ Find_IPOIB_LAC=ibaDev\r
End Function\r
\r
\r
Return = WshShell.Run ("cmd.exe /c sc.exe delete opensm", 0, true)\r
If Err Then ShowError\r
\r
- If fso.FileExists(sInstalldir & "opensm.service.txt") Then\r
- fso.DeleteFile(sInstalldir & "opensm.service.txt"),true\r
- End if\r
- \r
' create a list of IBA\ devices via 'devcon findall'\r
devices = FindDevices\r
\r
Return = WshShell.Run ("reg.exe delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mthca /f", 0, true)\r
Return = WshShell.Run ("reg.exe delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ipoib /f", 0, true)\r
\r
- ' remove all Local Area Connection which were constructed for IPoIB\r
+ ' remove all Local Area Connection which were constructed by IPoIB.\r
' create a list of IBA\IPOIB Local Area Connections via 'reg query'\r
Dim IPOIB_LAC\r
IPOIB_LAC = Find_IPOIB_LAC\r
\r
\r
\r
-' Function will add registry key for the opensm service\r
+' Add the OpenSM service, default is disabled, if OpenSM_service_enabled\r
+' feature is selected, then start OpenSM service automatically.\r
+' add registry key for the opensm service\r
\r
Sub OpensmServiceEvent()\r
Dim sInstalldir,opensmPath,opensmService,WshShell,fso\r
' nuke some driver files which remain due to devcon device install.\r
' Immediate execution; called after MsiCleanupOnSuccess\r
\r
-Function HammerTime\r
+Sub HammerTime()\r
Dim fso, sInstallDir, RC, cmd\r
\r
Set fso=CreateObject("Scripting.FileSystemObject") \r
cmd = "cmd.exe /c rmdir /S /Q """ & sInstallDir & """"\r
RC = wshShell.Run(cmd,0,true)\r
End if\r
-\r
- RemoveInstallFolder = 0\r
-End Function\r
+End Sub\r
\r
\r
' NOT USED - deferred action to increment ticks while action is taking place\r