From: stansmith Date: Mon, 2 Jul 2007 18:37:25 +0000 (+0000) Subject: [WinOF] WIX - de-tabbed in favor of spaces. X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=56cc14dab502c6c9a57b03fc68fb48566827416d;p=~shefty%2Frdma-win.git [WinOF] WIX - de-tabbed in favor of spaces. git-svn-id: svn://openib.tc.cornell.edu/gen1@740 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/branches/WinOF/WIX/CustomActions.vbs b/branches/WinOF/WIX/CustomActions.vbs index f7fa5d75..ec6e8713 100644 --- a/branches/WinOF/WIX/CustomActions.vbs +++ b/branches/WinOF/WIX/CustomActions.vbs @@ -316,7 +316,7 @@ Function ReadSysPath strKeyPath="SYSTEM\CurrentControlSet\Control\Session Manager\Environment" strValueName = "Path" oReg.GetExpandedStringValue HKEY_LOCAL_MACHINE,_ - strKeyPath, strValueName, strValue + strKeyPath, strValueName, strValue If (Err.Number = 0) And (Not IsNull(strValue)) Then ReadSysPath = strValue @@ -336,7 +336,7 @@ Function WriteSysPath(NewPath) strKeyPath="SYSTEM\CurrentControlSet\Control\Session Manager\Environment" strValueName = "Path" oReg.SetExpandedStringValue _ - HKEY_LOCAL_MACHINE, strKeyPath, strValueName, NewPath + HKEY_LOCAL_MACHINE, strKeyPath, strValueName, NewPath WriteSysPath = Err.Number End Function @@ -356,7 +356,7 @@ End Function ' Add specified path to the system search path registry entry @ ' 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path' -' Generally the path is [INSTALLDIR] +' Normally the added path is [INSTALLDIR] ' Called from a defered exection context (aka, DriverInstall). Function SysPathAdd(InstallDir) @@ -385,6 +385,7 @@ Function SysPathAdd(InstallDir) If rc <> 0 Then SysPathAdd = ShowErr2("SysPathAdd - WriteSysPath()") Else + ' TODO - Notify current windows of updated PATH registry value. SysPathAdd = 0 End if @@ -431,13 +432,12 @@ End Function ''''''''''' Check installation status '''''''''''' Function install_verify() - Dim Status - Dim sInstalldir - sInstalldir = Session.Property("INSTALLDIR") + Dim Status + Dim sInstalldir + sInstalldir = Session.Property("INSTALLDIR") Set WshShell = CreateObject("WScript.Shell") Set vstat = WshShell.Exec(sInstalldir & "\bin\vstat.exe") install_verify = vstat.ExitCode - End Function '------------------------------------------------------------- @@ -464,31 +464,34 @@ End Function ' Function to add registry DWORD val. Function AddRegDWORDValue(strKeyPath, strValueName, dwValue) -const HKEY_LOCAL_MACHINE = &H80000002 -strComputer = "." + const HKEY_LOCAL_MACHINE = &H80000002 + strComputer = "." -Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ -strComputer & "\root\default:StdRegProv") + Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ + strComputer & "\root\default:StdRegProv") + If Err Then ShowError -If Err Then ShowError -oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue -If Err Then ShowError + oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue + + If Err Then ShowError End Function '------------------------------------------------- ' Function to add registry Expanded string val. + Function AddRegExpandValue(strKeyPath, strValueName, dwValue) -const HKEY_LOCAL_MACHINE = &H80000002 -strComputer = "." + const HKEY_LOCAL_MACHINE = &H80000002 + strComputer = "." -Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ -strComputer & "\root\default:StdRegProv") + Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ + strComputer & "\root\default:StdRegProv") -If Err Then ShowError -oReg.SetExpandedStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue -If Err Then ShowError + If Err Then ShowError + oReg.SetExpandedStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,_ + dwValue + If Err Then ShowError End Function @@ -522,29 +525,29 @@ Function DriverInstall() MTARCH = Architecture Dim PropArray - Dim CheckMode, sInstalldir, fso + Dim CheckMode, sInstalldir, fso - ' Get the value of INSTALLDIR - CheckMode = Session.Property("CustomActionData") + ' Get the value of INSTALLDIR + CheckMode = Session.Property("CustomActionData") - If Not CheckMode = "" Then + If Not CheckMode = "" Then 'in defered action this is the way to pass arguments. PropArray = Split(Session.Property("CustomActionData"), ";") - Else + Else Redim PropArray(4) PropArray(0) = Session.Property("INSTALLDIR") PropArray(1) = Session.Property("SystemFolder") PropArray(2) = Session.Property("System64Folder") PropArray(3) = Session.Property("WindowsFolder") - End if + End if - sInstalldir = PropArray(0) + sInstalldir = PropArray(0) Uninstall_IB_Devices(sInstalldir) - RemoveDriverFiles + RemoveDriverFiles - Set WshShell = CreateObject("WScript.Shell") + Set WshShell = CreateObject("WScript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") If Not fso.FileExists(sInstalldir & "IBcore\devman.exe") Then @@ -555,7 +558,7 @@ Function DriverInstall() End if ' rescan system buses - Return = WshShell.Run ("cmd.exe /c cd " & sInstalldir & _ + Return = WshShell.Run ("cmd.exe /c cd " & sInstalldir & _ "IBcore & devman.exe rescan", 0, true) ' Display error number and description if applicable If Err Then ShowError @@ -597,38 +600,38 @@ Function DriverInstall() SYSWOW = PropArray(1) ' following file copies relocated to .wxs file so they can be uninstalled -' correctly, as this way the files reamin when uninstalled. +' correctly, otherwise, using this approach the files reamin when uninstalled. if False then - msgbox "DriverInstall PA(1) " & SYSWOW & " PA(2) " & PropArray(2) - if fso.FileExists(sInstalldir & "IBcore\cl32.dll") then - fso.CopyFile sInstalldir & "IBcore\cl32.dll", SYSWOW & "complib.dll" - end if - if fso.FileExists(sInstalldir & "IBcore\cl32d.dll") then - fso.CopyFile sInstalldir & "IBcore\cl32d.dll", SYSWOW & "complibd.dll" - end if - if fso.FileExists(sInstalldir & "IBcore\ibal32.dll") then - fso.CopyFile sInstalldir & "IBcore\ibal32.dll", SYSWOW & "ibal.dll" - end if - if fso.FileExists(sInstalldir & "IBcore\ibal32d.dll") then - fso.CopyFile sInstalldir & "IBcore\ibal32d.dll", SYSWOW & "ibald.dll" - end if - if fso.FileExists(sInstalldir & "IBcore\mtuvpd32.dll") then - fso.CopyFile sInstalldir & "IBcore\mtuvpd32.dll", SYSWOW & "mthcau.dll" - end if - if fso.FileExists(sInstalldir & "IBcore\mtuvpd32d.dll") then - fso.CopyFile sInstalldir & "IBcore\mtuvpd32d.dll", SYSWOW & "mthcaud.dll" - end if - if fso.FileExists(sInstalldir & "net\ibwsd32.dll") then - fso.CopyFile sInstalldir & "net\ibwsd32.dll", SYSWOW & "ibwsd.dll" - end if - end if ' XXX - End If - - ' append [INSTALLDIR] to system search path + msgbox "DriverInstall PA(1) " & SYSWOW & " PA(2) " & PropArray(2) + if fso.FileExists(sInstalldir & "IBcore\cl32.dll") then + fso.CopyFile sInstalldir & "IBcore\cl32.dll", SYSWOW & "complib.dll" + end if + if fso.FileExists(sInstalldir & "IBcore\cl32d.dll") then + fso.CopyFile sInstalldir & "IBcore\cl32d.dll", SYSWOW & "complibd.dll" + end if + if fso.FileExists(sInstalldir & "IBcore\ibal32.dll") then + fso.CopyFile sInstalldir & "IBcore\ibal32.dll", SYSWOW & "ibal.dll" + end if + if fso.FileExists(sInstalldir & "IBcore\ibal32d.dll") then + fso.CopyFile sInstalldir & "IBcore\ibal32d.dll", SYSWOW & "ibald.dll" + end if + if fso.FileExists(sInstalldir & "IBcore\mtuvpd32.dll") then + fso.CopyFile sInstalldir & "IBcore\mtuvpd32.dll", SYSWOW & "mthcau.dll" + end if + if fso.FileExists(sInstalldir & "IBcore\mtuvpd32d.dll") then + fso.CopyFile sInstalldir & "IBcore\mtuvpd32d.dll",SYSWOW & "mthcaud.dll" + end if + if fso.FileExists(sInstalldir & "net\ibwsd32.dll") then + fso.CopyFile sInstalldir & "net\ibwsd32.dll", SYSWOW & "ibwsd.dll" + end if +end if ' XXX + End If ' MTARCH + + ' append [INSTALLDIR] to system search path SysPathAdd(sInstalldir) - err.clear + err.clear DriverInstall=0 End Function