I have the same problem like here. I have a .config
file that I want to copy from the source directory (where my .msi
file is, to my install directory.
I tried several things:
1st thing I tried:
<DirectoryRef Id="ProgramFilesFolder">
<Component Id="$(var.productFamily)$(var.productSummary).config" Guid="$(var.GUID_CMP_DemoConfig)" KeyPath="yes">
<CopyFile Id="$(var.productFamily)$(var.productSummary).config"
SourceName="$(var.productFamily)$(var.productSummary).exe.config"
SourceProperty="SOURCEDIR"
DestinationDirectory="$(var.productFamily)$(var.productType)"
DestinationName="$(var.productFamily)$(var.productSummary).exe.config"
>
</CopyFile>
</Component>
</DirectoryRef>
But this method failed, as it's trying to copy the file before the application is installed, so my directory still doesn't exist.
2nd thing I tried:
Add it as another component of the installer.
<Component Id="$(var.productFamily)$(var.productSummary).config" Guid="$(var.GUID_CMP_DemoConfig)">
<File Id="$(var.productFamily)$(var.productSummary).config"
Name="$(var.productFamily)$(var.productSummary).exe.config"
DiskId="1" KeyPath="yes"
Source="$(var.productFamily)$(var.productSummary).exe.config" >
</File>
</Component>
With this one I should be able to copy from my Release
folder of the installer to my INSTALLDIR
, but when I build the project on VS 2010
, it doesn't find the file...
3rd thing I tried:
I tried to change the SOURCEDIR
var to my own variable, so I could use it as a regular component, doing this. But it doesn't let me change the variable name. It says when trying to change it:
heat.exe : error HEAT0319 : The '-out' or '-o' parameter must specify a file path.
So I only want to copy a file from where my .msi
is located, but I still couldn't do it...
Any ideas?