''''''''''' Driver Uninstall ''''''''''''\r
\r
Sub DriverUninstall() \r
- Dim sInstalldir\r
+ Dim sInstalldir, WshShell, fso, devices\r
+\r
sInstalldir = Session.Property("INSTALLDIR")\r
+\r
Set WshShell = CreateObject("WScript.Shell")\r
- Dim fso\r
Set fso = CreateObject("Scripting.FileSystemObject")\r
\r
- MTARCH = Architecture \r
+ MTARCH = Architecture\r
+ \r
+ ' WSD doesn't work on XP and should NOT be installed; just in case.\r
+ ' if WSD installed, then it's enabled, shut down the service\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
+ If (Session.Property("VersionNT") <> 501) AND fso.FileExists(sInstalldir & "installsp.exe") Then\r
+ Return = WshShell.Run ("cmd.exe /c cd " & sInstalldir & " & installsp.exe -r", 0, true)\r
End If\r
- ' Display error number and description if applicable\r
- If Err Then ShowError\r
\r
- ' if opensm.service.txt exists - stop the service.\r
- ' Display error number and description if applicable\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 regisry\r
+ Return = WshShell.Run ("cmd.exe /c sc.exe delete opensm", 0, true)\r
+ If Err Then ShowError\r
+\r
If fso.FileExists(sInstalldir & "opensm.service.txt") Then\r
- Return = WshShell.Run ("cmd.exe /c sc.exe stop opensm", 0, true)\r
- ' delete opensm service from regisry\r
- Return = WshShell.Run ("cmd.exe /c sc.exe delete opensm", 0, true)\r
- If Err Then ShowError\r
- fso.DeleteFile(sInstalldir & "opensm.service.txt"),true\r
- End If\r
- \r
- dim devices \r
+ fso.DeleteFile(sInstalldir & "opensm.service.txt"),true\r
+ End if\r
+ \r
' create a list of IBA\ devices via 'devcon findall'\r
devices = FindDevices\r
\r
DeleteRegKey "System\CurrentControlSet\Services\mthca"\r
DeleteRegKey "System\CurrentControlSet\Services\ipoib"\r
\r
- 'DeleteRegKey "System\CurrentControlSet\Services\EventLog\Application\OpenSm"\r
DeleteRegValue "SYSTEM\CurrentControlSet\Control\CoDeviceInstallers" , "{58517E00-D3CF-40c9-A679-CEE5752F4491}"\r
DeleteRegKey "SYSTEM\CurrentControlSet\Control\Class\{58517E00-D3CF-40C9-A679-CEE5752F4491}" \r
\r
- ' in livefish mode the delete didn't suceed. So we delete it in another way\r
+ ' in livefish mode the delete didn't suceed, delete it in another way\r
Return = WshShell.Run ("reg.exe delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{58517E00-D3CF-40C9-A679-CEE5752F4491} /f", 0, true)\r
If Err Then ShowError\r
\r
' remove driver installed files\r
RemoveDriverFiles\r
\r
- Session.Property("REBOOT") = "FORCE"\r
- \r
+ Session.Property("REBOOT") = "FORCE" \r
err.clear \r
End Sub\r
\r
+' Enable WSD if installsp.exe was installed (feature Winsock direct selected).\r
+' For Windows XP, this CA should not be called as WSD is not supported on XP.\r
\r
Sub WSDEnable()\r
- Dim sInstalldir\r
+ Dim sInstalldir, WshShell, fso\r
+\r
sInstalldir = Session.Property("INSTALLDIR")\r
+\r
Set WshShell = CreateObject("WScript.Shell")\r
- \r
- Dim fso\r
Set fso = CreateObject("Scripting.FileSystemObject")\r
+\r
If fso.FileExists(sInstalldir & "installsp.exe") Then\r
- ' install the WinSockdirect service\r
- Return = WshShell.Run ("cmd.exe /c cd " & sInstalldir & " & installsp.exe -i", 0, true)\r
+ ' install the WinSockdirect service\r
+ Return = WshShell.Run ("cmd.exe /c cd " & sInstalldir & " & installsp.exe -i", 0, true)\r
End If\r
+\r
' Display error number and description if applicable\r
If Err Then ShowError\r
-\r
End Sub\r
\r
\r
strMsg = vbCrLf & "Error # " & Err.Number & vbCrLf & _\r
Err.Description & vbCrLf & vbCrLf\r
'Syntax\r
- WScript.Echo strMsg\r
+ Session.Message strMsg\r
End Sub\r
\r
\r
' Function will add registry key for the opensm service\r
\r
Sub OpensmServiceEvent()\r
- Dim sInstalldir\r
- Dim opensmPath\r
- Dim opensmService\r
- Dim WshShell\r
+ Dim sInstalldir,opensmPath,opensmService,WshShell,fso\r
+ Dim sc, StartMeUp\r
+\r
sInstalldir = Session.Property("INSTALLDIR")\r
opensmService = sInstalldir & "opensm.service.txt"\r
opensmPath = sInstalldir & "opensm.exe"\r
- Dim fso\r
+\r
Set fso = CreateObject("Scripting.FileSystemObject")\r
Set WshShell = CreateObject("WScript.Shell")\r
\r
- ' if opensm.service.txt exists then the install requestor\r
- ' has asked that opensm be run as a service.\r
+ ' opensm.exe is required\r
+ If Not fso.FileExists(opensmPath) Then\r
+ Exit Sub\r
+ End if\r
\r
- If Not fso.FileExists(opensmService) Then\r
- Exit sub\r
- End if\r
+ sc = "sc.exe create opensm binPath= """ &opensmPath _\r
+ & " -e --service"" DisplayName= ""InfiniBand Subnet Manager"" "\r
\r
- If fso.FileExists(opensmPath) Then\r
- Dim sc\r
- sc = "sc.exe create opensm binPath= """ &opensmPath & " -e --service"" start= auto DisplayName= ""InfiniBand Subnet Manager"" "\r
- Return = WshShell.Run ("cmd.exe /c " & sc, 0, true)\r
- sc = "sc.exe description opensm ""Configures and manage the InfiniBand Subnet"" "\r
- Return = WshShell.Run ("cmd.exe /c " & sc, 0, true)\r
+ ' start opesm as a Service?\r
+ If fso.FileExists(opensmService) Then\r
+ StartMeUp = True\r
+ sc = sc & "start= auto"\r
+ Else\r
+ StartMeUp = False\r
+ sc = sc & "start= disabled"\r
+ End if\r
+ Return = WshShell.Run ("cmd.exe /c " & sc, 0, true)\r
+ sc = "sc.exe description opensm ""Configures and manage the InfiniBand Subnet"" "\r
+ Return = WshShell.Run ("cmd.exe /c " & sc, 0, true)\r
+\r
+ ' Is opensm to be run as a service?\r
+ If StartMeUp Then\r
Return = WshShell.Run ("cmd.exe /c sc.exe start opensm", 0, true)\r
- End If\r
- If Err Then ShowError\r
+ End if\r
err.clear\r
End Sub\r
\r