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

Phill Hogland phill.hogland at rimage.com
Wed Jul 27 13:28:59 PDT 2016


What I do is:


In my <Bundle..../>  or <Product...../> Elements  I define a WixVariable using the preprocessor variable


<WixVariable Id="MyWixVar" Value="$(var.MyVar)" />

I may have defined $(var.MyVar) in a wxi include file, or in some cases in the .wixproj file I define a MSBuild Property and then create the $(var.MyVar) with the syntax:


    <CompilerAdditionalOptions>
      $(CompilerAdditionalOptions)
      -I"$(ReleaseVersionedProjectRoot)\Common\Src\Includes"
      -dMyVar="$(MyVarMSBuildProperty)"
    </CompilerAdditionalOptions>


But I digress, back to your question, then where you want to use it in another fragment (which I typically put in a WixLib, do:


<File Id="..." Name="...">
    <CopyFile Id="CopyOf..." DestinationName="!(wix.MyWixVar).exe" />
  </File>


I would not encourage over fragmenting either, but I find it helpful to but 'reuseable' fragments that I typically use in various bundles in myBundle.wixlib and to put the 'reuseable' fragments that I might use in more than one package in myPackage.wixlib, and using WixVariables is what I needed to make that schema work.


________________________________
From: wix-users <wix-users-bounces at lists.wixtoolset.org> on behalf of Lewis Henderson <henderso at opentext.com>
Sent: Wednesday, July 27, 2016 2:27:09 PM
To: WiX Toolset Users Mailing List
Subject: Re: [wix-users] Problem doing a CopyFile in a fragment...

Yeah, that might be the case.

I originally wasn't using fragments for anything except dialogs, but have since been led to believe that's bad practice.  My product components are generated by a script, so they could be created either as includes or fragments (but I do like most of the fragment benefits).  I've been converting these files from includes to fragments, but this is one case I haven't been able to work around (yet).

Any suggestions are still welcome.  Thanks.

                                Lewis

PS: The reason for different copy names is that it's a service configuration tool that has to match the name of the service to work.  I've got two products that install their own instance of this service, and they accordingly have different service names.  I didn't write the service configuration tool, so I can't change its behavior.

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

Almost sounds like you might be "over Fragmenting".

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

Thanks for the reply Jacob,

I'm using 3.10.2.2516.

The $(var.CopyName) did work when both files were includes, but not as fragments.  The problem is that the CopyFile statement is in the large list of components, which is now a fragment.  The definitions of CopyName and the COPY_NAME property are in another fragment.  This last could be (and used to be) an include, but then you have problem of how to have the "components" fragment pick up the include from different places, depending on which product is being installed.

When both files were includes, the base products included the "definitions" include from different places, but could then include the common "components" include.

I'm trying to move the CopyFile into its own component within the "definitions" fragment (where the $(var.CopyName) will work), but I get a problem with the DirectoryRef of the copied file.  The specific error is:

error LGHT0204 : ICE18: KeyPath for Component: 'CopyOf...' is Directory: '...'. The Directory/Component pair must be listed in the CreateFolders table.

The directory, of course, is defined in the "components" fragment.  Any ideas on how to get around this issue, or am I heading down the wrong path?

                                Lewis


____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant https://urldefense.proofpoint.com/v2/url?u=http-3A__www.firegiant.com_&d=CwICAg&c=ZgVRmm3mf2P1-XDAyDsu4A&r=yAhF6NGJ7EPmZkvswZOswwnYxaueKkO53V282tTn1P4&m=eAljPunkmK5GOc3t1bwoVW2cz741Rjk92VWraXj4Smo&s=8yZCGoi-QRVm3ecLadoCQJolQibfHgQlWyhtz2pA1K4&e=

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



More information about the wix-users mailing list