[wix-users] How to use if..else condition in Wix toolset?

TMG Test gpattmgtest at gmail.com
Wed Oct 26 02:37:05 PDT 2016


Below is my code

 

<Property Id="FOOFOLDER">

      <DirectorySearch Id="DirSearchFoo" Path="C:\foo">

        <FileSearch Id="barSearch" Name="bar.txt" />

      </DirectorySearch>

    </Property>

 

Now I want to check below condition. If bar.txt exist in the above location the I have to set the install path as C:\foo

 

Else I have to set the path as C:\Test

 

How to accomplish this in .wxs file using <?if?> ..<?else?>

 

Could you help, please?

 

Thank You,

 

 

 

From: Joel Budreau [mailto:joel.budreau at gmail.com] 
Sent: Monday, October 24, 2016 9:51 PM
To: gpattmgtest at gmail.com
Cc: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
Subject: Re: [wix-users] How to use if..else condition in Wix toolset?

 

Use the <FileSearch> element to build an AppSearch entry that looks for the presence of web.config. If it's found, have a custom action overwrite the directory property associated with the files you need to install (make sure this directory-overwrite action is scheduled after CostFinalize).

 

On Mon, Oct 24, 2016 at 4:58 AM, TMG Test <gpattmgtest at gmail.com <mailto:gpattmgtest at gmail.com> > wrote:

Hello Team,

Here is my requirement: if web.config file exists in
D:\default\website\web.config I have to copy some files to
D:\default\website location else copy the same files to C:\inetpub\wwwroot
location.

How to write this condition in .wxs file?

Could you help, please?

Thank You,




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

 




More information about the wix-users mailing list