[ofw] [PATCH] remove wide-spread VersionNT usage

Smith, Stan stan.smith at intel.com
Thu Mar 18 12:40:33 PDT 2010


Revision: 2741
Author: stansmith
Date: 11:16:19 AM, Thursday, March 18, 2010
Message:
[OFED] simplify code - remove wide-spread VersionNT usage.
When checking if HCA install is OK, skip warning if no HCA hardware in system (aka, SW only install).

signed-off-by: stan smith <stan.smith at intel.com>

----
Modified : /gen1/trunk/OFED/WIX/CustomActions.vbs

--- a/OFED/WIX/CustomActions.vbs        Thu Mar 18 11:13:47 2010
+++ b/OFED/WIX/CustomActions.vbs        Thu Mar 18 10:21:51 2010
@@ -1,5 +1,5 @@
 '/*
-' * Copyright (c) 2008 Intel Corporation.  All rights reserved.
+' * Copyright (c) 2010 Intel Corporation.  All rights reserved.
 ' *
 ' * This software is available to you under the OpenIB.org BSD license
 ' * below:
@@ -121,7 +121,7 @@
 ' A CA can only see Installer properties through pre-loaded 'CustomActionData'

 Sub WinOF_setup
-       dim VersionNT,Installed,AddLocal,use_this_HCA
+       dim VersionNT,Installed,AddLocal

        VersionNT = Session.Property("VersionNT")
        Installed = Session.Property("Installed")
@@ -133,7 +133,10 @@

        If AddLocal = "" AND Installed = "" Then
                ' Enable default features.
-               AddLocal = "IBcore,hca_mthca,fIPoIB,fWSD,fDAPL,fDatBASIC1,fDatBASIC2"
+               AddLocal = "IBcore,fIPoIB,fDAPL,fDatBASIC1,fDatBASIC2,fND"
+               If VersionNT <> WindowsXP Then
+                       AddLocal = AddLocal & ",fWSD"
+               End If
        End If

        If Session.Property("OSM") = "1" OR Session.Property("OSMS") = "1" Then
@@ -230,7 +233,7 @@
 End Function


-Sub DriverFileDelete(fso,WshShell,filename,VersionNT)
+Sub DriverFileDelete(fso,WshShell,filename)
     Err.clear
     If fso.FileExists(filename) Then
                ' allow continuation after 'permission denied' error
@@ -311,7 +314,7 @@
 ' Attempt to clean out driver installed files which fail to be uninstalled
 ' when the driver is uninstalled.

-Sub RemoveDriverFiles(fso,WshShell,VersionNT)
+Sub RemoveDriverFiles(fso,WshShell)

     Dim Win, sDRIVERS, sSYS32, sSYSWOW64
     Dim CheckMode, PropArray, sTemp
@@ -327,65 +330,66 @@
        sSYSWOW64 = Win & "SysWOW64\"
     sDRIVERS = sSYS32 & "drivers\"

-    DriverFileDelete fso,WshShell,sDRIVERS & "ibbus.sys",VersionNT
-    DriverFileDelete fso,WshShell,sDRIVERS & "mthca.sys",VersionNT
+    DriverFileDelete fso,WshShell,sDRIVERS & "ibbus.sys"
+    DriverFileDelete fso,WshShell,sDRIVERS & "mthca.sys"
     FileDeleteQ fso,sDRIVERS & "mthca.sy1"
