From: stansmith Date: Fri, 11 May 2007 23:06:16 +0000 (+0000) Subject: [WinOF] RC2 changes X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=10103028b51fa1548ad4b5310c9fb494fec42778;p=~shefty%2Frdma-win.git [WinOF] RC2 changes 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 --- diff --git a/branches/WinOF/InstallShield/CustomActions.vbs b/branches/WinOF/InstallShield/CustomActions.vbs index c9a207c4..15d1c63c 100644 --- a/branches/WinOF/InstallShield/CustomActions.vbs +++ b/branches/WinOF/InstallShield/CustomActions.vbs @@ -539,15 +539,14 @@ End Sub ''''''''''' Driver Uninstall '''''''''''' Sub DriverUninstall() - on error resume next - MTARCH = Architecture - Dim sInstalldir sInstalldir = Session.Property("INSTALLDIR") Set WshShell = CreateObject("WScript.Shell") Dim fso Set fso = CreateObject("Scripting.FileSystemObject") + MTARCH = Architecture + ' if WSD enabled, then shut down the service If fso.FileExists(sInstalldir & "installsp.exe") Then Return = WshShell.Run ("cmd.exe /c cd " & sInstalldir & " & installsp.exe -r", 0, true) @@ -571,11 +570,11 @@ Sub DriverUninstall() ' Remove IPoIB Adapter instances for each deviceCan in devices - if (Instr(deviceCan,"IBA\IPOIB") = 1) Then + if (Instr(deviceCan,"IBA\IPOIB")) Then device = split(deviceCan, " ") ' Removing Return = WshShell.Run ("cmd.exe /c cd " & sInstalldir & "IBcore & devman.exe remove @" & device(0), 0, true) - End if + End if Next ' Removing SRP - Searching for I/O UNIT and then removing it. @@ -583,7 +582,7 @@ Sub DriverUninstall() if (Instr(deviceCan,"InfiniBand I/O Unit")) Then device = split(deviceCan, " ") ' Removing I/O Unit of the SRP - Return = WshShell.Run ("cmd.exe /c cd " & sInstalldir & " & IBcore\devman.exe remove @" & device(0), 0, true) + Return = WshShell.Run ("cmd.exe /c cd " & sInstalldir & "IBcore & devman.exe remove @" & device(0), 0, true) End if Next @@ -592,18 +591,35 @@ Sub DriverUninstall() if (Instr(deviceCan,"SRP")) Then device = split(deviceCan, " ") ' Removing SRP - Return = WshShell.Run ("cmd.exe /c cd " & sInstalldir & " & IBcore\devman.exe remove @" & device(0), 0, true) + Return = WshShell.Run ("cmd.exe /c cd " & sInstalldir & "IBcore & devman.exe remove @" & device(0), 0, true) End if Next - ' Remove BUS/Fabric driver - Return = WshShell.Run ("cmd.exe /c cd " & sInstalldir & "IBcore & devman.exe remove {94f41ced-78eb-407c-b5df-958040af0fd8}", 0, true) - ' Display error number and description if applicable + Set objWshScriptExec = wshShell.Exec("cmd.exe /c " & sInstalldir & "IBcore & devman.exe FindAll * | FIND ""IPOIB""") + If Err Then ShowError + Set objStdOut = objWshScriptExec.StdOut + + While Not objStdOut.AtEndOfStream + strLine = objStdOut.ReadLine + device = split(strLine, " ") + Return = wshShell.run("cmd.exe /c cd " & sInstallDir & "IBcore & devman.exe remove @" & device(0),0,true) + Wend + + ' Remove InfiniBand Bus/Fabric class driver + + Set objWshScriptExec = wshShell.Exec("cmd.exe /c cd " & sInstalldir & "IBcore & devman.exe FindAll * | FIND ""InfiniBand Fabric""") If Err Then ShowError + Set objStdOut = objWshScriptExec.StdOut + + While Not objStdOut.AtEndOfStream + strLine = objStdOut.ReadLine + device = split(strLine, " ") + Return = wshShell.Run("cmd.exe /c cd " & sInstalldir & "IBcore & devman.exe remove @" & device(0),0,true) + If Err Then ShowError + Wend ' Remove HCAs Return = WshShell.Run ("cmd.exe /c cd " & sInstalldir & "IBcore & devman.exe remove PCI\VEN_15b3", 0, true) - ' Display error number and description if applicable If Err Then ShowError ' Remove Service entries from the registry @@ -711,6 +727,11 @@ End Sub ' Called in immediate mode, condition: INSTALL=1 Function ChkInstallAndReboot() + Const wshYes = 6 + Const wshNo = 7 + Const wshYesNoDialog = 4 + Const wshQuestionMark = 32 + Dim status ' check if ibbus.sys exists, if not the reboot won't happen Dim fso Set fso = CreateObject("Scripting.FileSystemObject") @@ -725,29 +746,26 @@ Function ChkInstallAndReboot() ' if we can't find registry entry, then no need to uninstall/restart. ' Proceed with installation If status = 0 then - 'msgbox "No existing InfiniBand installation detected" + ' msgbox "No existing InfiniBand installation detected" Exit Function End if - ' Uninstall the existing WinOF/openib-windows installation and reboot - ' upon restart, WinOF installation will resume. + ' Notify the user an existing non WinOF IB installation was detected and + ' the system will be rebooted. + dim res + + res = WshShell.Popup("Existing InfiniBand installation has been removed.",12,"WinOF - Existing InfiniBand installation Detected") + + ' proceed with Uninstall and reboot. + ' Upon system restart, WinOF installation needs to be restarted + ' consider a run-once invocation. DriverUninstall - ' Rebooting the system - - dim res ' return result of restart question - - 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") - If res <> 6 Then ' answer = No - ChkInstallAndReboot = 1 - Exit Function - End if - ChkInstallAndReboot = 0 - ' the driveruninstall call sets reboot=force, ForceReboot action - ' following this one will fire when reboot is set =force. + ' the _Driver Uninstall call sets reboot=force. The ForceReboot action + ' following this CustomAction will fire when reboot is set =force. End Function