]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[WinOF] RC3 changes
authorstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 24 May 2007 23:35:00 +0000 (23:35 +0000)
committerstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 24 May 2007 23:35:00 +0000 (23:35 +0000)
Do not install WSD on an XP system.

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

branches/WinOF/InstallShield/CustomActions.vbs

index ffb42f0d8d4694029f70c0f056b956cc0fdf2e49..b46f28d39d6b14df4aad100397add7d674b4c3fa 100644 (file)
@@ -515,32 +515,33 @@ End Function
 ''''''''''' 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
@@ -604,11 +605,10 @@ Sub DriverUninstall()
       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
@@ -631,26 +631,28 @@ Sub DriverUninstall()
       ' 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
@@ -658,7 +660,7 @@ Sub ShowError()
        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
@@ -666,33 +668,40 @@ End Sub
 ' 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