-    DriverFileDelete fso,WshShell,sDRIVERS & "mlx4_bus.sys",VersionNT
-    DriverFileDelete fso,WshShell,sDRIVERS & "mlx4_hca.sys",VersionNT
-    DriverFileDelete fso,WshShell,sDRIVERS & "winverbs.sys",VersionNT
-    DriverFileDelete fso,WshShell,sDRIVERS & "winverbsd.sys",VersionNT
-    DriverFileDelete fso,WshShell,sDRIVERS & "winmad.sys",VersionNT
-    DriverFileDelete fso,WshShell,sDRIVERS & "winmadd.sys",VersionNT
-    DriverFileDelete fso,WshShell,sDRIVERS & "ipoib.sys",VersionNT
-    DriverFileDelete fso,WshShell,sDRIVERS & "ibiou.sys",VersionNT
-    DriverFileDelete fso,WshShell,sDRIVERS & "ibsrp.sys",VersionNT
-    DriverFileDelete fso,WshShell,sDRIVERS & "vnic.sys",VersionNT
-    DriverFileDelete fso,WshShell,sDRIVERS & "qlgcvnic.sys",VersionNT
+    DriverFileDelete fso,WshShell,sDRIVERS & "mlx4_bus.sys"
+    DriverFileDelete fso,WshShell,sDRIVERS & "mlx4_hca.sys"
+    DriverFileDelete fso,WshShell,sDRIVERS & "winverbs.sys"
+    DriverFileDelete fso,WshShell,sDRIVERS & "winverbsd.sys"
+    DriverFileDelete fso,WshShell,sDRIVERS & "winmad.sys"
+    DriverFileDelete fso,WshShell,sDRIVERS & "winmadd.sys"
+    DriverFileDelete fso,WshShell,sDRIVERS & "ipoib.sys"
+    DriverFileDelete fso,WshShell,sDRIVERS & "ibiou.sys"
+    DriverFileDelete fso,WshShell,sDRIVERS & "ibsrp.sys"
+    DriverFileDelete fso,WshShell,sDRIVERS & "vnic.sys"
+    DriverFileDelete fso,WshShell,sDRIVERS & "qlgcvnic.sys"

-    DriverFileDelete fso,WshShell,sSYS32 & "libibverbs.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "libibverbsd.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "winmad.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "winmadd.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "winverbs.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "winverbsd.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "ibal.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "ibald.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "ibal32.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "ibal32d.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "complib.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "complibd.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "cl32.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "cl32d.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "mthcau.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "mthcaud.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "mthca32.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "mthca32d.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "mlx4u.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "mlx4ud.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "mlx4u32.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "mlx4u32d.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "ibsrp.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "ibsrpd.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "IbInstaller.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "ibwsd.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "ibndprov.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "ibndprov32.dll",VersionNT
-    DriverFileDelete fso,WshShell,sSYS32 & "ndinstall.exe",VersionNT
+    DriverFileDelete fso,WshShell,sSYS32 & "libibverbs.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "libibverbsd.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "winmad.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "winmadd.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "winverbs.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "winverbsd.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "ibal.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "ibald.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "ibal32.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "ibal32d.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "complib.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "complibd.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "cl32.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "cl32d.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "mthcau.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "mthcaud.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "mthca32.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "mthca32d.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "mlx4u.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "mlx4ud.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "mlx4u32.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "mlx4u32d.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "ibsrp.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "ibsrpd.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "IbInstaller.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "ibwsd.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "ibndprov.dll"
+    DriverFileDelete fso,WshShell,sSYS32 & "ndinstall.exe"
+    DriverFileDelete fso,WshShell,sSYS32 & "wvndpov.dll"

        If fso.FolderExists(sSYSWOW64) Then
