[wix-users] Problem doing a CopyFile in a fragment...

Hoover, Jacob Jacob.Hoover at greenheck.com
Wed Jul 27 11:26:39 PDT 2016


What version of WiX are you using?

$(var.CopyName) should work, though you may need to include the include.

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Lewis Henderson
Sent: Wednesday, July 27, 2016 12:44 PM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: [wix-users] Problem doing a CopyFile in a fragment...

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

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/


More information about the wix-users mailing list