+'/*\r
+' * Copyright (c) 2008 Intel Corporation. All rights reserved.\r
+' *\r
+' * This software is available to you under the OpenIB.org BSD license\r
+' * below:\r
+' *\r
+' * Redistribution and use in source and binary forms, with or\r
+' * without modification, are permitted provided that the following\r
+' * conditions are met:\r
+' *\r
+' * - Redistributions of source code must retain the above\r
+' * copyright notice, this list of conditions and the following\r
+' * disclaimer.\r
+' *\r
+' * - Redistributions in binary form must reproduce the above\r
+' * copyright notice, this list of conditions and the following\r
+' * disclaimer in the documentation and/or other materials\r
+' * provided with the distribution.\r
+' *\r
+' * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+' * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+' * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+' * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\r
+' * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
+' * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+' * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r
+' * SOFTWARE.\r
+' */\r
+\r
' WIX CustomActions used in the WinOF (Windows OpenFabrics) Release.\r
' File is based on the installer src contributed by Mellanox Technologies.\r
'\r
'\r
' $Id$\r
\r
+Const WindowsXP ="501"\r
+Const WindowsLongHorn ="600"\r
+Const Windows7 ="700"\r
+\r
+\r
Function Architecture()\r
Dim Arch,item\r
For Each item In GetObject("winmgmts:root/cimv2").ExecQuery("SELECT Architecture FROM Win32_Processor")\r
\r
\r
' A CustomAction (CA) that runs after SetupInitialize which sets up\r
-' CustomAction Data for the defered action CA DriverInstall().\r
+' CustomAction Data for the defered action DriverInstall().\r
' A CA can only see Installer properties through pre-loaded 'CustomActionData'\r
\r
Sub WinOF_setup\r
' Replace default InfiniHost HCA driver with ConnectX HCA driver if\r
' requested 'HCA=cx' or add ConnectX '+cx'.\r
\r
- If VersionNT < 600 Then\r
+ If VersionNT < WindowsLongHorn Then\r
use_this_HCA = Session.Property("HCA")\r
If use_this_HCA <> "" Then\r
' down-case if required.\r
End If\r
End If\r
\r
- SRP = Session.Property("SRP")\r
- If SRP = "1" Then\r
+ If Session.Property("OSM") = "1" Then\r
+ AddLocal = AddLocal & ",fOSMS"\r
+ End If\r
+\r
+ If Session.Property("SRP") = "1" Then\r
AddLocal = AddLocal & ",fSRP"\r
End If\r
\r
- VNIC = Session.Property("VNIC")\r
- If VNIC = "1" Then\r
+ If Session.Property("VNIC") = "1" Then\r
AddLocal = AddLocal & ",fVNIC"\r
End If\r
\r
' Driver Install Properties:\r
' 0-INSTALLDIR; 1-SystemFolder; 2-System64Folder; 3-WindowsFolder ;\r
- ' 4-VersionNT; 5-ADDLOCAL; 6-REMOVE; 7-NODRV\r
+ ' 4-VersionNT; 5-ADDLOCAL; 6-REMOVE; 7-NODRV; 8-DBG\r
\r
Session.Property("DriverInstall") = _\r
Session.Property("INSTALLDIR") & ";" & _\r
VersionNT & ";" & _\r
AddLocal & ";" & _\r
Session.Property("REMOVE") & ";" & _\r
- Session.Property("NODRV")\r
+ Session.Property("NODRV") & ";" & _\r
+ Session.Property("DBG")\r
\r
End Sub\r
\r
End If\r
End Function\r
\r
+Sub FileDeleteQ(fso,filename)\r
+ Err.clear\r
+ If fso.FileExists(filename) Then\r
+' On Error Resume Next \r
+ fso.DeleteFile(filename),True\r
+ If (Err And Err.Number <> 70) Then ' tolerate protection errors\r
+ ErrMsg ("Could not delete: " & filename)\r
+ End If \r
+ End If\r
+End Sub\r
+\r
\r
' Move and then Delete a file. File is moved into %TEMP%\basename(filename)\r
' then deleted; pesky files in 'system32\drivers'.\r
End Function\r
\r
\r
-Function DriverFileDelete(fso,WshShell,filename)\r
+Sub DriverFileDelete(fso,WshShell,filename,VersionNT)\r
Err.clear\r
If fso.FileExists(filename) Then\r
+ ' allow continuation after 'permission denied' error\r
On Error Resume Next \r
' unlock the driver file by deleting PnPLocked reg entry.\r
- base = "reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\PnpLockdownFiles /v "\r
- Return = WshShell.Run (base & filename & " /f", 0, true)\r
+ If VersionNT >= WindowsLongHorn Then\r
+ base = "reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\PnpLockdownFiles /v "\r
+ Return = WshShell.Run (base & filename & " /f", 0, true)\r
+ End If\r
fso.DeleteFile(filename),True\r
If (Err And Err.Number <> 70) Then ' tolerate protection errors\r
ErrMsg ("Could not delete: " & filename)\r
End If \r
End If\r
-End Function\r
-\r
-\r
-\r
-Function FileMDelete(src,file)\r
- Dim rc,cmd\r
- On Error Resume Next \r
- Err.clear\r
- Set WshShell = CreateObject("WScript.Shell")\r
- cmd = "cmd.exe /c cd /d " & src & " & del /Q/F " & file\r
- rc = WshShell.Run (cmd, 0, true)\r
-' Debug\r
-' Set cmdExec = WshShell.Exec (cmd)\r
-' noise = cmdExec.StdErr.ReadAll\r
-' msgbox "FileMDel " & src & " stdErr " & noise\r
+End Sub\r
\r
-End Function\r
\r
\r
' Remove the specified folder and all sub-folders & files. \r
' when the driver is uninstalled. Win2K3/x64 files persist, XP & Win2K3/x86\r
' the driver files are correctly remove?\r
\r
-Function RemoveDriverFiles(WshShell)\r
- Dim Win, sDRIVERS, sSystem64Folder, sInstalldir, sSYS32, sSYSWOW64\r
- Dim sSystemFolder, CheckMode, PropArray, dllCache, fso, sTemp\r
+Sub RemoveDriverFiles(fso,WshShell,VersionNT)\r
+\r
+ Dim Win, sDRIVERS, sSYS32, sSYSWOW64\r
+ Dim CheckMode, PropArray, sTemp\r
\r
' Function can be called from the Driver{Install/Uninstall} rtns.\r
- ' (properties are different).\r
- CheckMode = Session.Property("CustomActionData")\r
- If Not CheckMode = "" Then\r
- PropArray = Split(Session.Property("CustomActionData"), ";") \r
- Win = PropArray(3)\r
- sSystem64Folder = PropArray(2)\r
- sSystemFolder = PropArray(1)\r
- sInstalldir = PropArray(0)\r
- Else\r
- Win = Session.Property("WindowsFolder")\r
- sSystem64Folder = Session.Property("System64Folder") \r
- sInstalldir = Session.Property("INSTALLDIR") \r
- sSystemFolder = Session.Property("SystemFolder") \r
- End if\r
-\r
- Set WshShell = CreateObject("WScript.Shell")\r
- Set fso = CreateObject("Scripting.FileSystemObject")\r
\r
- MTARCH = Architecture \r
+ Win = fso.GetSpecialFolder(0) & "\"\r
\r
' this is screw-ball: on 64-bit systems: SystemFolder == %windir%\SysWOW64\r
' on 32-bit systems: SystemFolder == %windir%\system32\r
- ' Pay attention and switch sSYS32 on x86 systems\r
-\r
- sDRIVERS = sSystem64Folder \r
- sSYS32 = sSystem64Folder\r
- sSYSWOW64 = sSystemFolder\r
\r
- If (MTARCH = "x86") Then\r
- sDRIVERS = sSystemFolder ' holds Session.Property("SystemFolder")\r
- sSYS32 = sSystemFolder\r
- End If\r
+ sSYS32 = Win & "system32\"\r
+ sSYSWOW64 = Win & "SysWOW64\"\r
sDRIVERS = sSYS32 & "drivers\"\r
\r
- DriverFileDelete fso,WshShell,sDRIVERS & "ibbus.sys"\r
- FileDelete(sDRIVERS & "ibbus.sy1")\r
- DriverFileDelete fso,WshShell,sDRIVERS & "ibiou.sys"\r
- DriverFileDelete fso,WshShell,sDRIVERS & "mthca.sys"\r
- FileDelete(sDRIVERS & "mthca.sy1")\r
- DriverFileDelete fso,WshShell,sDRIVERS & "mlx4_bus.sys"\r
- DriverFileDelete fso,WshShell,sDRIVERS & "mlx4_hca.sys"\r
-\r
- DriverFileDelete fso,WshShell,sDRIVERS & "ipoib.sys"\r
- DriverFileDelete fso,WshShell,sDRIVERS & "ibsrp.sys"\r
- DriverFileDelete fso,WshShell,sDRIVERS & "vnic.sys"\r
- DriverFileDelete fso,WshShell,sDRIVERS & "qlgcvnic.sys"\r
- \r
- dllCache = sSystem64Folder & "dllcache\"\r
- If fso.FolderExists(dllCache) Then\r
- FileDelete(dllCache & "ibal.dll")\r
- FileDelete(dllCache & "ibald.dll")\r
- FileDelete(dllCache & "complib.dll")\r
- FileDelete(dllCache & "complibd.dll")\r
- FileDelete(dllCache & "mthcau.dll")\r
- FileDelete(dllCache & "mthcaud.dll")\r
- FileDelete(dllCache & "mlx4u.dll")\r
- FileDelete(dllCache & "mlx4ud.dll")\r
- FileDelete(dllCache & "IbInstaller.dll")\r
- FileDelete(dllCache & "ibwsd.dll")\r
- FileDelete(dllCache & "ibsrp.dll")\r
- FileDelete(dllCache & "ibsrpd.dll")\r
- End if\r
+ DriverFileDelete fso,WshShell,sDRIVERS & "ibbus.sys",VersionNT\r
+ DriverFileDelete fso,WshShell,sDRIVERS & "mthca.sys",VersionNT\r
+ FileDeleteQ fso,sDRIVERS & "mthca.sy1"\r
+ DriverFileDelete fso,WshShell,sDRIVERS & "mlx4_bus.sys",VersionNT\r
+ DriverFileDelete fso,WshShell,sDRIVERS & "mlx4_hca.sys",VersionNT\r
+ DriverFileDelete fso,WshShell,sDRIVERS & "winverbs.sys",VersionNT\r
+ DriverFileDelete fso,WshShell,sDRIVERS & "winmad.sys",VersionNT\r
+ DriverFileDelete fso,WshShell,sDRIVERS & "ipoib.sys",VersionNT\r
+ DriverFileDelete fso,WshShell,sDRIVERS & "ibiou.sys",VersionNT\r
+ DriverFileDelete fso,WshShell,sDRIVERS & "ibsrp.sys",VersionNT\r
+ DriverFileDelete fso,WshShell,sDRIVERS & "vnic.sys",VersionNT\r
+ DriverFileDelete fso,WshShell,sDRIVERS & "qlgcvnic.sys",VersionNT\r
\r
- DriverFileDelete fso,WshShell,sSYS32 & "ibal.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "ibald.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "ibal32.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "ibal32d.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "complib.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "complibd.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "cl32.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "cl32d.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "mthcau.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "mthcaud.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "mthca32.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "mthca32d.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "mlx4u.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "mlx4ud.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "mlx4u32.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "mlx4u32d.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "ibsrp.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "ibsrpd.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "IbInstaller.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "ibwsd.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "ibndprov.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "ibndprov32.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "ndinstall.exe"\r
+ DriverFileDelete fso,WshShell,sSYS32 & "libibverbs.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "libibverbsd.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "winmad.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "winmadd.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "winverbs.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "winverbsd.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "ibal.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "ibald.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "ibal32.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "ibal32d.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "complib.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "complibd.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "cl32.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "cl32d.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "mthcau.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "mthcaud.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "mthca32.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "mthca32d.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "mlx4u.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "mlx4ud.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "mlx4u32.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "mlx4u32d.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "ibsrp.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "ibsrpd.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "IbInstaller.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "ibwsd.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "ibndprov.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "ibndprov32.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYS32 & "ndinstall.exe",VersionNT\r
\r
If fso.FolderExists(sSYSWOW64) Then\r
- DriverFileDelete fso,WshShell,sSYSWOW64 & "ibal.dll"\r
- DriverFileDelete fso,WshShell,sSYSWOW64 & "ibald.dll"\r
- DriverFileDelete fso,WshShell,sSYSWOW64 & "complib.dll"\r
- DriverFileDelete fso,WshShell,sSYSWOW64 & "complibd.dll"\r
- DriverFileDelete fso,WshShell,sSYSWOW64 & "mthcau.dll"\r
- DriverFileDelete fso,WshShell,sSYSWOW64 & "mthcaud.dll"\r
- DriverFileDelete fso,WshShell,sSYSWOW64 & "mlx4u.dll"\r
- DriverFileDelete fso,WshShell,sSYSWOW64 & "mlx4ud.dll"\r
- DriverFileDelete fso,WshShell,sSYSWOW64 & "ibsrp.dll"\r
- DriverFileDelete fso,WshShell,sSYSWOW64 & "ibsrpd.dll"\r
- DriverFileDelete fso,WshShell,sSYSWOW64 & "IbInstaller.dll"\r
- DriverFileDelete fso,WshShell,sSYSWOW64 & "ibwsd.dll"\r
- DriverFileDelete fso,WshShell,sSYSWOW64 & "ibndprov.dll"\r
+ DriverFileDelete fso,WshShell,sSYSWOW64 & "ibal.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYSWOW64 & "ibald.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYSWOW64 & "complib.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYSWOW64 & "complibd.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYSWOW64 & "mthcau.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYSWOW64 & "mthcaud.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYSWOW64 & "mlx4u.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYSWOW64 & "mlx4ud.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYSWOW64 & "ibsrp.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYSWOW64 & "ibsrpd.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYSWOW64 & "IbInstaller.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYSWOW64 & "ibwsd.dll",VersionNT\r
+ DriverFileDelete fso,WshShell,sSYSWOW64 & "ibndprov.dll",VersionNT\r
End If\r
\r
If fso.FolderExists(Win & "lastgood" ) Then\r
- FileDelete(Win & "lastgood\system32\ibwsd.dll")\r
- FileDelete(Win & "lastgood\SysWOW64\ibwsd.dll")\r
- FileDelete(Win & "lastgood\SysWOW64\mthcau.dll")\r
- FileDelete(Win & "lastgood\SysWOW64\mthcaud.dll")\r
- FileDelete(Win & "lastgood\system32\mthcau.dll")\r
- FileDelete(Win & "lastgood\system32\mthcaud.dll")\r
- FileDelete(Win & "lastgood\system32\drivers\mthcau.dll")\r
- FileDelete(Win & "lastgood\system32\drivers\mthcaud.dll")\r
- FileDelete(Win & "lastgood\system32\drivers\mthca.sys")\r
+ FileDeleteQ fso,Win & "lastgood\system32\ibwsd.dll"\r
+ FileDeleteQ fso,Win & "lastgood\SysWOW64\ibwsd.dll"\r
+ FileDeleteQ fso,Win & "lastgood\SysWOW64\mthcau.dll"\r
+ FileDeleteQ fso,Win & "lastgood\SysWOW64\mthcaud.dll"\r
+ FileDeleteQ fso,Win & "lastgood\system32\mthcau.dll"\r
+ FileDeleteQ fso,Win & "lastgood\system32\mthcaud.dll"\r
+ FileDeleteQ fso,Win & "lastgood\system32\drivers\mthcau.dll"\r
+ FileDeleteQ fso,Win & "lastgood\system32\drivers\mthcaud.dll"\r
+ FileDeleteQ fso,Win & "lastgood\system32\drivers\mthca.sys"\r
+ FileDeleteQ fso,Win & "lastgood\system32\drivers\winverbs.sys"\r
+ FileDeleteQ fso,Win & "lastgood\system32\drivers\winmad.sys"\r
End If\r
\r
- FileDelete(Win & "winverbs.lib")\r
- FileDelete(Win & "libibverbs.lib")\r
- DriverFileDelete fso,WshShell,sDRIVERS & "winverbs.sys"\r
- DriverFileDelete fso,WshShell,sSYS32 & "winverbs.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "winverbsd.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "libibverbs.dll"\r
- DriverFileDelete fso,WshShell,sSYS32 & "libibverbsd.dll"\r
+ FileDeleteQ fso,Win & "winverbs.lib"\r
+ FileDeleteQ fso,Win & "libibverbs.lib"\r
\r
' delete opensm files\r
sTemp = fso.GetSpecialFolder(0) & "\temp\"\r
' remove files from %SystemRoot%\temp\r
- FileDelete(sTemp & "guid2lid")\r
- FileDelete(sTemp & "opensm-sa.dump")\r
- FileDelete(sTemp & "osm.log")\r
- FileDelete(sTemp & "osm-subnet.lst")\r
+ FileDeleteQ fso,sTemp & "guid2lid"\r
+ FileDeleteQ fso,sTemp & "opensm-sa.dump"\r
+ FileDeleteQ fso,sTemp & "osm.log"\r
+ FileDeleteQ fso,sTemp & "osm-subnet.lst"\r
\r
- ' Delete oem*.inf and oem*.pnf files\r
- dim InfFiles, PnfFiles, IFILES, PFILES\r
- Set infFilesExec = WshShell.Exec ("cmd.exe /c for /f %i in ('findstr /m Mellanox %WINDIR%\inf\oem*.*') do @echo %i")\r
- ' Display error number and description if applicable\r
- If Err Then ShowError\r
- \r
- InfFiles = infFilesExec.StdOut.ReadAll\r
- PnfFiles = Replace(InfFiles,".inf",".pnf")\r
- \r
- IFILES = Split(InfFiles,vbCrLf)\r
- PFILES = Split(PnfFiles,vbCrLf)\r
- \r
- For Each file in IFILES\r
- If (file <> "") Then\r
- FileDelete(file)\r
- End IF\r
- Next\r
- \r
- For Each file in PFILES\r
- If (file <> "") Then\r
- FileDelete(file)\r
- End IF\r
- Next\r
- \r
-End Function\r
+End Sub\r
\r
\r
''''''''''' Delete registry key ''''''''''''\r
WriteSysPath = Err.Number\r
End Function\r
\r
-\r
-'Chops the last character off a string if it matches strchar\r
-Function ChopChar(strString, strChar)\r
- Dim x\r
- x = Len(strString)\r
- if mid(strString, x) = strChar then\r
- ChopChar = mid(strString, 1, x -1)\r
- else\r
- ChopChar = strString\r
- end if\r
-End Function\r
-\r
-\r
-' Add specified path to the system search path registry entry @\r
-' 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path'\r
-' Normally the added path is [INSTALLDIR]\r
-' Called from a defered exection context (aka, DriverInstall).\r
-\r
-Function SysPathAdd(InstallDir)\r
-\r
- Dim rc, result, sInstallDir, newPath\r
-\r
- ' On Error Resume Next\r
- sInstallDir = ChopChar(InstallDir,"\")\r
-\r
- result = ReadSysPath\r
- If IsNull(result) Then\r
- SysPathAdd = ShowErr2("SysPathAdd - RegRead()")\r
- Exit Function\r
- End if\r
-\r
- ' Is [INSTALLDIR] already set?\r
- start = instr(result,sInstallDir)\r
- If start <> 0 Then\r
- SysPathAdd = 0\r
- Exit Function\r
- End if\r
-\r
- newPath = result & ";" & sInstallDir\r
-\r
- rc = WriteSysPath(newPath)\r
- If rc <> 0 Then\r
- SysPathAdd = ShowErr2("SysPathAdd - WriteSysPath()")\r
- Else\r
- ' TODO - Notify current windows of updated PATH registry value.\r
- SysPathAdd = 0\r
- End if\r
-\r
-End Function\r
-\r
-\r
-' Remove specified path from the system search path.\r
-\r
-Function SysPathRemove(InstallDir)\r
-\r
- Dim rc, curPath, rKey, sInstallDir, newPath\r
-\r
- ' On Error Resume Next\r
- ' sInstallDir = Session.Property("INSTALLDIR")\r
-\r
- sInstallDir = ";" & ChopChar(InstallDir,"\")\r
-\r
- curPath = ReadSysPath\r
- If IsNull(curPath) Then\r
- SysPathRemove = ShowErr2("SysPathRemove - ReadSysPath() = NULL?")\r
- Exit Function\r
- End if\r
-\r
- SysPathRemove = 0 ' assume SUCCESS\r
-\r
- start = instr(curPath,sInstallDir)\r
- If start <> 0 Then\r
- ' INSTALLDIR IS in the system search path\r
- ' remove INSTALLDIR from system search path\r
- s0 = Left(curPath,start-1)\r
- s1 = Right(curPath,Len(curPath) - (start+Len(sInstallDir) - 1))\r
- NewPath = s0 & s1\r
- rc = WriteSysPath(NewPath)\r
- If rc <> 0 Then\r
- SysPathRemove = ShowErr2("SysPathRemove - WriteSysPath()")\r
- End if\r
- End if\r
-\r
-End Function\r
-\r
-\r
-\r
' not used\r
''''''''''' Check installation status ''''''''''''\r
\r
Dim sInstalldir\r
sInstalldir = Session.Property("INSTALLDIR")\r
Set WshShell = CreateObject("WScript.Shell")\r
- Set vstat = WshShell.Exec(sInstalldir & "\bin\vstat.exe")\r
+ Set vstat = WshShell.Exec(sInstalldir & "vstat.exe")\r
install_verify = vstat.ExitCode\r
End Function\r
\r
dim arrSize\r
arrSize = 0\r
for each dev in devs\r
- If Instr(dev,Tag) Then\r
+ If Instr(dev,Tag) <> 0 Then\r
arrSize = arrSize + 1\r
End if\r
next\r
Exit Function\r
End If\r
\r
- Find_Dev_by_Tag = devs\r
+ 'Create new array of selected devices\r
+ dim ibaDev()\r
+ Redim ibaDev(arrSize - 1)\r
+ index = 0\r
+ For each dev in devs\r
+ if (Instr(dev,Tag) <> 0) Then\r
+ ibaDev(index) = dev\r
+ index = index + 1\r
+ End if\r
+ Next\r
+\r
+ Find_Dev_by_Tag = ibaDev\r
\r
End Function\r
\r
cmd = dpinstVNIC & "/S /F /SA /PATH """ & sInstalldir & "qlgcvnic""" & _\r
" /SE /SW"\r
rc = WshShell.Run (cmd,0,true)\r
- If (rc AND DPINST_ERR) Then\r
- msgbox "ERR: qlgcvnic Install RC(" & rc & ") " & cmd\r
+ If (rc AND DPINST_INSTALLED) = 0 Then\r
+ dpinst_err "qlgcvnic Install failed",cmd,rc\r
dpinst_Install_VNIC = rc\r
End if\r
\r
\r
' Install SRP (SCSI RDMA Protocol) Driver\r
\r
+' QLogic Virtual FC I/O controller or\r
+' InfiniBand SRP Miniport: IBA\C0100C609EP0108 or IBA\CFF00C609EP0108\r
+' OFED SRP target: IBA\V000002P00005A44\r
+' one driver handles all three. Definition also used for SRP uninstall.\r
+\r
+SRP_IDS = Array(_\r
+ "IBA\V000002P00005A44",_\r
+ "IBA\C0100C609EP0108",_\r
+ "IBA\CFF00C609EP0108",_\r
+ "IBA\V00066AP00000038",_\r
+ "IBA\V000006P00006282")\r
+\r
Function devman_Install_SRP(WshShell,sInstalldir)\r
\r
Dim Devices,devID,rc,found\r
\r
- ' QLogic Virtual FC I/O controller or\r
- ' InfiniBand SRP Miniport: IBA\C0100C609EP0108 or IBA\CFF00C609EP0108\r
- ' OFED SRP target: IBA\V000002P00005A44\r
- ' one driver handles all three.\r
- SRP_IDS = Array(_\r
- "IBA\V000002P00005A44",_\r
- "IBA\C0100C609EP0108",_\r
- "IBA\CFF00C609EP0108",_\r
- "IBA\V00066AP00000038")\r
-\r
devmanSRP = "cmd.exe /c cd /d " & sInstalldir & "SRP & " & _\r
"..\IBcore\devman.exe "\r
Err.clear\r
& "SRP & ..\ibcore\dpinst.exe "\r
cmd = dpinstSRP & "/S /F /SA /PATH """ & sInstalldir & "SRP""" & " /SE /SW"\r
rc = WshShell.Run (cmd,0,true)\r
- If (rc AND DPINST_ERR) Then\r
- msgbox "ERR: SRP Install rc(" & rc & ") " & cmd\r
+ If (rc AND DPINST_INSTALLED) = 0 Then\r
+ dpinst_err "SRP Install failed",cmd,rc\r
dpinst_Install_SRP = rc\r
End if\r
\r
Const ERROR_FUNCTION_FAILED = 1627 ' function failed during execution \r
Const ERROR_SUCCESS_REBOOT_REQUIRED = 3010 ' restart required\r
\r
-Const DPINST_ERR = &H80000000\r
+' For the dpinst.exe error discussion see\r
+' http://msdn.microsoft.com/en-us/library/ms791066.aspx \r
+'\r
+' The dpinst.exe return code is a DWORD (0xWWXXYYZZ), where the meaning of\r
+' the four single-byte fields 0xWW, 0xXX, 0xYY, and 0xZZ are defined as follows\r
+\r
+' 0xWW If a driver package could not be installed, the 0x80 bit is set. If a\r
+' computer restart is necessary, the 0x40 bit is set. Otherwise, no bits\r
+' are set. \r
+' 0xXX The number of driver packages that could not be installed. \r
+' 0xYY The number of driver packages that were copied to the driver store but\r
+' were not installed on a device. \r
+' 0xZZ The number of driver packages that were installed on a device. \r
+\r
+Const DPINST_INSTALLED = &H000000FF\r
+\r
+Sub dpinst_err(umsg,cmd,err)\r
+\r
+ Dim I,S(4)\r
+\r
+ msg = umsg & " (status 0x" & Hex(err) & ") " & vbCrLf & vbCrLf & _\r
+ cmd & vbCrLf & _\r
+ " See %windir%dpinst.log for details" & vbCrLf & vbCrLf\r
+ For I = 0 To 3\r
+ S(I) = (err AND 255)\r
+ err = err / 256\r
+ Next\r
+ msg = msg & "Status Decode:" & vbCrLf\r
+ msg = msg & S(0) & " driver packages installed on a device" & vbcrlf & _\r
+ S(1) & " driver packages copied to the driver store and not installed on a device" & vbcrlf & _\r
+ S(2) & " driver packages not installed on a device" & vbcrlf\r
+ if S(3) = &H40 then\r
+ msg = msg & "[0x" & Hex(S(3)) & "] 0x40 reboot required." & vbcrlf\r
+ end if\r
+\r
+ msgbox msg,,"WinOF Installer"\r
+ \r
+End Sub\r
\r
\r
-Function dpinst_install(WshShell,sInstalldir,localSM,IPOIB,VNIC,SRP)\r
+Function dpinst_install(WshShell,sInstalldir,localSM,IPOIB,VNIC,SRP,DBG)\r
\r
Dim dpinst,dpinstNET,cmd,rc\r
\r
\r
rc = WshShell.Run (cmd,0,true)\r
\r
- If (rc AND DPINST_ERR) Then\r
- msgbox "dpinst_install - HCA driver Install failed(" & rc & ") " & cmd\r
- remove_INF_file WshShell,dpinst,"mthca"\r
- remove_INF_file WshShell,dpinst,"mlx4"\r
+ If (rc AND DPINST_INSTALLED) = 0 Then\r
+ dpinst_err "dpinst_install: HCA driver Install failed",cmd,rc\r
dpinst_install=ERROR_INSTALL_FAILURE\r
Exit Function\r
End if\r
\r
+ If DBG = "1" Then\r
+ dpinst_err "dpinst_install: HCA Install Status",cmd,rc\r
+ End If\r
+\r
' Check/install IPoIB driver\r
If IPOIB Then\r
cmd = dpinstNET & "/S /F /SA /PATH """ & sInstalldir & "net""" & _\r
" /SE /SW"\r
rc = WshShell.Run (cmd,0,true)\r
- If (rc AND DPINST_ERR) Then\r
- msgbox "IPoIB Install rc(" & rc & ") " & cmd\r
+ If (rc AND DPINST_INSTALLED) = 0 Then\r
+ dpinst_err "dpinst_install: IPoIB Install failed",cmd,rc\r
dpinst_install=ERROR_INSTALL_FAILURE\r
Exit Function\r
End if\r
End If\r
+\r
+ If DBG = "1" Then\r
+ dpinst_err "dpinst_install: IPoIB Install status",cmd,rc\r
+ End If\r
\r
' Start the Local OpenSM Subnet Manager service?\r
If localSM Then\r
\r
If VNIC Then\r
rc = dpinst_Install_VNIC(WshShell,sInstalldir)\r
+ If DBG = "1" Then\r
+ dpinst_err "dpinst_install: qlgcvnic Install status",cmd,rc\r
+ End If\r
End If\r
\r
If SRP Then\r
rc = dpinst_Install_SRP(WshShell,sInstalldir)\r
+ If DBG = "1" Then\r
+ dpinst_err "dpinst_install: SRP Install status",cmd,rc\r
+ End If\r
End If\r
\r
dpinst_install = 0\r
End Function\r
\r
\r
-Function devman_install(WshShell,Installdir,have_mthca,have_mlx4,localSM,IPOIB,VNIC,SRP)\r
+Function devman_install(WshShell,Installdir,have_mthca,have_mlx4,localSM,IPOIB,VNIC,SRP,DBG)\r
\r
Dim devman,cmd,Return,rc\r
\r
' Display error number and description if applicable\r
If Return <> 0 Then\r
msgbox "mlx4_hca Install Err(" & Return & ") " & cmd\r
- remove_INF_file WshShell,devman,"mlx4_"\r
devman_install=ERROR_INSTALL_FAILURE\r
Exit Function\r
End if\r
\r
If DrvInstalled <> true Then\r
msgbox "InfiniHost(mthca) Install Err(" & Return & ") " & cmd\r
- remove_INF_file WshShell,devman,"mthca"\r
devman_install=ERROR_INSTALL_FAILURE\r
Exit Function\r
End if\r
rc = WshShell.Run (cmd,0,true)\r
If rc <> 0 Then\r
msgbox "IPoIB Install Err(" & rc & ") " & cmd\r
- DriverUninstall\r
devman_install=ERROR_INSTALL_FAILURE\r
Exit Function\r
End If\r
End If\r
+ If DBG = "1" Then\r
+ msgbox "devman_install: IPoIB driver Installed.",,"WinOF Installer"\r
+ End If\r
\r
' IB I/O Unit driver installed only if required by VNIC or SRP.\r
\r
rc = WshShell.Run (devman & "update ib_iou.inf IBA\IB_IOU",0,true)\r
If rc <> 0 Then\r
msgbox "IOU Install Err(" & rc & ") update ib_iou.inf IBA\IB_IOU"\r
- DriverUninstall\r
devman_install=ERROR_INSTALL_FAILURE\r
Exit Function\r
End if\r
Dim devman, devmanEXE\r
Dim rc, cmd, CheckMode, sInstalldir, fso\r
Dim DrvInstalled, idev, mlxdev, dev, dev_list\r
- Dim WLH,IPOIB,SRP,VNIC,localSM\r
+ Dim VersionNT,IPOIB,SRP,VNIC,localSM\r
\r
On Error Resume Next\r
\r
'in defered action this is the way to pass arguments.\r
PropArray = Split(Session.Property("CustomActionData"), ";")\r
Else\r
- Redim PropArray(8)\r
+ Redim PropArray(9)\r
PropArray(0) = Session.Property("INSTALLDIR") \r
PropArray(1) = Session.Property("SystemFolder") \r
PropArray(2) = Session.Property("System64Folder") \r
PropArray(5) = Session.Property("ADDLOCAL")\r
PropArray(6) = Session.Property("REMOVE")\r
PropArray(7) = Session.Property("NODRV")\r
+ PropArray(8) = Session.Property("DBG")\r
End If\r
\r
' If cmd-line specified NODRV=1, then do not install drivers.\r
sInstalldir = PropArray(0)\r
VersionNT = PropArray(4)\r
InstallThis = PropArray(5)\r
+ DBG = PropArray(8)\r
\r
devman = "cmd.exe /c cd /d " & sInstalldir & "IBcore & devman.exe "\r
\r
\r
have_mlx4 = instr(InstallThis,"hca_connectX")\r
have_mthca = instr(InstallThis,"hca_mthca")\r
- IPOIB = instr(InstallThis,"fIPoIB")\r
+ IPOIB = instr(InstallThis,"fIPoIB")\r
+ localSM = instr(InstallThis,"fOSMS")\r
\r
- localSM = instr(InstallThis,"fOSMS")\r
- SRP = instr(InstallThis,"fSRP") _\r
+ SRP = instr(InstallThis,"fSRP") _\r
AND fso.FileExists(sInstalldir & "SRP\ib_srp.inf")\r
\r
- VNIC = instr(InstallThis,"fVNIC") _\r
+ VNIC = instr(InstallThis,"fVNIC") _\r
AND fso.FileExists(sInstalldir & "qlgcvnic\netvnic.inf")\r
\r
' Flag Windows LongHorn Install (aka Vista | Server 2008)\r
- If VersionNT >= 600 Then\r
- WLH = 1\r
- Else\r
- WLH = 0\r
- End if\r
-\r
- DriverInstall=0\r
\r
' Use DPINST.EXE for Svr 2008 & Vista Driver Install (Windows LongHorn)\r
' otherwise use devman.\r
\r
- If WLH Then\r
+ If VersionNT >= WindowsLongHorn Then\r
DriverInstall = dpinst_install(WshShell,sInstalldir,localSM,IPOIB,_\r
- VNIC,SRP)\r
+ VNIC,SRP,DBG)\r
Else\r
DriverInstall = devman_install(WshShell,sInstalldir,have_mthca,_\r
- have_mlx4,localSM,IPOIB,VNIC,SRP)\r
+ have_mlx4,localSM,IPOIB,VNIC,SRP,DBG)\r
+ End If\r
+\r
+ If DriverInstall <> 0 Then\r
+ find_remove_INF_file WshShell,devman,"ib_iou.cat"\r
+ find_remove_INF_file WshShell,devman,"ipoib.cat"\r
+ find_remove_INF_file WshShell,devman,"mthca.cat"\r
+ find_remove_INF_file WshShell,devman,"mlx4"\r
End If\r
\r
End Function\r
arrSize = arrSize + 1\r
End if\r
Next\r
+\r
+ If arrSize = 0 Then\r
+ Find_IBA_Devices = Null\r
+ Exit Function\r
+ End If\r
+ \r
'Creating array of IBA\ devices\r
dim ibaDev()\r
Redim ibaDev(arrSize - 1)\r
base = "cmd.exe /c reg query HKLM\SYSTEM\CurrentControlSet\Control\Network"\r
WinOS = Session.Property("VersionNT")\r
\r
- If (WinOS <> 501) Then\r
+ If (WinOS <> WindowsXP) Then\r
' Win2K3 style\r
cmd = base & " /f ""IBA\IPOIB"" /s /d | FIND ""Connection"" "\r
Else\r
\r
For each dev in ibaDevices\r
If dev = "" Then\r
- ElseIf WinOS <> 501 then\r
+ ElseIf WinOS <> WindowsXP then\r
' ibaDev(index) = dev\r
delstr = Left(dev,Len(dev)-Len("\Connection"))\r
ibaDev(index) = delstr\r
\r
' Remove 3rd party (OEM) driver package, identified by the string LookFor.\r
\r
-Function remove_INF_file(WshShell,exe,LookFor)\r
+Function find_remove_INF_file(WshShell,exe,LookFor)\r
\r
Dim cmd,cmdDM,use_dpinst,pfile\r
\r
On Error Resume Next \r
For Each file in IFILES\r
If (file <> "") Then\r
+' msgbox "find_remove_INF_file(" & LookFor & ") " & file\r
' most common is devman.exe \r
cmd = exe & " -f dp_delete " & file\r
if use_dpinst then\r
End IF\r
Next\r
\r
- remove_INF_file = 0\r
+ find_remove_INF_file = 0\r
+\r
+End Function\r
+\r
+\r
+Function remove_INF_file(WshShell,exe,file)\r
+\r
+ Dim cmd,cmdDM,use_dpinst,pfile\r
+\r
+ ' using dpinst.exe[WLH] or devman.exe[wnet/xp]?\r
+ use_dpinst = Instr(exe,"dpinst")\r
+\r
+' msgbox "remove_INF_File file " & file \r
+\r
+ On Error Resume Next \r
+\r
+ ' most common is devman.exe \r
+ cmd = exe & " -f dp_delete " & file\r
+ If use_dpinst Then\r
+ cmdDM = cmd\r
+ cmd = exe & " /U """ & file & """ /S /D"\r
+ end if\r
+\r
+' msgbox cmd \r
+ Return = WshShell.Run (cmd, 0, true)\r
+ if use_dpinst then\r
+ ' use devman.exe to delete all .inf referenced files\r
+ Return = WshShell.Run (cmdDM, 0, true)\r
+ end if\r
+\r
+ ' make sure the .inf & .pnf files are removed.\r
+ pfile = replace(file,".inf",".pnf")\r
+ FileDelete file\r
+ FileDelete pfile\r
+\r
+ find_remove_INF_file = 0\r
\r
End Function\r
\r
\r
+\r
+Sub cleanup_driver_files(fso,WshShell,sInstalldir,tool,VersionNT,devInfo)\r
+\r
+ Dim i,Flist,udfCnt\r
+\r
+ If IsNull(devInfo) Then\r
+ msgbox "cleanup_driver_files <null> devInfo?"\r
+ Exit Sub\r
+ End If\r
+\r
+ DBG = Session.Property("DBG")\r
+ If DBG = "1" Then\r
+ DisplayDevInfo devInfo\r
+ udfCnt = 0\r
+ Flist = ""\r
+ End If\r
+\r
+ ' Device Install Info\r
+ '(0) Device-ID\r
+ '(1) Device name\r
+ '(2) Fully qualified INF filename\r
+ '(3) count of files installed from .inf file.\r
+ '(4) thru (3) [fileCount] Fully qualified Installed driver filenames.\r
+\r
+ remove_INF_file WshShell,tool,devInfo(2)\r
+\r
+ For i=4 To DevInfo(3) + 3\r
+ ' skip the KMDF wdmcoinstaller*.dll file as we do not ref count here\r
+ ' and could break other installed KMDF drivers if removed.\r
+ If Instr(devinfo(i),"WdfCoInstaller") = 0 Then\r
+ DriverFileDelete fso,WshShell,devInfo(i),VersionNT\r
+ If DBG = "1" Then\r
+ If fso.FileExists(devInfo(i)) Then\r
+ Flist = Flist & " " & devInfo(i) & vbCrLf\r
+ udfCnt = udfCnt + 1\r
+ End If\r
+ End If\r
+ End If\r
+ Next\r
+\r
+ If DBG = "1" Then\r
+ msgbox "Remaining Driver files " & udfCnt & vbCrLf & Flist\r
+ End If\r
+\r
+End Sub\r
+\r
+\r
' Not used - run the specified command during next startup.\r
\r
Function RunAtReboot(name,run_once_cmd)\r
RunAtReboot = 0\r
End Function\r
\r
+' DEBUG\r
+Sub DisplayDevInfo(DevInfo)\r
+\r
+ Dim i,devs\r
+\r
+ If IsNull(DevInfo) Then\r
+ Exit Sub\r
+ End If\r
+ devs = ""\r
+ For i=4 To DevInfo(3) + 3\r
+ devs = devs & " " & DevInfo(i) & vbCRLF \r
+ Next\r
+\r
+ msgbox "[DeviceID] " & DevInfo(0) & vbCRLF &_\r
+ "[DeviceName] " & DevInfo(1) & vbCRLF &_\r
+ "[INF filename] " & DevInfo(2) & vbCRLF &_\r
+ "[INF installed files] " & DevInfo(3) & vbCRLF &_\r
+ devs\r
+End Sub\r
+\r
+\r
+Function GetDeviceInstallInfo(WshShell,sInstalldir,Dev)\r
+\r
+ Dim devman,tmp,s,StrStart,StrEnd,FileCnt,INF\r
+\r
+ devman = "cmd.exe /c cd /d " & sInstalldir & _\r
+ "IBcore & devman.exe driverfiles ""@"\r
+\r
+ Set connExec = WshShell.Exec(devman & Dev & """")\r
+ cmdout = split(connExec.StdOut.ReadAll, vbCrLF)\r
+ If IsNull(cmdout) Then\r
+ GetDeviceInstallInfo = Null\r
+ Exit Function\r
+ End If\r
+\r
+ StrStart = InStr(1,cmdout(2),"installed from ") + 15\r
+ If StrStart <= 15 Then\r
+ GetDeviceInstallInfo = Null\r
+ Exit Function\r
+ End If\r
+\r
+ StrEnd = InStr(StrStart,cmdout(2),"[") - 1\r
+ INF = mid(cmdout(2),StrStart,StrEnd-StrStart)\r
+\r
+ StrStart = InStr(StrEnd,cmdout(2),"]. ") + 3\r
+ StrEnd = InStr(StrStart,cmdout(2)," file")\r
+ FileCnt = CInt(mid(cmdout(2),StrStart,StrEnd-StrStart))\r
+\r
+ '(0) Device-ID\r
+ '(1) Device name\r
+ '(2) Fully qualified INF filename\r
+ '(3) count of files installed from .inf file.\r
+ '(4) thru (3) [fileCount] Fully qualified Installed driver filenames.\r
+\r
+ dim ibaDev()\r
+ Redim ibaDev(3+FileCnt)\r
+ ibaDev(0) = cmdout(0)\r
+ tmp = ltrim(cmdout(1))\r
+ s = Len(tmp) - (Instr(tmp,"Name: ") + 5)\r
+ ibaDev(1) = Right(tmp,s)\r
+ ibaDev(2) = INF\r
+ ibaDev(3) = FileCnt\r
+\r
+ ' (ibaDev(3) - 1) + 4 == ibaDev(3) + 3\r
+ For i=4 To FileCnt + 3\r
+ ibaDev(i) = ltrim(cmdout(i-1))\r
+ Next\r
+\r
+' DisplayDevInfo(ibaDev)\r
+\r
+ GetDeviceInstallInfo = ibaDev\r
+\r
+End Function\r
+\r
+\r
+\r
+' remove IB I/O Unit driver\r
+\r
+Sub Uninstall_IOU(fso,WshShell,devList,Installdir,VersionNT)\r
+\r
+ Dim devman,tool\r
+\r
+ RemoveDevice fso,WshShell,Installdir,devList,"InfiniBand I/O Unit",VersionNT\r
+\r
+ devman = "cmd.exe /c cd /d " & sInstalldir & "IBcore & devman.exe "\r
+\r
+ If VersionNT >= WindowsLongHorn Then\r
+ ' use dpinst.exe instead of devman.exe for Windows LongHorn++\r
+ tool = replace(devman,"devman","dpinst")\r
+ Else\r
+ tool = devman\r
+ End If\r
+\r
+ ' dpinst can install and not load the driver (no srp/vnic)\r
+ find_remove_INF_file WshShell,tool,"ib_iou.cat"\r
+\r
+End Sub\r
+\r
+\r
\r
' Remove QLogic VNIC instances\r
\r
Sub Uninstall_VNIC(fso,WshShell,devices,sInstalldir,VersionNT)\r
\r
- Dim devman,Return,device,dt,sDRIVERS,tool\r
+ Dim devman,Return,device,dt,sDRIVERS,tool,devInfo\r
\r
devman = "cmd.exe /c cd /d " & sInstalldir & "IBcore & devman.exe "\r
\r
If IsNull(devices) Then\r
' create a list of IBA\* devices via "devcon find"\r
devices = Find_IBA_Devices(WshShell,sInstalldir)\r
+ If IsNull(devices) Then\r
+ msgbox "Uninstall_VNIC - unable to find IBA devices?"\r
+ Exit Sub\r
+ End If\r
End If\r
\r
+ devInfo = Null\r
For each devTarget in devices\r
If (Instr(devTarget,"IBA\V00066AP00000030")) Then\r
device = split(devTarget, ":")\r
dt = rtrim(device(0))\r
+ If IsNull(devInfo) Then\r
+ devInfo = GetDeviceInstallInfo(WshShell,sInstalldir,dt)\r
+ End If\r
' disable instance - double quote complex device name for success.\r
Return = WshShell.Run (devman & "disable ""@" & dt & """", 0, true)\r
' Removing the Qlogic Vnic I/O Unit\r
End if\r
Next\r
\r
- If VersionNT >= 600 Then\r
- tool = "cmd.exe /c cd /d " & sInstalldir & "IBcore & dpinst.exe "\r
+ If VersionNT >= WindowsLongHorn Then\r
+ ' use dpinst.exe instead of devman.exe for Windows LongHorn++\r
+ tool = replace(devman,"devman","dpinst")\r
Else\r
tool = devman\r
End If\r
\r
- remove_INF_file WshShell,tool,"qlgcvnic.sys"\r
+ If IsNull(devInfo) Then\r
+ find_remove_INF_file WshShell,tool,"netvnic.cat"\r
+ Exit Sub\r
+ End If\r
\r
- sDRIVERS = Session.Property("WindowsFolder") & "system32\drivers\"\r
- DriverFileDelete fso,WshShell,sDRIVERS & "vnic.sys"\r
- DriverFileDelete fso,WshShell,sDRIVERS & "qlgcvnic.sys"\r
+ cleanup_driver_files fso,WshShell,sInstalldir,tool,VersionNT,devInfo\r
\r
End Sub\r
\r
\r
Sub Uninstall_SRP(fso,WshShell,devices,sInstalldir,VersionNT)\r
\r
- Dim devman,devmanRMAT,devmanDAAT,Return,device,sDRIVERS,tool\r
+ Dim devman,devmanRMAT,devmanDAAT,Return,device,sDRIVERS,tool,devInfo\r
\r
' QLogic Virtual FC I/O controller or\r
' InfiniBand SRP Miniport: IBA\C0100C609EP0108 or IBA\CFF00C609EP0108\r
' one driver handles all three.\r
- DID = Array(_\r
- "IBA\V000002P00005A44",_\r
- "IBA\C0100C609EP0108",_\r
- "IBA\CFF00C609EP0108",_\r
- "IBA\V00066AP00000038")\r
+ ' See previous SRP_IDS definition @ Install_SRP.\r
\r
devman = "cmd.exe /c cd /d " & sInstalldir & "IBcore & devman.exe "\r
devmanRMAT = devman & "remove @"\r
devmanDAAT = devman & "disable @"\r
+ devInfo = Null\r
\r
If IsNull(devices) Then\r
' create a list of IBA\* devices via "devcon find"\r
devices = Find_IBA_Devices(WshShell,sInstalldir)\r
+ If IsNull(devices) Then\r
+ msgbox "Uninstall_SRP - unable to find IBA devices?"\r
+ Exit Sub\r
+ End If\r
End If\r
\r
' Remove SRP devices\r
' QLogic Virtual FC I/O controller instance?\r
' Either: IBA\C0100C609EP0108 or IBA\CFF00C609EP0108\r
' Linux SRP target: IBA\V000002P00005A44\r
- For each ID in DID\r
+ For each ID in SRP_IDS\r
For each deviceCan in devices\r
If Instr(deviceCan,ID) <> 0 Then\r
device = split(deviceCan, ":")\r
dt = rtrim(device(0))\r
+ If IsNull(devInfo) Then\r
+ devInfo = GetDeviceInstallInfo(WshShell,sInstalldir,dt)\r
+ End If\r
' disable the instance\r
Return = WshShell.Run (devmanDAAT & dt, 0, true)\r
' Removing SRP device\r
Return = WshShell.Run (devmanRMAT & dt, 0, true)\r
-'msgbox "Uninstall_SRP() " & devmanRMAT & dt & " rc " & Return\r
+' msgbox "Uninstall_SRP() " & devmanRMAT & dt & " rc " & Return\r
End if\r
Next\r
Next\r
\r
- If VersionNT >= 600 Then\r
+ If VersionNT >= WindowsLongHorn Then\r
' use dpinst.exe instead of devman.exe for Windows LongHorn++\r
tool = replace(devman,"devman","dpinst")\r
Else\r
tool = devman\r
End If\r
\r
- remove_INF_file WshShell,tool,"ibsrp.sys"\r
+ 'No SRP device - check/clear to be safe.\r
+ If IsNull(devInfo) Then\r
+ find_remove_INF_file WshShell,tool,"ibsrp.cat"\r
+ Exit Sub\r
+ End If\r
\r
- sDRIVERS = Session.Property("WindowsFolder") & "system32\drivers\"\r
- DriverFileDelete fso,WshShell,sDRIVERS & "ibsrp.sys"\r
+ cleanup_driver_files fso,WshShell,sInstalldir,tool,VersionNT,devInfo\r
\r
End Sub\r
\r
\r
-Sub RemoveDevice(WshShell,sInstalldir,DeviceTag)\r
+Sub RemoveDevice(fso,WshShell,sInstalldir,devList,DeviceTag,VersionNT)\r
\r
- dim devices,device,devman,devmanRMAT,devTarget,dt,Return\r
+ dim device,devman,devmanRMAT,devTarget,dt,Return,devInfo\r
\r
devman = "cmd.exe /c cd /d " & sInstalldir & "IBcore & devman.exe "\r
devmanRMAT = devman & "remove ""@"\r
+ devmanDAAT = devman & "disable ""@"\r
+ devInfo = Null\r
\r
- devices = Find_Dev_by_Tag(WshShell,devman,"findall",DeviceTag)\r
+ If IsNull(devList) Then\r
+ devList = Find_Dev_by_Tag(WshShell,devman,"findall",DeviceTag)\r
+ If IsNull(devList) Then\r
+ Exit Sub\r
+ End If\r
+ End If\r
\r
- If Not IsNull(devices) Then\r
+ For each devTarget in devList\r
+ If Instr(devTarget,DeviceTag) Then\r
+ device = split(devTarget, ":")\r
+ dt = rtrim(device(0))\r
+ If IsNull(devInfo) Then\r
+ devInfo = GetDeviceInstallInfo(WshShell,sInstalldir,dt)\r
+ End If\r
+ Return = WshShell.Run (devmanDAAT & dt & """", 0, true)\r
+ Return = WshShell.Run (devmanRMAT & dt & """", 0, true)\r
+ End if\r
+ Next\r
\r
- For each devTarget in devices\r
- If (Instr(devTarget,DeviceTag)) Then\r
- device = split(devTarget, ":")\r
- dt = rtrim(device(0))\r
- Return = WshShell.Run (devmanRMAT & dt & """", 0, true)\r
- End if\r
- Next\r
+ ' Only if a device was found\r
+ If IsNull(devInfo) Then\r
+ Exit Sub\r
+ End If\r
\r
- End if\r
+ If VersionNT >= WindowsLongHorn Then\r
+ ' use dpinst.exe instead of devman.exe for Windows LongHorn++\r
+ tool = replace(devman,"devman","dpinst")\r
+ Else\r
+ tool = devman\r
+ End If\r
+\r
+ cleanup_driver_files fso,WshShell,sInstalldir,tool,VersionNT,devInfo\r
\r
End Sub\r
\r
-Sub remove_all_HCA_devices(WshShell,sInstalldir)\r
\r
- RemoveDevice WshShell,sInstalldir,"MLX4\CONNECTX_HCA"\r
- RemoveDevice WshShell,sInstalldir,"PCI\VEN_15B3"\r
\r
-End Sub\r
+Sub remove_all_HCA_devices(fso,WshShell,sInstalldir,VersionNT)\r
\r
-Function Uninstall_IB_Devices(WshShell,fso,sInstalldir,VersionNT,sRemove)\r
+ Dim devman,tool\r
\r
- Dim devices, cmd, dpinst, devman, devmanRMAT, tool\r
+ devman = "cmd.exe /c cd /d " & Installdir & "IBcore & devman.exe "\r
\r
- devman = "cmd.exe /c cd /d " & sInstalldir & "IBcore & devman.exe "\r
+ ' Old (CoInstaller version) ibbus GUID - just in case.\r
+ Return = WshShell.Run (devman & "remove {94F41CED-78EB-407C-B5DF-958040AF0FD8",0,true)\r
\r
- devmanRMAT = devman & "remove @"\r
- devmanDAAT = devman & "disable @"\r
+ RemoveDevice fso,WshShell,sInstalldir,Null,"MLX4\CONNECTX_HCA",VersionNT\r
+\r
+ ' VEN_15B3 covers devices: mthca & mlx4_bus\r
+ RemoveDevice fso,WshShell,sInstalldir,Null,"PCI\VEN_15B3",VersionNT\r
+\r
+ If VersionNT >= WindowsLongHorn Then\r
+ ' use dpinst.exe instead of devman.exe for Windows LongHorn++\r
+ tool = replace(devman,"devman","dpinst")\r
+ Else\r
+ tool = devman\r
+ End If\r
+\r
+ find_remove_INF_file WshShell,tool,"mthca"\r
+ find_remove_INF_file WshShell,tool,"mlx4_hca"\r
+ find_remove_INF_file WshShell,tool,"mlx4_bus"\r
+\r
+ ' catch-all cleanup.\r
+ find_remove_INF_file WshShell,tool,"Mellanox"\r
+ find_remove_INF_file WshShell,tool,"InfiniBand"\r
+\r
+End Sub\r
+\r
+\r
+Function Uninstall_IB_Devices(fso,WshShell,Installdir,VersionNT)\r
+\r
+ Dim devList\r
\r
- If (fso.FileExists(sInstalldir & "IBcore\dpinst.exe") = False) Then\r
+ If (fso.FileExists(Installdir & "IBcore\dpinst.exe") = False) Then\r
Exit Function ' no reason to continue without the tool.\r
End if\r
\r
- If (fso.FileExists(sInstalldir & "IBcore\devman.exe") = False) Then\r
+ If (fso.FileExists(Installdir & "IBcore\devman.exe") = False) Then\r
Exit Function ' no reason to continue without the tool.\r
End if\r
\r
' create a list of IBA\* devices via "devcon find"\r
\r
- devices = Find_IBA_Devices(WshShell,sInstalldir)\r
-\r
- Uninstall_SRP fso,WshShell,devices,sInstalldir,VersionNT\r
+ devList = Find_IBA_Devices(WshShell,Installdir)\r
+ If Not IsNull(devices) Then\r
\r
- Uninstall_VNIC fso,WshShell,devices,sInstalldir,VersionNT\r
+ Uninstall_SRP fso,WshShell,devList,Installdir,VersionNT\r
\r
- ' remove IB I/O Unit driver\r
- For each devTarget in devices\r
- If (Instr(devTarget,"InfiniBand I/O Unit")) Then\r
- device = split(devTarget, ":")\r
- dt = rtrim(device(0))\r
- ' double-quote device name to ensure success.\r
- Return = WshShell.Run (devman & "disable ""@" & dt & """", 0, true)\r
- ' Removing the I/O Unit\r
- Return = WshShell.Run (devman & "remove ""@" & dt & """", 0, true)\r
- End if\r
- Next\r
+ Uninstall_VNIC fso,WshShell,devList,Installdir,VersionNT\r
\r
- ' remove IPoIB devices\r
+ ' remove I/O Unit driver\r
+ Uninstall_IOU fso,WshShell,devList,Installdir,VersionNT\r
\r
- For each devTarget in devices\r
- If (Instr(devTarget,"IBA\IPOIB")) Then\r
- device = split(devTarget, " ")\r
- dt = rtrim(device(0))\r
- ' no need to double-quote simple IPoIB device name.\r
- Return = WshShell.Run (devmanDAAT & dt, 0, true)\r
- ' Remove the IPoIB device instance\r
- Return = WshShell.Run (devmanRMAT & dt, 0, true)\r
- End if\r
- Next\r
+ ' remove IPoIB devices\r
+ RemoveDevice fso,WshShell,Installdir,devList,"IBA\IPOIB",VersionNT\r
\r
- remove_all_HCA_devices WshShell,sInstalldir\r
+ End If\r
\r
- ' Old (CoInstaller version) ibbus GUID - just in case.\r
- Return = WshShell.Run (devman & "remove {94F41CED-78EB-407C-B5DF-958040AF0FD8",0,true)\r
+ ' stop the openSM service in case it was started.\r
+ Return = WshShell.Run ("cmd.exe /c sc.exe stop opensm", 0, true)\r
\r
- ' remove 3rd party driver packages (ibsrp, vnic, ipoib, mthca, ConnectX)\r
- ' use dpinst.exe for Server 2008 & Vista as dpinst was used to install.\r
+ ' delete opensm service from registry\r
+ Return = WshShell.Run ("cmd.exe /c sc.exe delete opensm", 0, true)\r
\r
- If VersionNT >= 600 Then\r
- tool = "cmd.exe /c cd /d " & sInstalldir & "IBcore & dpinst.exe "\r
- Else\r
- tool = devman\r
- End If\r
+ remove_all_HCA_devices fso,WshShell,Installdir,VersionNT\r
\r
- remove_INF_file WshShell,tool,"ibiou"\r
- remove_INF_file WshShell,tool,"ipoib"\r
- remove_INF_file WshShell,tool,"mthca"\r
- remove_INF_file WshShell,tool,"mlx4_"\r
- \r
Uninstall_IB_Devices = 0\r
\r
End Function\r
sRemove = "ALL"\r
End If\r
\r
- If sVersionNT <> 501 AND fso.FileExists(sInstalldir & "installsp.exe") Then\r
- Return = WshShell.Run ("cmd.exe /c cd /d " & sInstalldir & _\r
- " & installsp.exe -r", 0, true)\r
- End If\r
-\r
If fso.FileExists(sInstalldir & "net\ndinstall.exe") Then\r
Return = WshShell.Run ("cmd.exe /c cd /d " & sInstalldir & _\r
" & net\ndinstall.exe -r", 0, true)\r
End If\r
\r
- ' stop the openSM service in case it was started.\r
- Return = WshShell.Run ("cmd.exe /c sc.exe stop opensm", 0, true)\r
-\r
- ' delete opensm service from registry\r
- Return = WshShell.Run ("cmd.exe /c sc.exe delete opensm", 0, true)\r
- If Err Then ShowError\r
+ If sVersionNT <> WindowsXP AND fso.FileExists(sInstalldir & "installsp.exe") Then\r
+ Return = WshShell.Run ("cmd.exe /c cd /d " & sInstalldir & _\r
+ " & installsp.exe -r", 0, true)\r
+ End If\r
\r
- Uninstall_IB_Devices WshShell,fso,sInstalldir,sVersionNT,sRemove\r
+ Uninstall_IB_Devices fso,WshShell,sInstalldir,sVersionNT\r
\r
' Remove Service entries from the registry\r
\r
\r
' In livefish mode, the above does not always work - just in case.\r
' remove reg entries for ConnectX, mthca, ibbus, mlx4 & ipoib\r
+\r
nukem = Array(_\r
"Control\Class\{58517E00-D3CF-40C9-A679-CEE5752F4491}",_\r
"Control\Class\{31B0B28A-26FF-4dca-A6FA-E767C7DFBA20}",_\r
' Return = WshShell.Run ("reg.exe delete HKLM\Software\Microsoft\Windows\currentVersion\DIFx\DriverStore\ipoib_* /f", 0, true)\r
'\r
\r
- ' remove all Local Area Connection which were constructed for IPoIB\r
- ' create a list of IBA\IPOIB Local Area Connections via 'reg query'\r
+ ' Remove all Local Area Connection registry entries which were constructed\r
+ ' for IPoIB. Next WinOF install gets same IPoIB local area connection\r
+ ' assignment.\r
+\r
Dim IPOIB_LAC\r
IPOIB_LAC = Find_IPOIB_LAC\r
\r
Next\r
\r
' remove driver installed files\r
- RemoveDriverFiles WshShell\r
+ RemoveDriverFiles fso,WshShell,sVersionNT \r
\r
Session.Property("REBOOT") = "FORCE" \r
err.clear \r
End Sub\r
\r
\r
-' Determine if an existing WinOF or openib-window installation is present.\r
-' If previous install exists, determined by registry entry for service/ibbus,\r
-' then uninstall and reboot.\r
+' Now that WIX+[Windows Installer] handle previous installs, this routine\r
+' only deletes lingering driver files which were not removed from the last\r
+' uninstall.\r
' Called in immediate mode, condition: INSTALL=1\r
\r
Function ChkInstallAndReboot()\r
- Const wshYes = 6\r
- Const wshNo = 7\r
- Const wshYesNoDialog = 4\r
- Const wshQuestionMark = 32\r
\r
- Dim status ' check if ibbus.sys exists, if not the reboot won't happen\r
- Dim fso, originalReboot\r
Set fso = CreateObject("Scripting.FileSystemObject") \r
- status = 0\r
- \r
Set WshShell = CreateObject("WScript.Shell")\r
- Return = WshShell.Run ("reg.exe query HKLM\SYSTEM\CurrentControlSet\Services\ibbus /v ImagePath", 0, true)\r
- If (Return = 0) And (Err.Number = 0) Then\r
- Status = Status + 1\r
- End if\r
- \r
- originalReboot = Session.Property("REBOOT")\r
-\r
- DriverUninstall\r
\r
- ' if we can't find registry entry, then no need to uninstall/restart.\r
- ' Proceed with installation\r
- If status = 0 then\r
- ' msgbox "No existing InfiniBand installation detected"\r
- Session.Property("REBOOT") = originalReboot \r
- Exit Function\r
- End if\r
- \r
- Dim sys_folder, drv_folder\r
- ' Idea here is to rename driver files to force a driver\r
- ' load failure upon next reboot so ensuing install will\r
- ' succeed.\r
- sys_folder = Session.Property("WindowsFolder") & "system32"\r
- drv_folder = sys_folder & "\drivers"\r
- \r
- If fso.FileExists(drv_folder & "\ibbus.sys") Then\r
- FileMove drv_folder & "\ibbus.sys",drv_folder & "\ibbus.sy1"\r
- End if\r
- If fso.FileExists(drv_folder & "\mthca.sys") Then\r
- FileMove drv_folder & "\mthca.sys",drv_folder & "\mthca.sy1"\r
- End if \r
- If fso.FileExists(sys_folder & "\ibinstaller.dll") Then\r
- FileMove sys_folder & "\ibinstaller.dll",sys_folder & "\ibinstaller1.dll"\r
- End if\r
+ VersionNT = Session.Property("VersionNT")\r
\r
- ' Notify the user an existing non WinOF IB installation was detected and\r
- ' the system will be rebooted.\r
- dim res\r
+ ' remove any lingering driver installed files\r
+ RemoveDriverFiles fso,WshShell,sVersionNT \r
\r
- res = WshShell.popup("Existing InfiniBand installation has been removed." _\r
- & vbCRLF & vbCRLF & "Automatic REBOOT in 10 seconds."_\r
- & vbCRLF & "Please re-install WinOF."_\r
- ,13,"WinOF - Existing InfiniBand installation Detected")\r
- \r
- 'run_once_cmd = Session.Property("SETUPEXEDIR") & "\setup.exe"\r
- 'RunAtReboot "WinOF", run_once_cmd\r
- \r
- ' the _Driver Uninstall call sets reboot=force. The ForceReboot action\r
- ' following this CustomAction will fire when reboot is set =force.\r
- ' The problem is we need to fail the installation so it cleans up, not\r
- ' a partial install, and still reboots - So far IS-12 doesn;t support\r
- ' this behavior.\r
-\r
- ScheduleLocalReboot\r
-\r
- ' Fail the install so cleanup occurs.\r
- ' Upon system restart, WinOF installation needs to be restarted \r
- ' consider a run-once invocation.\r
-\r
- ChkInstallAndReboot = 2 ' will force install cleanup.\r
+ ChkInstallAndReboot = 0\r
\r
End Function\r
\r
\r
+\r
' Not Used - idea was to run %SystemRoot%\temp\WinOFcleanup.bat on the next\r
' reboot to remove driver files which did not get uninstalled (win2K3 only);\r
-' script ran, files persisted on Win2K3? WIX call to invoke this Sub was\r
-' removed.\r
+' script ran, files persisted on Win2K3?\r
+\r
+Sub RunOnceCleanup(fso,sInstalldir)\r
\r
-Sub RunOnceCleanup\r
- Dim fso, sInstalldir, sTemp, cmd\r
- Set fso=CreateObject("Scripting.FileSystemObject") \r
+ Dim sTemp, cmd, script\r
\r
On Error Resume Next\r
\r
- sInstalldir = Session.Property("REMOVE")\r
- If sInstalldir <> "ALL" Then\r
- Exit Sub\r
+ If Session.Property("REMOVE") <> "ALL" Then\r
+ ' XXX\r
+ msgbox "RunOnceCleanup - not remove ALL?"\r
+ Exit Sub\r
End if\r
\r
- sInstalldir = Session.Property("INSTALLDIR")\r
+ script = "RunOnceWinOFcleanup.bat"\r
+ src = sInstalldir & "IBcore\" & script\r
\r
- If Not fso.FileExists(sInstalldir & "WinOFclean.bat") Then\r
- Exit Sub\r
+ If Not fso.FileExists(src) Then\r
+ msgbox "Missing " & src\r
+ Exit Sub\r
End if\r
\r
' copy WinOFclean.bat to %SystemRoot%\temp for runOnce cmd\r
- sTemp = fso.GetSpecialFolder(0) & "\temp\WinOFclean.bat"\r
+ sTemp = fso.GetSpecialFolder(0) & "\temp\" & script\r
+ If fso.FileExists(sTemp) Then\r
+ Err.clear\r
+ fso.DeleteFile(sTemp),True\r
+ End If\r
+\r
Err.clear\r
- fso.CopyFile sInstalldir & "WinOFclean.bat", sTemp \r
+ fso.CopyFile src, sTemp \r
If Err.Number = 0 Then\r
cmd = "cmd.exe /C " & sTemp\r
RunAtReboot "WinOF", cmd\r
' 2nd cmd to remove previous script.\r
- cmd = "cmd.exe /C del /F/Q " & sTemp\r
- RunAtReboot "WinOF2", cmd\r
+' XXX cmd = "cmd.exe /C del /F/Q " & sTemp\r
+' RunAtReboot "WinOF2", cmd\r
End if\r
\r
End Sub\r
\r
\r
+\r
' WIX has appended [INSTALLDIR] to the system search path via <Environment>.\r
' Unfortunately WIX does not _Broadcast_ to all top-level windows the registry\r
' Settings for '%PATH%' have changed. Run nsc to do the broadcast.\r
\r
RemoveFolder "C:\IBSDK"\r
\r
- ' WIX does this - SysPathRemove(sInstallDir)\r
-\r
End Sub\r
\r
\r
+\r
' NOT USED - deferred action to increment ticks while action is taking place\r
'\r
Function AddProgressInfo( )\r
\r
' Flag Windows LongHorn Install (aka Vista | Server 2008)\r
VersionNT = Session.Property("VersionNT")\r
- If VersionNT >= 600 Then\r
+ If VersionNT >= WindowsLongHorn Then\r
WLH = 1\r
Else\r
WLH = 0\r