-               DriverFileDelete fso,WshShell,sSYSWOW64 & "ibal.dll",VersionNT
-               DriverFileDelete fso,WshShell,sSYSWOW64 & "ibald.dll",VersionNT
-               DriverFileDelete fso,WshShell,sSYSWOW64 & "complib.dll",VersionNT
-               DriverFileDelete fso,WshShell,sSYSWOW64 & "complibd.dll",VersionNT
-               DriverFileDelete fso,WshShell,sSYSWOW64 & "mthcau.dll",VersionNT
-               DriverFileDelete fso,WshShell,sSYSWOW64 & "mthcaud.dll",VersionNT
-               DriverFileDelete fso,WshShell,sSYSWOW64 & "mlx4u.dll",VersionNT
-               DriverFileDelete fso,WshShell,sSYSWOW64 & "mlx4ud.dll",VersionNT
-               DriverFileDelete fso,WshShell,sSYSWOW64 & "ibsrp.dll",VersionNT
-               DriverFileDelete fso,WshShell,sSYSWOW64 & "ibsrpd.dll",VersionNT
-               DriverFileDelete fso,WshShell,sSYSWOW64 & "IbInstaller.dll",VersionNT
-               DriverFileDelete fso,WshShell,sSYSWOW64 & "ibwsd.dll",VersionNT
-               DriverFileDelete fso,WshShell,sSYSWOW64 & "ibndprov.dll",VersionNT
+               DriverFileDelete fso,WshShell,sSYSWOW64 & "ibal.dll"
+               DriverFileDelete fso,WshShell,sSYSWOW64 & "ibald.dll"
+               DriverFileDelete fso,WshShell,sSYSWOW64 & "complib.dll"
+               DriverFileDelete fso,WshShell,sSYSWOW64 & "complibd.dll"
+               DriverFileDelete fso,WshShell,sSYSWOW64 & "mthcau.dll"
+               DriverFileDelete fso,WshShell,sSYSWOW64 & "mthcaud.dll"
+               DriverFileDelete fso,WshShell,sSYSWOW64 & "mlx4u.dll"
+               DriverFileDelete fso,WshShell,sSYSWOW64 & "mlx4ud.dll"
+               DriverFileDelete fso,WshShell,sSYSWOW64 & "ibsrp.dll"
+               DriverFileDelete fso,WshShell,sSYSWOW64 & "ibsrpd.dll"
+               DriverFileDelete fso,WshShell,sSYSWOW64 & "IbInstaller.dll"
+               DriverFileDelete fso,WshShell,sSYSWOW64 & "ibwsd.dll"
+               DriverFileDelete fso,WshShell,sSYSWOW64 & "ibndprov.dll"
+               DriverFileDelete fso,WshShell,sSYSWOW64 & "wvndprov.dll"
        End If

        If fso.FolderExists(Win & "lastgood" ) Then
@@ -399,10 +403,12 @@
        FileDeleteQ fso,Win & "lastgood\system32\winmadd.dll"

        FileDeleteQ fso,Win & "lastgood\system32\ibndprov.dll"
+       FileDeleteQ fso,Win & "lastgood\system32\wvndprov.dll"
        FileDeleteQ fso,Win & "lastgood\system32\ndinstall.exe"
        FileDeleteQ fso,Win & "lastgood\system32\ibwsd.dll"

        FileDeleteQ fso,Win & "lastgood\SysWOW64\ibndprov.dll"
+       FileDeleteQ fso,Win & "lastgood\SysWOW64\wvndprov.dll"
        FileDeleteQ fso,Win & "lastgood\SysWOW64\ibwsd.dll"
        FileDeleteQ fso,Win & "lastgood\SysWOW64\mthcau.dll"
        FileDeleteQ fso,Win & "lastgood\SysWOW64\mthcaud.dll"
@@ -767,7 +773,7 @@
     ' Get the value of INSTALLDIR - see WinOF_Setup
     CheckMode = Session.Property("CustomActionData")

-    If Not CheckMode = "" Then
+    If CheckMode <> "" Then
         'in defered action this is the way to pass arguments.
            PropArray = Split(Session.Property("CustomActionData"), ";")
     Else
@@ -819,23 +825,6 @@
                End If
        End If

-       ' HCA load failure?
-       ' Check for [SystemFolder]\complib.dll. If not preset then ConnectX HCA
-       ' driver failed to install; see mlx4_hca.inf. Complib.dll absence occurs
-       ' when ConnectX bus driver detects invalid Firmware hence does not create
-       ' the PDO for the ConnectX HCA device so PNP never loads the HCA driver and
-       ' complib.dll never gets installed.
-
-       If Not fso.FileExists(PropArray(1) & "complib.dll") Then
-               ' 10 sec timeout warning box.
-               WshShell.Popup "WARNING: Possible HCA Driver Startup Failure." _
-                       & vbCrLf & "  Consult the Windows System Event log! (mlx4_bus)",_
-                       10,"WinOF DriverInstall",vbInformation+vbSystemModal
-
-               MsiLogInfo "[DriverInstall] *** Possible HCA Driver Startup Failure" & _
-                                       vbCrLf & "[DriverInstall] ***   Consult System Event Log."
-       End If
-
        DriverInstall = 0

 End Function
@@ -852,7 +841,7 @@
 ' IB stack/drivers can be removed.

 Sub Remove_IB_Devices()
