''''''''''' 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
\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
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
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
' 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
' 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