]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[WinOF] RC2 changes
authorstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 11 May 2007 23:06:16 +0000 (23:06 +0000)
committerstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Fri, 11 May 2007 23:06:16 +0000 (23:06 +0000)
Added notifier box timeout encounted when non-WinOF IB installation was detected. Timeout allows unattended install to proceed without human intervention.

git-svn-id: svn://openib.tc.cornell.edu/gen1@661 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

branches/WinOF/InstallShield/CustomActions.vbs

index c9a207c4e5494bda454a9cee4641728f60cba969..15d1c63c4da699bc7ad797af934decc394743993 100644 (file)
@@ -539,15 +539,14 @@ End Sub
 ''''''''''' Driver Uninstall ''''''''''''\r
 \r
 Sub DriverUninstall()  \r
-      on error resume next\r
-      MTARCH = Architecture\r
-      \r
       Dim sInstalldir\r
       sInstalldir = Session.Property("INSTALLDIR")\r
       Set WshShell = CreateObject("WScript.Shell")\r
       Dim fso\r
       Set fso = CreateObject("Scripting.FileSystemObject")\r
 \r
+      MTARCH = Architecture \r
+\r
          ' if WSD enabled, then shut down the service\r
       If fso.FileExists(sInstalldir & "installsp.exe") Then\r
        Return = WshShell.Run ("cmd.exe /c cd " & sInstalldir & " & installsp.exe -r", 0, true)\r
@@ -571,11 +570,11 @@ Sub DriverUninstall()
       \r
       ' Remove IPoIB Adapter instances\r
          for each deviceCan in devices\r
-               if (Instr(deviceCan,"IBA\IPOIB") = 1) Then\r
+               if (Instr(deviceCan,"IBA\IPOIB")) Then\r
                        device = split(deviceCan, " ")\r
                        ' Removing\r
                Return = WshShell.Run ("cmd.exe /c cd " & sInstalldir & "IBcore & devman.exe remove @" & device(0), 0, true)\r
-               End if\r
+               End if\r
          Next\r
 \r
          ' Removing SRP - Searching for I/O UNIT and then removing it.\r
@@ -583,7 +582,7 @@ Sub DriverUninstall()
                if (Instr(deviceCan,"InfiniBand I/O Unit")) Then\r
                        device = split(deviceCan, " ")\r
                        ' Removing I/O Unit of the SRP\r
-               Return = WshShell.Run ("cmd.exe /c cd " & sInstalldir & " & IBcore\devman.exe remove @" & device(0), 0, true)\r
+               Return = WshShell.Run ("cmd.exe /c cd " & sInstalldir & "IBcore & devman.exe remove @" & device(0), 0, true)\r
                End if\r
          Next\r
          \r
@@ -592,18 +591,35 @@ Sub DriverUninstall()
                if (Instr(deviceCan,"SRP")) Then\r
                        device = split(deviceCan, " ")\r
                        ' Removing SRP\r
-                       Return = WshShell.Run ("cmd.exe /c cd " & sInstalldir & " & IBcore\devman.exe remove @" & device(0), 0, true)\r
+                       Return = WshShell.Run ("cmd.exe /c cd " & sInstalldir & "IBcore & devman.exe remove @" & device(0), 0, true)\r
                End if\r
          Next\r
 \r
-      ' Remove BUS/Fabric driver\r
-      Return = WshShell.Run ("cmd.exe /c cd " & sInstalldir & "IBcore & devman.exe remove {94f41ced-78eb-407c-b5df-958040af0fd8}", 0, true)\r
-      ' Display error number and description if applicable\r
+      Set objWshScriptExec = wshShell.Exec("cmd.exe /c " & sInstalldir & "IBcore & devman.exe FindAll * | FIND ""IPOIB""")\r
+      If Err Then ShowError\r
+      Set objStdOut = objWshScriptExec.StdOut\r
+\r
+      While Not objStdOut.AtEndOfStream\r
+          strLine = objStdOut.ReadLine\r
+          device = split(strLine, " ")\r
+          Return = wshShell.run("cmd.exe /c cd " & sInstallDir & "IBcore & devman.exe remove @" & device(0),0,true)\r
+      Wend\r
+\r
+      ' Remove InfiniBand Bus/Fabric class driver\r
+\r
+      Set objWshScriptExec = wshShell.Exec("cmd.exe /c cd " & sInstalldir & "IBcore & devman.exe FindAll * | FIND ""InfiniBand Fabric""")\r
       If Err Then ShowError\r
+      Set objStdOut = objWshScriptExec.StdOut\r
+\r
+      While Not objStdOut.AtEndOfStream\r
+          strLine = objStdOut.ReadLine\r
+          device = split(strLine, " ")\r
+          Return = wshShell.Run("cmd.exe /c cd " & sInstalldir & "IBcore & devman.exe remove @" & device(0),0,true)\r
+          If Err Then ShowError\r
+      Wend\r
 \r
       ' Remove HCAs\r
       Return = WshShell.Run ("cmd.exe /c cd " & sInstalldir & "IBcore & devman.exe remove PCI\VEN_15b3", 0, true)\r
-      ' Display error number and description if applicable\r
       If Err Then ShowError\r
 \r
       ' Remove Service entries from the registry\r
@@ -711,6 +727,11 @@ End Sub
 ' 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\r
     Set fso = CreateObject("Scripting.FileSystemObject")    \r
@@ -725,29 +746,26 @@ Function ChkInstallAndReboot()
        ' 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
+               ' msgbox "No existing InfiniBand installation detected"\r
                Exit Function\r
        End if\r
        \r
-       ' Uninstall the existing WinOF/openib-windows installation and reboot\r
-       ' upon restart, WinOF installation will resume.\r
+       ' Notify the user an existing non WinOF IB installation was detected and\r
+    ' the system will be rebooted.\r
+       dim res\r
+       \r
+    res = WshShell.Popup("Existing InfiniBand installation has been removed.",12,"WinOF - Existing InfiniBand installation Detected") \r
+\r
+    ' proceed with Uninstall and reboot.\r
+       ' Upon system restart, WinOF installation needs to be restarted \r
+       ' consider a run-once invocation.\r
 \r
     DriverUninstall\r
 \r
-       ' Rebooting the system\r
-               \r
-       dim res  ' return result of restart question\r
-       \r
-       res = msgbox("An existing InfiniBand installation has been detected and will be uninstalled - To complete the WinOF installation you must restart your computer and then restart the WinOF Installation." & vbCrLf,vbYesNo + vbDefaultButton1,"WinOF")\r
-       If res <> 6 Then    ' answer = No\r
-               ChkInstallAndReboot = 1\r
-               Exit Function\r
-       End if\r
-               \r
        ChkInstallAndReboot = 0\r
 \r
-       ' the driveruninstall call sets reboot=force, ForceReboot action\r
-       ' following this one will fire when reboot is set =force.\r
+       ' the _Driver Uninstall call sets reboot=force. The ForceReboot action\r
+       ' following this CustomAction will fire when reboot is set =force.\r
        \r
 End Function\r
 \r