-       Dim WshShell, fso, sInstalldir, sVersionNT, rc
+       Dim WshShell, fso, sInstalldir, winDir, sVersionNT, rc

        Set WshShell = CreateObject("WScript.Shell")
        Set fso = CreateObject("Scripting.FileSystemObject")
@@ -864,10 +853,11 @@

        sInstalldir = Session.Property("INSTALLDIR")
        sVersionNT = Session.Property("VersionNT")
+       winDir = Session.Property("WindowsFolder")

-       If fso.FileExists(sInstalldir & "Drivers\net\ndinstall.exe") Then
-           rc = WshShell.Run ("cmd.exe /c cd /d " & sInstalldir & _
-                              "Drivers\net & ndinstall.exe -q -r", 0, true)
+       If fso.FileExists(winDir & "system32\ndinstall.exe") Then
+           cmd = "ndinstall -q -r winverbs & ndinstall -q -r ibal"
+           rc = WshShell.Run ("cmd.exe /c " & cmd, 0, true)
        End If

        ' WSD is not supported on XP and should NOT have been installed.
@@ -880,7 +870,7 @@
                End If
        End If

-       Uninstall_IB_Devices fso,WshShell,sInstalldir,sVersionNT
+       Uninstall_IB_Devices fso,WshShell,sInstalldir

 End Sub

@@ -1085,7 +1075,7 @@
 End Sub


-Sub cleanup_driver_files(fso,WshShell,sInstalldir,tool,VersionNT,devInfo)
+Sub cleanup_driver_files(fso,WshShell,sInstalldir,tool,devInfo)

        Dim i,Flist,udfCnt

@@ -1113,7 +1103,7 @@
                ' skip the KMDF wdmcoinstaller*.dll file as we do not ref count here
                ' and could break other installed KMDF drivers if removed.
                If Instr(devinfo(i),"WdfCoInstaller") = 0 Then
-               DriverFileDelete fso,WshShell,devInfo(i),VersionNT
+               DriverFileDelete fso,WshShell,devInfo(i)
                        If sDBG >= "1" Then
                                If fso.FileExists(devInfo(i)) Then
                                        Flist = Flist & "  " & devInfo(i) & vbCrLf
@@ -1220,9 +1210,9 @@

 ' remove IB I/O Unit driver

-Sub    Uninstall_IOU(fso,WshShell,devList,sInstalldir,VersionNT)
+Sub    Uninstall_IOU(fso,WshShell,devList,sInstalldir)

-       RemoveDevice fso,WshShell,sInstalldir,devList,"InfiniBand I/O Unit",VersionNT
+       RemoveDevice fso,WshShell,sInstalldir,devList,"InfiniBand I/O Unit"

 End Sub

@@ -1230,7 +1220,7 @@

 ' Remove QLogic VNIC instances

-Sub Uninstall_VNIC(fso,WshShell,devices,sInstalldir,VersionNT)
+Sub Uninstall_VNIC(fso,WshShell,devices,sInstalldir)

        Dim devman,Return,device,dt,sDRIVERS,tool,devInfo

@@ -1275,7 +1265,7 @@
                        "IBA\V000006P00006282")


-Sub Uninstall_SRP(fso,WshShell,devices,sInstalldir,VersionNT)
+Sub Uninstall_SRP(fso,WshShell,devices,sInstalldir)

        Dim devman,devmanRMAT,devmanDAAT,Return,device,sDRIVERS,tool,devInfo

@@ -1321,7 +1311,7 @@
 End Sub


-Sub RemoveDevice(fso,WshShell,sInstalldir,devList,DeviceTag,VersionNT)
+Sub RemoveDevice(fso,WshShell,sInstalldir,devList,DeviceTag)

        dim device,devman,devmanRMAT,devTarget,dt,Return,devInfo

@@ -1355,7 +1345,7 @@
 End Sub


-Sub Uninstall_IB_Devices(fso,WshShell,sInstalldir,VersionNT)
+Sub Uninstall_IB_Devices(fso,WshShell,sInstalldir)

        Dim devList

@@ -1373,19 +1363,15 @@

        devList = Find_IBA_Devices(WshShell,sInstalldir)
        If Not IsNull(devList) Then
+               Uninstall_SRP fso,WshShell,devList,sInstalldir

