]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[WinOF] WIX - de-tabbed in favor of spaces.
authorstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 2 Jul 2007 18:37:25 +0000 (18:37 +0000)
committerstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 2 Jul 2007 18:37:25 +0000 (18:37 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1@740 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

branches/WinOF/WIX/CustomActions.vbs

index f7fa5d75d7ec1f063a883e44532391a9bb0f6183..ec6e8713e383b5aacc12054a46b36fb39b78c2b6 100644 (file)
@@ -316,7 +316,7 @@ Function ReadSysPath
     strKeyPath="SYSTEM\CurrentControlSet\Control\Session Manager\Environment"\r
     strValueName = "Path"\r
     oReg.GetExpandedStringValue HKEY_LOCAL_MACHINE,_\r
-                                                                               strKeyPath, strValueName, strValue\r
+         strKeyPath, strValueName, strValue\r
 \r
     If (Err.Number = 0) And (Not IsNull(strValue)) Then\r
         ReadSysPath = strValue\r
@@ -336,7 +336,7 @@ Function WriteSysPath(NewPath)
     strKeyPath="SYSTEM\CurrentControlSet\Control\Session Manager\Environment"\r
     strValueName = "Path"\r
     oReg.SetExpandedStringValue _\r
-                               HKEY_LOCAL_MACHINE, strKeyPath, strValueName, NewPath\r
+         HKEY_LOCAL_MACHINE, strKeyPath, strValueName, NewPath\r
 \r
     WriteSysPath = Err.Number\r
 End Function\r
@@ -356,7 +356,7 @@ End Function
 \r
 ' Add specified path to the system search path registry entry @\r
 ' 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path'\r
-' Generally the path is [INSTALLDIR]\r
+' Normally the added path is [INSTALLDIR]\r
 ' Called from a defered exection context (aka, DriverInstall).\r
 \r
 Function SysPathAdd(InstallDir)\r
@@ -385,6 +385,7 @@ Function SysPathAdd(InstallDir)
     If rc <> 0 Then\r
         SysPathAdd = ShowErr2("SysPathAdd - WriteSysPath()")\r
     Else\r
+       ' TODO - Notify current windows of updated PATH registry value.\r
        SysPathAdd = 0\r
     End if\r
 \r
@@ -431,13 +432,12 @@ End Function
 ''''''''''' Check installation status ''''''''''''\r
 \r
 Function install_verify()\r
-    Dim Status\r
-       Dim sInstalldir\r
-       sInstalldir = Session.Property("INSTALLDIR")\r
+   Dim Status\r
+   Dim sInstalldir\r
+   sInstalldir = Session.Property("INSTALLDIR")\r
    Set WshShell = CreateObject("WScript.Shell")\r
    Set vstat = WshShell.Exec(sInstalldir & "\bin\vstat.exe")\r
    install_verify = vstat.ExitCode\r
-\r
 End Function\r
 \r
 '-------------------------------------------------------------\r
@@ -464,31 +464,34 @@ End Function
 \r
 ' Function to add registry DWORD val.\r
 Function AddRegDWORDValue(strKeyPath, strValueName, dwValue)\r
-const HKEY_LOCAL_MACHINE = &H80000002\r
-strComputer = "."\r
+    const HKEY_LOCAL_MACHINE = &H80000002\r
+    strComputer = "."\r
  \r
-Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ \r
-strComputer & "\root\default:StdRegProv")\r
+    Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ \r
+                       strComputer & "\root\default:StdRegProv")\r
+    If Err Then ShowError\r
  \r
-If Err Then ShowError\r
-oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue\r
-If Err Then ShowError\r
+    oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue\r
+\r
+    If Err Then ShowError\r
 \r
 End Function\r
 \r
 '-------------------------------------------------\r
 \r
 ' Function to add registry Expanded string val.\r
+\r
 Function AddRegExpandValue(strKeyPath, strValueName, dwValue)\r
-const HKEY_LOCAL_MACHINE = &H80000002\r
-strComputer = "."\r
+    const HKEY_LOCAL_MACHINE = &H80000002\r
+    strComputer = "."\r
  \r
-Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ \r
-strComputer & "\root\default:StdRegProv")\r
+    Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ \r
+            strComputer & "\root\default:StdRegProv")\r
  \r
-If Err Then ShowError\r
-oReg.SetExpandedStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue\r
-If Err Then ShowError\r
+    If Err Then ShowError\r
+    oReg.SetExpandedStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,_\r
+         dwValue\r
+    If Err Then ShowError\r
 \r
 End Function\r
 \r
@@ -522,29 +525,29 @@ Function DriverInstall()
     MTARCH = Architecture\r
    \r
     Dim PropArray\r
-       Dim CheckMode, sInstalldir, fso\r
+    Dim CheckMode, sInstalldir, fso\r
 \r
-       ' Get the value of INSTALLDIR\r
-       CheckMode = Session.Property("CustomActionData")\r
+    ' Get the value of INSTALLDIR\r
+    CheckMode = Session.Property("CustomActionData")\r
 \r
-       If Not CheckMode = "" Then\r
+    If Not CheckMode = "" Then\r
         'in defered action this is the way to pass arguments.\r
            PropArray = Split(Session.Property("CustomActionData"), ";")\r
-       Else\r
+    Else\r
         Redim PropArray(4)\r
                PropArray(0) = Session.Property("INSTALLDIR") \r
                PropArray(1) = Session.Property("SystemFolder") \r
        PropArray(2) = Session.Property("System64Folder") \r
                PropArray(3) = Session.Property("WindowsFolder")\r
-       End if\r
+    End if\r
 \r
-       sInstalldir = PropArray(0)\r
+    sInstalldir = PropArray(0)\r
        \r
     Uninstall_IB_Devices(sInstalldir) \r
 \r
-       RemoveDriverFiles\r
+    RemoveDriverFiles\r
    \r
-       Set WshShell = CreateObject("WScript.Shell")\r
+    Set WshShell = CreateObject("WScript.Shell")\r
     Set fso = CreateObject("Scripting.FileSystemObject")\r
        \r
     If Not fso.FileExists(sInstalldir & "IBcore\devman.exe") Then\r
@@ -555,7 +558,7 @@ Function DriverInstall()
     End if\r
 \r
     ' rescan system buses\r
-       Return = WshShell.Run ("cmd.exe /c cd " & sInstalldir & _\r
+    Return = WshShell.Run ("cmd.exe /c cd " & sInstalldir & _\r
                            "IBcore & devman.exe rescan", 0, true)\r
        ' Display error number and description if applicable\r
     If Err Then ShowError\r
@@ -597,38 +600,38 @@ Function DriverInstall()
        SYSWOW = PropArray(1)  \r
 \r
 ' following file copies relocated to .wxs file so they can be uninstalled \r
-' correctly, as this way the files reamin when uninstalled.\r
+' correctly, otherwise, using this approach the files reamin when uninstalled.\r
 \r
 if False then\r
-        msgbox "DriverInstall PA(1) " & SYSWOW & " PA(2) " & PropArray(2)\r
-               if fso.FileExists(sInstalldir & "IBcore\cl32.dll") then\r
-                       fso.CopyFile sInstalldir & "IBcore\cl32.dll", SYSWOW & "complib.dll"\r
-               end if\r
-               if fso.FileExists(sInstalldir & "IBcore\cl32d.dll") then\r
-                       fso.CopyFile sInstalldir & "IBcore\cl32d.dll", SYSWOW & "complibd.dll"\r
-               end if\r
-               if fso.FileExists(sInstalldir & "IBcore\ibal32.dll") then\r
-                       fso.CopyFile sInstalldir & "IBcore\ibal32.dll", SYSWOW & "ibal.dll"\r
-               end if\r
-               if fso.FileExists(sInstalldir & "IBcore\ibal32d.dll") then\r
-                       fso.CopyFile sInstalldir & "IBcore\ibal32d.dll", SYSWOW & "ibald.dll"\r
-               end if\r
-               if fso.FileExists(sInstalldir & "IBcore\mtuvpd32.dll") then\r
-                       fso.CopyFile sInstalldir & "IBcore\mtuvpd32.dll", SYSWOW & "mthcau.dll"\r
-               end if\r
-               if fso.FileExists(sInstalldir & "IBcore\mtuvpd32d.dll") then\r
-                       fso.CopyFile sInstalldir & "IBcore\mtuvpd32d.dll", SYSWOW & "mthcaud.dll"\r
-               end if\r
-               if fso.FileExists(sInstalldir & "net\ibwsd32.dll") then\r
-                       fso.CopyFile sInstalldir & "net\ibwsd32.dll", SYSWOW & "ibwsd.dll"\r
-               end if\r
-         end if  ' XXX\r
-    End If \r
-\r
-       ' append [INSTALLDIR] to system search path\r
+    msgbox "DriverInstall PA(1) " & SYSWOW & " PA(2) " & PropArray(2)\r
+    if fso.FileExists(sInstalldir & "IBcore\cl32.dll") then\r
+        fso.CopyFile sInstalldir & "IBcore\cl32.dll", SYSWOW & "complib.dll"\r
+    end if\r
+    if fso.FileExists(sInstalldir & "IBcore\cl32d.dll") then\r
+       fso.CopyFile sInstalldir & "IBcore\cl32d.dll", SYSWOW & "complibd.dll"\r
+    end if\r
+    if fso.FileExists(sInstalldir & "IBcore\ibal32.dll") then\r
+       fso.CopyFile sInstalldir & "IBcore\ibal32.dll", SYSWOW & "ibal.dll"\r
+    end if\r
+    if fso.FileExists(sInstalldir & "IBcore\ibal32d.dll") then\r
+       fso.CopyFile sInstalldir & "IBcore\ibal32d.dll", SYSWOW & "ibald.dll"\r
+    end if\r
+    if fso.FileExists(sInstalldir & "IBcore\mtuvpd32.dll") then\r
+       fso.CopyFile sInstalldir & "IBcore\mtuvpd32.dll", SYSWOW & "mthcau.dll"\r
+    end if\r
+    if fso.FileExists(sInstalldir & "IBcore\mtuvpd32d.dll") then\r
+       fso.CopyFile sInstalldir & "IBcore\mtuvpd32d.dll",SYSWOW & "mthcaud.dll"\r
+    end if\r
+    if fso.FileExists(sInstalldir & "net\ibwsd32.dll") then\r
+       fso.CopyFile sInstalldir & "net\ibwsd32.dll", SYSWOW & "ibwsd.dll"\r
+    end if\r
+end if  ' XXX\r
+    End If ' MTARCH\r
+\r
+    ' append [INSTALLDIR] to system search path\r
     SysPathAdd(sInstalldir)\r
 \r
-       err.clear \r
+    err.clear \r
     DriverInstall=0\r
 \r
 End Function\r