[wix-users] Problem doing a CopyFile in a fragment...
Lewis Henderson
henderso at opentext.com
Wed Jul 27 10:43:40 PDT 2016
Hi Everyone,
I've got a problem with a shared fragment. I've got a CopyFile statement that makes a copy of a file with a different name depending on which product is being compiled. Formerly, this was done with <?include ...?> files, but I'm trying to clean up my act. The CopyFile statement looked something like this:
<File Id="..." Name="...">
<CopyFile Id="CopyOf..." DestinationName="$(var.CopyName).exe" />
</File>
Now, the CopyName variable is defined in another fragment, and comes up unresolved at compile time, even though the other fragment is resolved at link time with a PropertyRef. This worked when things were .wxi files, but not with fragments, so I changed it to use a property instead:
<CopyFile ... DestinationName="[COPY_NAME].exe" />
Where the other fragment that defines CopyName sets <Property Id="COPY_NAME" value="$(var.CopyName)", but this results in the file being copied as literally [COPY_NAME].exe, which isn't right. Because CopyFile defines DestinationName as a LongFileNameType, the property isn't being translated. It's this other fragment that changes based on the product being built.
So, does anyone have an idea how to change the DestinationName in the fragment based on a value the fragment can inherit at link time?
Thanks for any ideas.
Lewis
More information about the wix-users
mailing list