-               Uninstall_SRP fso,WshShell,devList,sInstalldir,VersionNT
-
-               Uninstall_VNIC fso,WshShell,devList,sInstalldir,VersionNT
+               Uninstall_VNIC fso,WshShell,devList,sInstalldir

                ' remove I/O Unit driver
-               Uninstall_IOU fso,WshShell,devList,sInstalldir,VersionNT
+               Uninstall_IOU fso,WshShell,devList,sInstalldir

                ' remove IPoIB devices
-               RemoveDevice fso,WshShell,sInstalldir,devList,"IBA\IPOIB",VersionNT
-
-       Else
-        msgbox "Uninstall_IB_Devices() <NULL> devList?"
+               RemoveDevice fso,WshShell,sInstalldir,devList,"IBA\IPOIB"
     End If

        ' stop the openSM service in case it was started.
@@ -1396,10 +1382,11 @@

        ' remove HCA devices

-       RemoveDevice fso,WshShell,sInstalldir,devList,"MLX4\CONNECTX_HCA",VersionNT
-
-       ' VEN_15B3 covers devices: mthca & mlx4_bus
-       RemoveDevice fso,WshShell,sInstalldir,devList,"PCI\VEN_15B3",VersionNT
+       If Not IsNull(devList) Then
+           RemoveDevice fso,WshShell,sInstalldir,devList,"MLX4\CONNECTX_HCA"
+           ' VEN_15B3 covers devices: mthca & mlx4_bus
+           RemoveDevice fso,WshShell,sInstalldir,devList,"PCI\VEN_15B3"
+    End If

 End Sub

@@ -1411,7 +1398,7 @@
 ' their IB stack references.

 Sub IB_DriverCleanup()
-       Dim sInstalldir, WshShell, fso, sVersionNT, sRemove,devman, tool
+       Dim sInstalldir, WshShell, fso, sRemove,devman, tool

        sInstalldir = Session.Property("INSTALLDIR")

@@ -1424,7 +1411,6 @@
        End If

        sDBG = Session.Property("DBG")
-       sVersionNT = Session.Property("VersionNT")

        sRemove = Session.Property("REMOVE")
        If sRemove = "" Then
@@ -1536,13 +1522,82 @@
        find_remove_INF_file WshShell,devman,"InfiniBand"

        ' remove driver installed files
-       RemoveDriverFiles fso,WshShell,sVersionNT
+       RemoveDriverFiles fso,WshShell

        err.clear

 End Sub


+' HCA load failure?
+' Check for [SystemFolder]\complib.dll. If not preset then ConnectX HCA
+' driver failed to install; see mlx4_hca.inf. Complib.dll absence occurs
+' when ConnectX bus driver detects invalid Firmware hence does not create
+' the PDO for the ConnectX HCA device so PNP never loads the HCA driver and
+' complib.dll never gets installed.
+' If features[IPoIB+(WinSockDirect OR NetworkDirect)] are installed, then
+' wait for IPoIB device to appear in order to ensure WSD and/or ND provider
+' instal success.
+
+Sub CheckDriversOK()
+    Dim winDir, WshShell, fso, AddLocal, too_long
+
+       Set WshShell = CreateObject("WScript.Shell")
+       Set fso = CreateObject("Scripting.FileSystemObject")
+
+       winDir = Session.Property("WindowsFolder")
+       sInstalldir = Session.Property("INSTALLDIR")
+       devman = "cmd.exe /c cd /d " & sInstalldir & "Drivers & devman.exe "
+       AddLocal = Session.Property("ADDLOCAL")
+
+       ' Check if HCA driver installed OK.
+       If Not fso.FileExists(winDir & "system32\complib.dll") Then
+               ' SW only install, such that there are no hardware HCAs avaiable?
+               devList = Find_Dev_by_Tag(WshShell,devman,"find","PCI\VEN_15B3")
+               If IsNull(devList) Then
+                       Exit Sub
+               End If
+
+               ' 10 sec timeout warning box.
+               WshShell.Popup "WARNING: Possible HCA Driver Startup Failure." _
+                       & vbCrLf & "  Consult the Windows System Event log! (mlx4_bus)",_
+                       10,"WinOF-Install CheckDriversOK",vbInformation+vbSystemModal
+
+               MsiLogInfo "[CheckDriversOK] ** Possible HCA Driver Startup Failure" & _
+                                       vbCrLf & "[CheckDriversOK] **   Consult System Event Log."
+           Exit Sub
+       End If
+
+       ' empty string implies default install Features which include IPoIB+WSD+ND.
+       If AddLocal <> "" Then
+               ' No wait if !IPoIB OR (!WinSockDirect AND !NetworkDirect)
+               If Instr(AddLocal,"fIPoIB") = 0 Then
+                       Exit Sub
+               End If
+               If Instr(AddLocal,"fWSD") = 0 AND Instr(AddLocal,"fND") = 0 Then
+                       Exit Sub
+               End If
+       End If
+
+       ' wait for IPoIB driver to start so ND and/or WSD can install
+
+       devList = Find_Dev_by_Tag(WshShell,devman,"find","IBA\IPOIB")
+    too_long = 0
+
+       Do While IsNull(devList)
+      WScript.Sleep 1000    ' milliseconds
+      ' Wait for device IPoIB to appear as it's required for WSD/ND install.
+         too_long = too_long
+         if too_long > 30 then
+               exit Do
+         End If
+         err.clear
+         devList = Find_Dev_by_Tag(WshShell,devman,"find","IBA\IPOIB")
+       Loop
+
+End Sub
+
+
 ' Enable WSD if installsp.exe was installed (feature Winsock direct selected).
 ' For Windows XP, this CustomAction should not be called as WSD is not
 ' supported on XP.
