From: stansmith Date: Fri, 24 Aug 2007 20:27:52 +0000 (+0000) Subject: [WinOF] WIX Installer - perserve existing %SystemDrive%\DAT\dat.conf X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=d397aa342afbd5759b9e789c6f8b8ff78f2e90f3;p=~shefty%2Frdma-win.git [WinOF] WIX Installer - perserve existing %SystemDrive%\DAT\dat.conf git-svn-id: svn://openib.tc.cornell.edu/gen1@776 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/branches/WinOF/WIX/CustomActions.vbs b/branches/WinOF/WIX/CustomActions.vbs index 39854c57..ba1c2725 100644 --- a/branches/WinOF/WIX/CustomActions.vbs +++ b/branches/WinOF/WIX/CustomActions.vbs @@ -950,7 +950,7 @@ End Sub ' If not present, then create %SystemDrive%\DAT\dat.conf Function DAPL_setup() - Dim sSysDrive, DatFolder, SrcFile, WshShell, fso + Dim sSysDrive, SrcFile, DstFile, WshShell, fso Set WshShell = CreateObject("WScript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") @@ -961,21 +961,16 @@ Function DAPL_setup() SrcFile = Session.Property("INSTALLDIR") & "dat.conf" If fso.FileExists(SrcFile) Then - On Error Resume Next + On Error Resume Next sSysDrive = Session.Property("WindowsVolume") ' sSysDrive = WshShell.ExpandEnvironmentStrings("%SystemDrive%") - DatFolder = sSysDrive & "DAT" - If fso.FolderExists(DatFolder) Then - ' Preserve existing %SystemDrive%\DAT - Exit Function - End if - ' create %SystemDrive%\DAT & install dat.conf - fso.CreateFolder DatFolder - If Err Then - ErrMsg "Unable to create folder %SystemDrive%\DAT" + ' WindowsVolume includes root \, where %SystemDrive% does not. + DstFile = sSysDrive & "DAT\dat.conf" + If fso.FileExists(DstFile) Then + ' Preserve existing %SystemDrive%\DAT\dat.conf Exit Function End if - fso.CopyFile SrcFile, DatFolder & "\dat.conf" + fso.CopyFile SrcFile, DstFile End if End Function