[wix-users] use WixVariables recursively?

Reuss, Matthias matthias.mr.reuss at sivantos.com
Fri Jul 27 03:09:28 PDT 2018


Does setting bind paths work recursively?

Moreover, bind paths cannot be set from within a .wxs file. I think that this is a disadvantage, isn't it?

Best regards

Matthias Reuss

-----Ursprüngliche Nachricht-----
Von: wix-users <wix-users-bounces at lists.wixtoolset.org> Im Auftrag von Rob Mensching via wix-users
Gesendet: Freitag, 27. Juli 2018 11:53
An: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Rob Mensching <rob at firegiant.com>
Betreff: Re: [wix-users] use WixVariables recursively?

I always prefer bind paths: http://wixtoolset.org/documentation/manual/v3/howtos/general/specifying_source_files.html

_____________________________________________________________
 Short replies here. Complete answers over there: http://www.firegiant.com/

-----Original Message-----
From: wix-users <wix-users-bounces at lists.wixtoolset.org> On Behalf Of Reuss, Matthias via wix-users
Sent: Friday, July 27, 2018 2:37 AM
To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Cc: Reuss, Matthias <matthias.mr.reuss at sivantos.com>
Subject: [wix-users] use WixVariables recursively?

Hello,

For setting some source paths, I have used preprocessor variables so far, which I set up recursively:

  <?define ProjectRoot="$(var.SolutionDir)..\"?>
  <?define OutputFolder="$(var.ProjectRoot)Output"?>
  <?define CustomDllPath="$(var.OutputFolder)\Installation\bin\$(var.Configuration)\"?>

Now I would like to use WixVariables instead. I put these together with some other globally valid elements into a wixlib:

<Fragment>
    <WixVariable Id="ProjectRoot" Value="$(var.SolutionDir)\.."/>
    <WixVariable Id="OutputFolder" Value="!(wix.ProjectRoot)\output"/>
    <WixVariable Id="CustomDllPath" Value="!(wix.OutputFolder)\Installation\bin\$(var.Configuration)"/>

    <Binary Id="CustomAction.dll" SourceFile="!(wix.CustomDllPath)\MyCustomActions.CA.dll" /> </Fragment>

In my product.wxs file, I then refer this fragment:


    <CustomAction Id="MyCA" BinaryKey="CustomAction.dll" DllEntry="MyCA" Execute="firstSequence" />

    <InstallExecuteSequence>
      <Custom Action="MyCA" After="AppSearch" />
    </InstallExecuteSequence>

This gives me the light error
error LGHT0103: The system cannot find the file '!(wix.OutputFolder)\Installation\bin\Release\MyCustomActions.CA.dll'.

If I modify my wixlib to not use the WixVariables recursively:
<Fragment>
    <WixVariable Id="ProjectRoot" Value="$(var.SolutionDir)\.."/>
    <WixVariable Id="OutputFolder" Value="$(var.SolutionDir)\..\output"/>
    <WixVariable Id="CustomDllPath" Value="$(var.SolutionDir)\..\output\Installation\bin\$(var.Configuration)"/>

    <Binary Id="CustomAction.dll" SourceFile="!(wix.CustomDllPath)\MyCustomActions.CA.dll" /> </Fragment>

my product builds fine.

So it seems to me that the binder does not resolve these WixVariables recursively, which would be very helpful e.g. in order to define a source directory tree.

I have not found anything about this in the documentation.

Is there another possibility to define a source directory tree without having to rely on preprocessor variables?

Best regards

Matthias Reuss

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

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


More information about the wix-users mailing list