@@ -1573,18 +1628,23 @@
 ' See WIX src file - ND_start

 Sub ND_StartMeUp()
-    Dim Ret, sInstalldir, WshShell, fso
+    Dim Ret, sInstalldir, NDprovider, winDir, WshShell, fso

     sInstalldir = Session.Property("INSTALLDIR")

     Set WshShell = CreateObject("WScript.Shell")
     Set fso = CreateObject("Scripting.FileSystemObject")
+       winDir = Session.Property("WindowsFolder")

     ' Start the Network Direct Service if installed
-
-    If fso.FileExists(sInstalldir & "Drivers\net\ndinstall.exe") Then
-        Ret = WshShell.Run ("cmd.exe /c cd /d " & sInstalldir _
-                              & " & Drivers\net\ndinstall.exe -q -i", 0, true)
+    If fso.FileExists(winDir & "system32\ndinstall.exe") Then
+           ' ia64 only supports the ND/winverbs provider, otherwise use
+        ' ND/ibal provider.
+           NDprovider = "ibal"
+           If Architecture() = "ia64" Then
+                   NDprovider = "winverbs"
+           End If
+        Ret = WshShell.Run ("cmd.exe /c ndinstall -q -i " & NDprovider, 0, true)
         If Ret Then ShowErr2("ND service provider install failed")
     End If

@@ -1646,10 +1706,8 @@
                Exit Function
        End If

-       VersionNT = Session.Property("VersionNT")
-
        ' remove any lingering driver installed files
-       RemoveDriverFiles fso,WshShell,VersionNT
+       RemoveDriverFiles fso,WshShell

        ChkPreviousInstall = 0

@@ -1809,8 +1867,6 @@

     sInstalldir = Session.Property("INSTALLDIR")

-       VersionNT = Session.Property("VersionNT")
-
        On Error Resume Next

        ' Nothing to do for ADD as DIFxAPP has loaded drivers into Driver Store.
@@ -1820,12 +1876,12 @@
        If (Not IsNull(sRemove)) AND (sRemove <> "") Then

                If Instr(sRemove,"fSRP") Then
-                       Uninstall_SRP fso,WshShell,Null,sInstalldir,VersionNT
+                       Uninstall_SRP fso,WshShell,Null,sInstalldir
                        NeedReboot = NeedReboot + 1
                End If

                If Instr(sRemove,"fVNIC") Then
-                       Uninstall_VNIC fso,WshShell,Null,sInstalldir,VersionNT
+                       Uninstall_VNIC fso,WshShell,Null,sInstalldir
                        NeedReboot = NeedReboot + 1
                End If
        End If




More information about the ofw mailing list