[wix-users] CopyFile add Date to DestinationName

Brian Enderle brianke at gmail.com
Thu Nov 5 08:02:21 PST 2015


I am making a backup of a file when upgrading a product:

    <DirectoryRef Id="CONFIGFOLDER">
      <Component Id="BackupConfigFile"
Guid="DD561CA8-674D-4D52-840D-26A8575A3AFC">
        <CopyFile Id="CopyConfigFile"
                  SourceDirectory="CONFIGFOLDER"
                  SourceName="config.xml"
                  DestinationDirectory="CONFIGFOLDER"
                  DestinationName="config.bak" />
      </Component>
    </DirectoryRef>


Is there a way I can add the current date (something like 20151105 or
11052015) to the DestinationName to end up file a file name like
"config_20151105.bak"


Brian

If you can't explain it simply, you don't understand it well enough.  -
Albert Einstein


More information about the wix-users mailing list