Click here to Skip to main content
15,860,861 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Please see below statements; for time being I have hard coded source and destination folders (this folders are formed during Installation process) in setup project of MSI. Note: Below file paths are the one where MSI package installation destination are and not the source location from. The question how to set the destination or source property values by hiding the hard coded values like [INSTALLLOCATION]\App_Config\

As of now I am passing INSTALLLOCATION (E:\Websites\SCBUDirect\Website\SCBUDirect.B2CWeb) through command line and want to set the Destination folder value as [INSTALLLOCATION]\App_Config\ but not sure how it can be implemented through property setting or custom actions which I tried but failed to make it work.

Below is the Snippet (from heat.exe) of component of the file which need to be copied .
HTML
<Component Id="cmp209B0DBB82F9FF15193D29F0BD337B7F" Directory="dirB0A921E55A598C65B18B4E47885629C3" Guid="{3B140259-FCC7-4D2E-8629-CBB879BBA46C}">
  <File Id="filBC5CC5B8DCC504F6DC75A7B2673E7D0D" KeyPath="yes" Source="C:\Workspaces\Chatra\Website\SCBUDirect.B2CWeb\App_Config\basic.log4net.dev" />
</Component>

Here is my part of my code in product.wxs
HTML
<Fragment>
    <Property Id="SourceFilesFolder" Value="E:\Websites\SCBUDirect\Website\SCBUDirect.B2CWeb\App_Config\basic.log4net.dev" />

    <Property Id="DestFilesFolder" Value="E:\Websites\SCBUDirect\Website\SCBUDirect.B2CWeb\App_Config\" />


  <ComponentGroup Id="CopyFiles">
         <ComponentRef Id="CMP_LOG4TXT" />
    </ComponentGroup>

      <Component Id="CMP_LOG4TXT" Guid="341BD660-7249-42DD-9744-DBEF0776AD52"  Directory="INSTALLLOCATION" KeyPath="yes">
        <CopyFile Id="Copy_LOG4TXT" 
              SourceProperty="SourceFilesFolder" 
              DestinationProperty="DestFilesFolder" 
              DestinationName="basic.log4net" />
      </Component>

</Fragment>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900