From: stansmith Date: Mon, 4 Jun 2007 23:27:54 +0000 (+0000) Subject: [WinOF] RC5 changes X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=da1d317135d1cea410e68bb81f9f7e274908d3b5;p=~shefty%2Frdma-win.git [WinOF] RC5 changes Cruft lingering in FileMDelete(), removed and changed to FileDelete() calls. git-svn-id: svn://openib.tc.cornell.edu/gen1@685 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/branches/WinOF/InstallShield/CustomActions.vbs b/branches/WinOF/InstallShield/CustomActions.vbs index b46f28d3..f9b3cdb1 100644 --- a/branches/WinOF/InstallShield/CustomActions.vbs +++ b/branches/WinOF/InstallShield/CustomActions.vbs @@ -77,25 +77,6 @@ Function FileDelete(filename) End If End Function -' Move and then Delete a file. File is moved into %TEMP%\basename(filename) -' then deleted; pesky files in 'system32\drivers'. - -Function FileMDelete(filename) - Dim fso - Set fso = CreateObject("Scripting.FileSystemObject") - Err.clear - If fso.FileExists(filename) Then - Set WshShell = CreateObject("WScript.Shell") - Return = WshShell.Run ("cmd.exe /c del /Q /F " & filename, 0, true) - If Err Then - msgbox "Could not delete: " & filename - ' Display error number and description if applicable - ShowError - Err.clear - End If - End If -End Function - Function FileMove(filename,destination) Dim fso Set fso = CreateObject("Scripting.FileSystemObject") @@ -129,7 +110,7 @@ Function RemoveDriverFiles() sSystemFolder = PropArray(1) sInstalldir = PropArray(0) Else - Win = Session.Property("WINDOWS") + Win = Session.Property("WindowsFolder") sSystem64Folder = Session.Property("System64Folder") sInstalldir = Session.Property("INSTALLDIR") sSystemFolder = Session.Property("SystemFolder") @@ -147,11 +128,11 @@ Function RemoveDriverFiles() ' msgbox " sSystemFolder " & sSystemFolder ' msgbox " sSystem64Folder " & sSystem64Folder - FileMDelete(sDRIVERS & "ibbus.sys") - FileMDelete(sDRIVERS & "mthca.sys") - FileMDelete(sDRIVERS & "ipoib.sys") - FileMDelete(sDRIVERS & "ibsrp.sys") - FileMDelete(sDRIVERS & "vnic.sys") + FileDelete(sDRIVERS & "ibbus.sys") + FileDelete(sDRIVERS & "mthca.sys") + FileDelete(sDRIVERS & "ipoib.sys") + FileDelete(sDRIVERS & "ibsrp.sys") + FileDelete(sDRIVERS & "vnic.sys") If (MTARCH="amd64" Or MTARCH="ia64") Then ' System64Folder = System32, SystemFolder = Syswow64 @@ -475,28 +456,56 @@ End Function ' returns an array of all Local Area Connections which ' were created for IPoIB. +' This version works for Windows Server 2003 and Windows XP. -Function Find_IPOIB_LAC() - Set WshShell = CreateObject("WScript.Shell") +Function Find_IPOIB_LAC + Dim Conn, cmd, arrSize + Dim ibaDev() - Set ibaDevicesExec = WshShell.Exec ("cmd.exe /c reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network /f ""IBA\IPOIB"" /s /d | FIND ""Connection""") - ibaDevices = split(ibaDevicesExec.StdOut.ReadAll, vbCrLF) + Set WshShell = CreateObject("WScript.Shell") - ' Getting the array Size - dim arrSize - arrSize = 0 - for each deviceCan in ibaDevices - arrSize = arrSize + 1 - next - 'Creating array of Local Area Connections based on IPoIB - dim ibaDev() - Redim ibaDev(arrSize - 1) - index = 0 - for each deviceCan in ibaDevices - ibaDev(index) = deviceCan - index = index + 1 - next - Find_IPOIB_LAC=ibaDev + cmd = "reg.exe query HKLM\SYSTEM\CurrentControlSet\Control\Network /s | FIND ""}\Connection"" " + + Set connExec = WshShell.Exec("cmd.exe /C " & cmd) + If Err Then + msgbox "Err Shell.Exec(cmd.exe /C " & cmd + Find_IPOIB_LAC=ibaDev + Exit Function + End if + ipoibConn = split(connExec.StdOut.ReadAll, vbCrLF) + + ' Determine the array Size + arrSize = 0 + for each Conn in ipoibConn + arrSize = arrSize + 1 + next + ' Any work to do? + If arrSize = 0 Then + Find_IPOIB_LAC=ibaDev + Exit Function + End if + + ' Create an array of IPoIB Local Area Connection registry entries + ' filter out those LAC which are not IPoIB related. + + Redim ibaDev(arrSize - 1) + index = 0 + + Dim rex,resp,re,delstr + + for each Conn in ipoibConn + Set rex = WshShell.Exec ("cmd.exe /C reg.exe query " & Conn & " /v PnpInstanceID | FIND ""IBA\IPOIB"" ") + resp = split(rex.StdOut.ReadAll, vbCrLF) + For each re in resp + if Instr(re,"IPOIB") Then + ' set parent registry entry, suitable for deletion + ibaDev(index) = Left(Conn,Len(Conn)-Len("\Connection")) + index = index + 1 + Exit For + End If + next + next + Find_IPOIB_LAC=ibaDev End Function @@ -538,10 +547,6 @@ Sub DriverUninstall() Return = WshShell.Run ("cmd.exe /c sc.exe delete opensm", 0, true) If Err Then ShowError - If fso.FileExists(sInstalldir & "opensm.service.txt") Then - fso.DeleteFile(sInstalldir & "opensm.service.txt"),true - End if - ' create a list of IBA\ devices via 'devcon findall' devices = FindDevices @@ -616,7 +621,7 @@ Sub DriverUninstall() Return = WshShell.Run ("reg.exe delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mthca /f", 0, true) Return = WshShell.Run ("reg.exe delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ipoib /f", 0, true) - ' remove all Local Area Connection which were constructed for IPoIB + ' remove all Local Area Connection which were constructed by IPoIB. ' create a list of IBA\IPOIB Local Area Connections via 'reg query' Dim IPOIB_LAC IPOIB_LAC = Find_IPOIB_LAC @@ -665,7 +670,9 @@ End Sub -' Function will add registry key for the opensm service +' Add the OpenSM service, default is disabled, if OpenSM_service_enabled +' feature is selected, then start OpenSM service automatically. +' add registry key for the opensm service Sub OpensmServiceEvent() Dim sInstalldir,opensmPath,opensmService,WshShell,fso @@ -760,7 +767,7 @@ End Function ' nuke some driver files which remain due to devcon device install. ' Immediate execution; called after MsiCleanupOnSuccess -Function HammerTime +Sub HammerTime() Dim fso, sInstallDir, RC, cmd Set fso=CreateObject("Scripting.FileSystemObject") @@ -771,9 +778,7 @@ Function HammerTime cmd = "cmd.exe /c rmdir /S /Q """ & sInstallDir & """" RC = wshShell.Run(cmd,0,true) End if - - RemoveInstallFolder = 0 -End Function +End Sub ' NOT USED - deferred action to increment ticks while action is taking place