Conditionally pass the property value to File Element Name, Source attributes.

11 messages Options
Embed this post
Permalink
Mahesh@Bangalore

Conditionally pass the property value to File Element Name, Source attributes.

Reply Threaded More More options
Print post
Permalink
I am using Wix Version 2.

I have the two features F1 and F2. F2 is a sub component of F1. I have a
component C1 which is kept inside F1.

The component C1 has a file element like this:

<File Id="xyz" Name="abc.txt" Source="C:\abc.txt" />

But, the Source attribute path and Name attribute depends on the Feature
which is selected.
So, I tried to have a custom action to set a property PATHARGS to the path
based on selection of a feature (F1 or F2) and also property FILENAME to set
appropriate file based on selection of Feature (F1 or F2).

Now, if I redefine File element as

<File Id="xyz" Name="[FILENAME]" Source="[PATHARGS]" /> ,

the File element is unable to read the property value.

So, my questions are:

1) Why are the above mentioned steps not working properly?
2) Is there any other way to pass property values to File Name and Source
element.

--thanks..
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Sebastian Brand (Instyler Software)

Re: Conditionally pass the property value to File Element Name, Source attributes.

Reply Threaded More More options
Print post
Permalink
Hello,

The @Source is used by the WiX compiler when creating the .msi file to read
the file you want to add to the msi. WiX does not handle any [] Properties
during compile time - Properties are handled by the MSI Engine during
installation.
To achieve your goal use a compiler variable, e.g. "$(var.PATHARGS)" - these
variables can be set when starting wix and will be handled by the
Preprocessor. See WiX help "Preprocessor" for more.


Best regards,
Sebastian Brand

Instyler Setup - Creating WiX-based MSI installations, elegantly.
http://www.instyler.com


 


-----Original Message-----
From: mahesh u [mailto:[hidden email]]
Sent: July 09, 2009 11:26
To: [hidden email]
Subject: [WiX-users] Conditionally pass the property value to File Element
Name, Source attributes.

I am using Wix Version 2.

I have the two features F1 and F2. F2 is a sub component of F1. I have a
component C1 which is kept inside F1.

The component C1 has a file element like this:

<File Id="xyz" Name="abc.txt" Source="C:\abc.txt" />

But, the Source attribute path and Name attribute depends on the Feature
which is selected.
So, I tried to have a custom action to set a property PATHARGS to the path
based on selection of a feature (F1 or F2) and also property FILENAME to set
appropriate file based on selection of Feature (F1 or F2).

Now, if I redefine File element as

<File Id="xyz" Name="[FILENAME]" Source="[PATHARGS]" /> ,

the File element is unable to read the property value.

So, my questions are:

1) Why are the above mentioned steps not working properly?
2) Is there any other way to pass property values to File Name and Source
element.

--thanks..
----------------------------------------------------------------------------
--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize

details at: http://p.sf.net/sfu/Challenge
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Mahesh@Bangalore

Re: Conditionally pass the property value to File Element Name, Source attributes.

Reply Threaded More More options
Print post
Permalink
The problem I am facing is that I cannot use preprocessor variables for
PATHARGS because the selection of feature can only be got in run time...
So, I want to set a property only based on feature selection and use it in
Source attribute of File element..


On Thu, Jul 9, 2009 at 3:14 PM, Sebastian Brand (Instyler Software) <
[hidden email] <[hidden email]>> wrote:

> Hello,
>
> The @Source is used by the WiX compiler when creating the .msi file to read
> the file you want to add to the msi. WiX does not handle any [] Properties
> during compile time - Properties are handled by the MSI Engine during
> installation.
> To achieve your goal use a compiler variable, e.g. "$(var.PATHARGS)" -
> these
> variables can be set when starting wix and will be handled by the
> Preprocessor. See WiX help "Preprocessor" for more.
>
>
> Best regards,
> Sebastian Brand
>
> Instyler Setup - Creating WiX-based MSI installations, elegantly.
> http://www.instyler.com
>
>
>
>
>
> -----Original Message-----
> From: mahesh u [mailto:[hidden email]]
> Sent: July 09, 2009 11:26
> To: [hidden email]
> Subject: [WiX-users] Conditionally pass the property value to File Element
> Name, Source attributes.
>
> I am using Wix Version 2.
>
> I have the two features F1 and F2. F2 is a sub component of F1. I have a
> component C1 which is kept inside F1.
>
> The component C1 has a file element like this:
>
> <File Id="xyz" Name="abc.txt" Source="C:\abc.txt" />
>
> But, the Source attribute path and Name attribute depends on the Feature
> which is selected.
> So, I tried to have a custom action to set a property PATHARGS to the path
> based on selection of a feature (F1 or F2) and also property FILENAME to
> set
> appropriate file based on selection of Feature (F1 or F2).
>
> Now, if I redefine File element as
>
> <File Id="xyz" Name="[FILENAME]" Source="[PATHARGS]" /> ,
>
> the File element is unable to read the property value.
>
> So, my questions are:
>
> 1) Why are the above mentioned steps not working properly?
> 2) Is there any other way to pass property values to File Name and Source
> element.
>
> --thanks..
>
> ----------------------------------------------------------------------------
> --
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
>
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
David Watson-3

Re: Conditionally pass the property value to FileElement Name, Source attributes.

Reply Threaded More More options
Print post
Permalink
Hi,

It sounds like you are trying to condifionally install one of two files
based on which feature is selected.

If you want to do this you should include both files in your installer
under separate features, in separate components, possible with a
component condition.

Or maybe I didn't understand what you are trying to achieve.

Dave
 

-----Original Message-----
From: mahesh u [mailto:[hidden email]]
Sent: 09 July 2009 11:23
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Conditionally pass the property value to
FileElement Name, Source attributes.

The problem I am facing is that I cannot use preprocessor variables for
PATHARGS because the selection of feature can only be got in run time...
So, I want to set a property only based on feature selection and use it
in Source attribute of File element..


On Thu, Jul 9, 2009 at 3:14 PM, Sebastian Brand (Instyler Software) <
[hidden email] <[hidden email]>> wrote:

> Hello,
>
> The @Source is used by the WiX compiler when creating the .msi file to

> read the file you want to add to the msi. WiX does not handle any []
> Properties during compile time - Properties are handled by the MSI
> Engine during installation.
> To achieve your goal use a compiler variable, e.g. "$(var.PATHARGS)" -

> these variables can be set when starting wix and will be handled by
> the Preprocessor. See WiX help "Preprocessor" for more.
>
>
> Best regards,
> Sebastian Brand
>
> Instyler Setup - Creating WiX-based MSI installations, elegantly.
> http://www.instyler.com
>
>
>
>
>
> -----Original Message-----
> From: mahesh u [mailto:[hidden email]]
> Sent: July 09, 2009 11:26
> To: [hidden email]
> Subject: [WiX-users] Conditionally pass the property value to File
> Element Name, Source attributes.
>
> I am using Wix Version 2.
>
> I have the two features F1 and F2. F2 is a sub component of F1. I have

> a component C1 which is kept inside F1.
>
> The component C1 has a file element like this:
>
> <File Id="xyz" Name="abc.txt" Source="C:\abc.txt" />
>
> But, the Source attribute path and Name attribute depends on the
> Feature which is selected.
> So, I tried to have a custom action to set a property PATHARGS to the
> path based on selection of a feature (F1 or F2) and also property
> FILENAME to set appropriate file based on selection of Feature (F1 or
> F2).
>
> Now, if I redefine File element as
>
> <File Id="xyz" Name="[FILENAME]" Source="[PATHARGS]" /> ,
>
> the File element is unable to read the property value.
>
> So, my questions are:
>
> 1) Why are the above mentioned steps not working properly?
> 2) Is there any other way to pass property values to File Name and
> Source element.
>
> --thanks..
>
> ----------------------------------------------------------------------
> ------
> --
> Enter the BlackBerry Developer Challenge This is your chance to win up

> to $100,000 in prizes! For a limited time, vendors submitting new
> applications to BlackBerry App World(TM) will have the opportunity to
> enter the BlackBerry Developer Challenge. See full prize
>
> details at: http://p.sf.net/sfu/Challenge 
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
>
> ----------------------------------------------------------------------
> -------- Enter the BlackBerry Developer Challenge This is your chance
> to win up to $100,000 in prizes! For a limited time, vendors
> submitting new applications to BlackBerry App World(TM) will have the
> opportunity to enter the BlackBerry Developer Challenge. See full
> prize details at: http://p.sf.net/sfu/Challenge 
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------
------
Enter the BlackBerry Developer Challenge This is your chance to win up
to $100,000 in prizes! For a limited time, vendors submitting new
applications to BlackBerry App World(TM) will have the opportunity to
enter the BlackBerry Developer Challenge. See full prize details at:
http://p.sf.net/sfu/Challenge
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users

SDL PLC confidential, all rights reserved.
If you are not the intended recipient of this mail SDL requests and requires that you delete it without acting upon or copying any of its contents, and we further request that you advise us.
SDL PLC is a public limited company registered in England and Wales.  Registered number: 02675207.  
Registered address: Globe House, Clivemont Road, Maidenhead, Berkshire SL6 7DY, UK.


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Sebastian Brand (Instyler Software)

Re: Conditionally pass the property value to File Element Name, Source attributes.

Reply Threaded More More options
Print post
Permalink
In reply to this post by Mahesh@Bangalore
The @Source attribute is not available when the user selects the features.
It's only there for the WiX compiler to add the file to the package. The
@source is the location of the file on your development machine. It has
nothing to do with the installation itself. If you do not want your
installation to install a file if a specific feature is selected use a
condition for the component element.



Best regards,
Sebastian Brand

Instyler Setup - Creating WiX-based MSI installations, elegantly.
http://www.instyler.com


-----Original Message-----
From: mahesh u [mailto:[hidden email]]
Sent: July 09, 2009 12:23
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Conditionally pass the property value to File
Element Name, Source attributes.

The problem I am facing is that I cannot use preprocessor variables for
PATHARGS because the selection of feature can only be got in run time...
So, I want to set a property only based on feature selection and use it in
Source attribute of File element..


On Thu, Jul 9, 2009 at 3:14 PM, Sebastian Brand (Instyler Software) <
[hidden email] <[hidden email]>> wrote:

> Hello,
>
> The @Source is used by the WiX compiler when creating the .msi file to
read

> the file you want to add to the msi. WiX does not handle any [] Properties
> during compile time - Properties are handled by the MSI Engine during
> installation.
> To achieve your goal use a compiler variable, e.g. "$(var.PATHARGS)" -
> these
> variables can be set when starting wix and will be handled by the
> Preprocessor. See WiX help "Preprocessor" for more.
>
>
> Best regards,
> Sebastian Brand
>
> Instyler Setup - Creating WiX-based MSI installations, elegantly.
> http://www.instyler.com
>
>
>
>
>
> -----Original Message-----
> From: mahesh u [mailto:[hidden email]]
> Sent: July 09, 2009 11:26
> To: [hidden email]
> Subject: [WiX-users] Conditionally pass the property value to File Element
> Name, Source attributes.
>
> I am using Wix Version 2.
>
> I have the two features F1 and F2. F2 is a sub component of F1. I have a
> component C1 which is kept inside F1.
>
> The component C1 has a file element like this:
>
> <File Id="xyz" Name="abc.txt" Source="C:\abc.txt" />
>
> But, the Source attribute path and Name attribute depends on the Feature
> which is selected.
> So, I tried to have a custom action to set a property PATHARGS to the path
> based on selection of a feature (F1 or F2) and also property FILENAME to
> set
> appropriate file based on selection of Feature (F1 or F2).
>
> Now, if I redefine File element as
>
> <File Id="xyz" Name="[FILENAME]" Source="[PATHARGS]" /> ,
>
> the File element is unable to read the property value.
>
> So, my questions are:
>
> 1) Why are the above mentioned steps not working properly?
> 2) Is there any other way to pass property values to File Name and Source
> element.
>
> --thanks..
>
>
----------------------------------------------------------------------------
> --
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full
prize

>
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
>
>
----------------------------------------------------------------------------
--
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full
prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
----------------------------------------------------------------------------
--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize

details at: http://p.sf.net/sfu/Challenge
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Mahesh@Bangalore

Re: Conditionally pass the property value to FileElement Name, Source attributes.

Reply Threaded More More options
Print post
Permalink
In reply to this post by David Watson-3
My WiX file is something like this:

<Component Id="a">
<File Id ="abc" Name="abc.txt" Source="C:\abc.txt"/>
</Component>

<Component
<Feature1>
<ComponentRef a />
<ComponentRef b/>
<Feature2>
<ComponentRef z/>
</Feature2>
</Feature1>

So, my requirement is Component 'a' should be executed with file "abc.txt"
if Feature1 is marked for install and it should be executed with
Name="xyz.txt" if Feature2 is marked for install.

I can know whether a feature is marked for install or not only after
CostFinalize action. But, conditions are valid only before CostFinalize
action.
So, I have written a CustomAction to check for this after CostFinalize
action. I thought of setting a property based on Custom Action and pass that
value to File element Name attribute. [Instead of abc.txt] a property like
[FILEARGS].

So, Is this valid? OR Is there some other way to solve the problem?.


--Thanks


On Thu, Jul 9, 2009 at 4:40 PM, David Watson <[hidden email]> wrote:

> Hi,
>
> It sounds like you are trying to condifionally install one of two files
> based on which feature is selected.
>
> If you want to do this you should include both files in your installer
> under separate features, in separate components, possible with a
> component condition.
>
> Or maybe I didn't understand what you are trying to achieve.
>
> Dave
>
>
> -----Original Message-----
> From: mahesh u [mailto:[hidden email]]
> Sent: 09 July 2009 11:23
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] Conditionally pass the property value to
> FileElement Name, Source attributes.
>
> The problem I am facing is that I cannot use preprocessor variables for
> PATHARGS because the selection of feature can only be got in run time...
> So, I want to set a property only based on feature selection and use it
> in Source attribute of File element..
>
>
> On Thu, Jul 9, 2009 at 3:14 PM, Sebastian Brand (Instyler Software) <
> [hidden email] <[hidden email]> <
> [hidden email] <[hidden email]>>> wrote:
>
> > Hello,
> >
> > The @Source is used by the WiX compiler when creating the .msi file to
>
> > read the file you want to add to the msi. WiX does not handle any []
> > Properties during compile time - Properties are handled by the MSI
> > Engine during installation.
> > To achieve your goal use a compiler variable, e.g. "$(var.PATHARGS)" -
>
> > these variables can be set when starting wix and will be handled by
> > the Preprocessor. See WiX help "Preprocessor" for more.
> >
> >
> > Best regards,
> > Sebastian Brand
> >
> > Instyler Setup - Creating WiX-based MSI installations, elegantly.
> > http://www.instyler.com
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: mahesh u [mailto:[hidden email]]
> > Sent: July 09, 2009 11:26
> > To: [hidden email]
> > Subject: [WiX-users] Conditionally pass the property value to File
> > Element Name, Source attributes.
> >
> > I am using Wix Version 2.
> >
> > I have the two features F1 and F2. F2 is a sub component of F1. I have
>
> > a component C1 which is kept inside F1.
> >
> > The component C1 has a file element like this:
> >
> > <File Id="xyz" Name="abc.txt" Source="C:\abc.txt" />
> >
> > But, the Source attribute path and Name attribute depends on the
> > Feature which is selected.
> > So, I tried to have a custom action to set a property PATHARGS to the
> > path based on selection of a feature (F1 or F2) and also property
> > FILENAME to set appropriate file based on selection of Feature (F1 or
> > F2).
> >
> > Now, if I redefine File element as
> >
> > <File Id="xyz" Name="[FILENAME]" Source="[PATHARGS]" /> ,
> >
> > the File element is unable to read the property value.
> >
> > So, my questions are:
> >
> > 1) Why are the above mentioned steps not working properly?
> > 2) Is there any other way to pass property values to File Name and
> > Source element.
> >
> > --thanks..
> >
> > ----------------------------------------------------------------------
> > ------
> > --
> > Enter the BlackBerry Developer Challenge This is your chance to win up
>
> > to $100,000 in prizes! For a limited time, vendors submitting new
> > applications to BlackBerry App World(TM) will have the opportunity to
> > enter the BlackBerry Developer Challenge. See full prize
> >
> > details at: http://p.sf.net/sfu/Challenge
> > _______________________________________________
> > WiX-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> >
> >
> > ----------------------------------------------------------------------
> > -------- Enter the BlackBerry Developer Challenge This is your chance
> > to win up to $100,000 in prizes! For a limited time, vendors
> > submitting new applications to BlackBerry App World(TM) will have the
> > opportunity to enter the BlackBerry Developer Challenge. See full
> > prize details at: http://p.sf.net/sfu/Challenge
> > _______________________________________________
> > WiX-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> ------------------------------------------------------------------------
> ------
> Enter the BlackBerry Developer Challenge This is your chance to win up
> to $100,000 in prizes! For a limited time, vendors submitting new
> applications to BlackBerry App World(TM) will have the opportunity to
> enter the BlackBerry Developer Challenge. See full prize details at:
> http://p.sf.net/sfu/Challenge
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
> SDL PLC confidential, all rights reserved.
> If you are not the intended recipient of this mail SDL requests and
> requires that you delete it without acting upon or copying any of its
> contents, and we further request that you advise us.
> SDL PLC is a public limited company registered in England and Wales.
>  Registered number: 02675207.
> Registered address: Globe House, Clivemont Road, Maidenhead, Berkshire SL6
> 7DY, UK.
>
>
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
DexterSinister

Re: Conditionally pass the property value to FileElement Name, Source attributes.

Reply Threaded More More options
Print post
Permalink
Mahesh@Bangalore wrote:
My WiX file is something like this:

<Component Id="a">
<File Id ="abc" Name="abc.txt" Source="C:\abc.txt"/>
</Component>

<Feature1>
<ComponentRef a />
<ComponentRef b/>
<Feature2>
<ComponentRef z/>
</Feature2>
</Feature1>


So, my requirement is Component 'a' should be executed with file "abc.txt"
if Feature1 is marked for install and it should be executed with
Name="xyz.txt" if Feature2 is marked for install.
Why not do this:

<Component Id="a">
<File Id ="abc" Name="abc.txt" Source="C:\abc.txt"/>
</Component>

<Component Id="z">
<File Id ="xyz" Name="xyz.txt" Source="C:\xyz.txt"/>
</Component>


<Feature1>
<ComponentRef a />
<ComponentRef b/>
</Feature1>

<Feature2>
<ComponentRef b/>
<ComponentRef z/>
</Feature2>

or am I missing something ... ?

-dmm

David Watson-3

Re: Conditionally pass the property value toFileElement Name, Source attributes.

Reply Threaded More More options
Print post
Permalink
In reply to this post by Mahesh@Bangalore

 Hi,
        So you want to install file a or b depending on feature 1 and 2.
But the problem arises as you have feature 2 as a sub feature of feature
one.

So :-

<Component Id="a">
        <File Id ="abc" Name="abc.txt" Source="C:\abc.txt"/>
</Component>
<Component Id="b">
        <File Id ="xyz" Name="xyz.txt" Source="C:\xyz.txt"/>
</Component>

<Feature1>
        <ComponentRef a />
        <Feature2>
                <ComponentRef b />
        </Feature2>
</Feature1>

...will partly work but if you choose feature two you will get both
files as it is a child feature.

The simplest fix is to make Feature2 not a child.

Unfortunatly it is not a trivial task just to condition the components
on the feature state (see Bob's article here
http://www.joyofsetup.com/2008/04/09/feature-states-in-component-conditi
ons/).

Bob's article suggests calling a custom action from the UI to set the
component state directly, my guess in this case that would be to stop
component a installing if feature 2 is selected.

Dave


-----Original Message-----
From: mahesh u [mailto:[hidden email]]
Sent: 09 July 2009 16:06
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Conditionally pass the property value
toFileElement Name, Source attributes.

My WiX file is something like this:

<Component Id="a">
<File Id ="abc" Name="abc.txt" Source="C:\abc.txt"/> </Component>

<Component
<Feature1>
<ComponentRef a />
<ComponentRef b/>
<Feature2>
<ComponentRef z/>
</Feature2>
</Feature1>

So, my requirement is Component 'a' should be executed with file
"abc.txt"
if Feature1 is marked for install and it should be executed with
Name="xyz.txt" if Feature2 is marked for install.

I can know whether a feature is marked for install or not only after
CostFinalize action. But, conditions are valid only before CostFinalize
action.
So, I have written a CustomAction to check for this after CostFinalize
action. I thought of setting a property based on Custom Action and pass
that value to File element Name attribute. [Instead of abc.txt] a
property like [FILEARGS].

So, Is this valid? OR Is there some other way to solve the problem?.


--Thanks


On Thu, Jul 9, 2009 at 4:40 PM, David Watson <[hidden email]> wrote:

> Hi,
>
> It sounds like you are trying to condifionally install one of two
> files based on which feature is selected.
>
> If you want to do this you should include both files in your installer

> under separate features, in separate components, possible with a
> component condition.
>
> Or maybe I didn't understand what you are trying to achieve.
>
> Dave
>
>
> -----Original Message-----
> From: mahesh u [mailto:[hidden email]]
> Sent: 09 July 2009 11:23
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] Conditionally pass the property value to
> FileElement Name, Source attributes.
>
> The problem I am facing is that I cannot use preprocessor variables
> for PATHARGS because the selection of feature can only be got in run
time...

> So, I want to set a property only based on feature selection and use
> it in Source attribute of File element..
>
>
> On Thu, Jul 9, 2009 at 3:14 PM, Sebastian Brand (Instyler Software) <
> [hidden email] <[hidden email]> <
> [hidden email] <[hidden email]>>> wrote:
>
> > Hello,
> >
> > The @Source is used by the WiX compiler when creating the .msi file
> > to
>
> > read the file you want to add to the msi. WiX does not handle any []

> > Properties during compile time - Properties are handled by the MSI
> > Engine during installation.
> > To achieve your goal use a compiler variable, e.g. "$(var.PATHARGS)"

> > -
>
> > these variables can be set when starting wix and will be handled by
> > the Preprocessor. See WiX help "Preprocessor" for more.
> >
> >
> > Best regards,
> > Sebastian Brand
> >
> > Instyler Setup - Creating WiX-based MSI installations, elegantly.
> > http://www.instyler.com
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: mahesh u [mailto:[hidden email]]
> > Sent: July 09, 2009 11:26
> > To: [hidden email]
> > Subject: [WiX-users] Conditionally pass the property value to File
> > Element Name, Source attributes.
> >
> > I am using Wix Version 2.
> >
> > I have the two features F1 and F2. F2 is a sub component of F1. I
> > have
>
> > a component C1 which is kept inside F1.
> >
> > The component C1 has a file element like this:
> >
> > <File Id="xyz" Name="abc.txt" Source="C:\abc.txt" />
> >
> > But, the Source attribute path and Name attribute depends on the
> > Feature which is selected.
> > So, I tried to have a custom action to set a property PATHARGS to
> > the path based on selection of a feature (F1 or F2) and also
> > property FILENAME to set appropriate file based on selection of
> > Feature (F1 or F2).
> >
> > Now, if I redefine File element as
> >
> > <File Id="xyz" Name="[FILENAME]" Source="[PATHARGS]" /> ,
> >
> > the File element is unable to read the property value.
> >
> > So, my questions are:
> >
> > 1) Why are the above mentioned steps not working properly?
> > 2) Is there any other way to pass property values to File Name and
> > Source element.
> >
> > --thanks..
> >
> > --------------------------------------------------------------------
> > --
> > ------
> > --
> > Enter the BlackBerry Developer Challenge This is your chance to win
> > up
>
> > to $100,000 in prizes! For a limited time, vendors submitting new
> > applications to BlackBerry App World(TM) will have the opportunity
> > to enter the BlackBerry Developer Challenge. See full prize
> >
> > details at: http://p.sf.net/sfu/Challenge 
> > _______________________________________________
> > WiX-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> >
> >
> > --------------------------------------------------------------------
> > --
> > -------- Enter the BlackBerry Developer Challenge This is your
> > chance to win up to $100,000 in prizes! For a limited time, vendors
> > submitting new applications to BlackBerry App World(TM) will have
> > the opportunity to enter the BlackBerry Developer Challenge. See
> > full prize details at: http://p.sf.net/sfu/Challenge 
> > _______________________________________________
> > WiX-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> ----------------------------------------------------------------------
> --
> ------
> Enter the BlackBerry Developer Challenge This is your chance to win up

> to $100,000 in prizes! For a limited time, vendors submitting new
> applications to BlackBerry App World(TM) will have the opportunity to
> enter the BlackBerry Developer Challenge. See full prize details at:
> http://p.sf.net/sfu/Challenge
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
> SDL PLC confidential, all rights reserved.
> If you are not the intended recipient of this mail SDL requests and
> requires that you delete it without acting upon or copying any of its
> contents, and we further request that you advise us.
> SDL PLC is a public limited company registered in England and Wales.
>  Registered number: 02675207.
> Registered address: Globe House, Clivemont Road, Maidenhead, Berkshire

> SL6 7DY, UK.
>
>
>
> ----------------------------------------------------------------------
> -------- Enter the BlackBerry Developer Challenge This is your chance
> to win up to $100,000 in prizes! For a limited time, vendors
> submitting new applications to BlackBerry App World(TM) will have the
> opportunity to enter the BlackBerry Developer Challenge. See full
> prize details at: http://p.sf.net/sfu/Challenge 
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------
------
Enter the BlackBerry Developer Challenge This is your chance to win up
to $100,000 in prizes! For a limited time, vendors submitting new
applications to BlackBerry App World(TM) will have the opportunity to
enter the BlackBerry Developer Challenge. See full prize details at:
http://p.sf.net/sfu/Challenge
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Mahesh@Bangalore

Re: Conditionally pass the property value toFileElement Name, Source attributes.

Reply Threaded More More options
Print post
Permalink
Yes.. This is exactly the problem I am facing. I have a requirement that
Feature 2 should be a child of Feature 1. Feature 1 is always installed.
Feature 2 is an optional component.

--thanks.


On Thu, Jul 9, 2009 at 10:45 PM, David Watson <[hidden email]> wrote:

>
>  Hi,
>        So you want to install file a or b depending on feature 1 and 2.
> But the problem arises as you have feature 2 as a sub feature of feature
> one.
>
> So :-
>
> <Component Id="a">
>        <File Id ="abc" Name="abc.txt" Source="C:\abc.txt"/>
> </Component>
> <Component Id="b">
>        <File Id ="xyz" Name="xyz.txt" Source="C:\xyz.txt"/>
> </Component>
>
> <Feature1>
>        <ComponentRef a />
>         <Feature2>
>                <ComponentRef b />
>        </Feature2>
> </Feature1>
>
> ...will partly work but if you choose feature two you will get both
> files as it is a child feature.
>
> The simplest fix is to make Feature2 not a child.
>
> Unfortunatly it is not a trivial task just to condition the components
> on the feature state (see Bob's article here
> http://www.joyofsetup.com/2008/04/09/feature-states-in-component-conditi
> ons/<http://www.joyofsetup.com/2008/04/09/feature-states-in-component-conditi%0Aons/>
> ).
>
> Bob's article suggests calling a custom action from the UI to set the
> component state directly, my guess in this case that would be to stop
> component a installing if feature 2 is selected.
>
> Dave
>
>
> -----Original Message-----
> From: mahesh u [mailto:[hidden email]]
> Sent: 09 July 2009 16:06
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] Conditionally pass the property value
> toFileElement Name, Source attributes.
>
> My WiX file is something like this:
>
> <Component Id="a">
> <File Id ="abc" Name="abc.txt" Source="C:\abc.txt"/> </Component>
>
> <Component
> <Feature1>
> <ComponentRef a />
> <ComponentRef b/>
> <Feature2>
> <ComponentRef z/>
> </Feature2>
> </Feature1>
>
> So, my requirement is Component 'a' should be executed with file
> "abc.txt"
> if Feature1 is marked for install and it should be executed with
> Name="xyz.txt" if Feature2 is marked for install.
>
> I can know whether a feature is marked for install or not only after
> CostFinalize action. But, conditions are valid only before CostFinalize
> action.
> So, I have written a CustomAction to check for this after CostFinalize
> action. I thought of setting a property based on Custom Action and pass
> that value to File element Name attribute. [Instead of abc.txt] a
> property like [FILEARGS].
>
> So, Is this valid? OR Is there some other way to solve the problem?.
>
>
> --Thanks
>
>
> On Thu, Jul 9, 2009 at 4:40 PM, David Watson <[hidden email]> wrote:
>
> > Hi,
> >
> > It sounds like you are trying to condifionally install one of two
> > files based on which feature is selected.
> >
> > If you want to do this you should include both files in your installer
>
> > under separate features, in separate components, possible with a
> > component condition.
> >
> > Or maybe I didn't understand what you are trying to achieve.
> >
> > Dave
> >
> >
> > -----Original Message-----
> > From: mahesh u [mailto:[hidden email]]
> > Sent: 09 July 2009 11:23
> > To: General discussion for Windows Installer XML toolset.
> > Subject: Re: [WiX-users] Conditionally pass the property value to
> > FileElement Name, Source attributes.
> >
> > The problem I am facing is that I cannot use preprocessor variables
> > for PATHARGS because the selection of feature can only be got in run
> time...
> > So, I want to set a property only based on feature selection and use
> > it in Source attribute of File element..
> >
> >
> > On Thu, Jul 9, 2009 at 3:14 PM, Sebastian Brand (Instyler Software) <
> > [hidden email] <[hidden email]> <
> [hidden email] <[hidden email]>> <
> > [hidden email] <[hidden email]> <
> [hidden email] <[hidden email]>>>> wrote:
> >
> > > Hello,
> > >
> > > The @Source is used by the WiX compiler when creating the .msi file
> > > to
> >
> > > read the file you want to add to the msi. WiX does not handle any []
>
> > > Properties during compile time - Properties are handled by the MSI
> > > Engine during installation.
> > > To achieve your goal use a compiler variable, e.g. "$(var.PATHARGS)"
>
> > > -
> >
> > > these variables can be set when starting wix and will be handled by
> > > the Preprocessor. See WiX help "Preprocessor" for more.
> > >
> > >
> > > Best regards,
> > > Sebastian Brand
> > >
> > > Instyler Setup - Creating WiX-based MSI installations, elegantly.
> > > http://www.instyler.com
> > >
> > >
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: mahesh u [mailto:[hidden email]]
> > > Sent: July 09, 2009 11:26
> > > To: [hidden email]
> > > Subject: [WiX-users] Conditionally pass the property value to File
> > > Element Name, Source attributes.
> > >
> > > I am using Wix Version 2.
> > >
> > > I have the two features F1 and F2. F2 is a sub component of F1. I
> > > have
> >
> > > a component C1 which is kept inside F1.
> > >
> > > The component C1 has a file element like this:
> > >
> > > <File Id="xyz" Name="abc.txt" Source="C:\abc.txt" />
> > >
> > > But, the Source attribute path and Name attribute depends on the
> > > Feature which is selected.
> > > So, I tried to have a custom action to set a property PATHARGS to
> > > the path based on selection of a feature (F1 or F2) and also
> > > property FILENAME to set appropriate file based on selection of
> > > Feature (F1 or F2).
> > >
> > > Now, if I redefine File element as
> > >
> > > <File Id="xyz" Name="[FILENAME]" Source="[PATHARGS]" /> ,
> > >
> > > the File element is unable to read the property value.
> > >
> > > So, my questions are:
> > >
> > > 1) Why are the above mentioned steps not working properly?
> > > 2) Is there any other way to pass property values to File Name and
> > > Source element.
> > >
> > > --thanks..
> > >
> > > --------------------------------------------------------------------
> > > --
> > > ------
> > > --
> > > Enter the BlackBerry Developer Challenge This is your chance to win
> > > up
> >
> > > to $100,000 in prizes! For a limited time, vendors submitting new
> > > applications to BlackBerry App World(TM) will have the opportunity
> > > to enter the BlackBerry Developer Challenge. See full prize
> > >
> > > details at: http://p.sf.net/sfu/Challenge
> > > _______________________________________________
> > > WiX-users mailing list
> > > [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/wix-users
> > >
> > >
> > >
> > > --------------------------------------------------------------------
> > > --
> > > -------- Enter the BlackBerry Developer Challenge This is your
> > > chance to win up to $100,000 in prizes! For a limited time, vendors
> > > submitting new applications to BlackBerry App World(TM) will have
> > > the opportunity to enter the BlackBerry Developer Challenge. See
> > > full prize details at: http://p.sf.net/sfu/Challenge
> > > _______________________________________________
> > > WiX-users mailing list
> > > [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/wix-users
> > >
> > ----------------------------------------------------------------------
> > --
> > ------
> > Enter the BlackBerry Developer Challenge This is your chance to win up
>
> > to $100,000 in prizes! For a limited time, vendors submitting new
> > applications to BlackBerry App World(TM) will have the opportunity to
> > enter the BlackBerry Developer Challenge. See full prize details at:
> > http://p.sf.net/sfu/Challenge
> > _______________________________________________
> > WiX-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> > SDL PLC confidential, all rights reserved.
> > If you are not the intended recipient of this mail SDL requests and
> > requires that you delete it without acting upon or copying any of its
> > contents, and we further request that you advise us.
> > SDL PLC is a public limited company registered in England and Wales.
> >  Registered number: 02675207.
> > Registered address: Globe House, Clivemont Road, Maidenhead, Berkshire
>
> > SL6 7DY, UK.
> >
> >
> >
> > ----------------------------------------------------------------------
> > -------- Enter the BlackBerry Developer Challenge This is your chance
> > to win up to $100,000 in prizes! For a limited time, vendors
> > submitting new applications to BlackBerry App World(TM) will have the
> > opportunity to enter the BlackBerry Developer Challenge. See full
> > prize details at: http://p.sf.net/sfu/Challenge
> > _______________________________________________
> > WiX-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> ------------------------------------------------------------------------
> ------
> Enter the BlackBerry Developer Challenge This is your chance to win up
> to $100,000 in prizes! For a limited time, vendors submitting new
> applications to BlackBerry App World(TM) will have the opportunity to
> enter the BlackBerry Developer Challenge. See full prize details at:
> http://p.sf.net/sfu/Challenge
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
David Watson-3

Re: Conditionally pass the property value toFileElementName, Source attributes.

Reply Threaded More More options
Print post
Permalink
Hi,
        Well if you have no option to change this behaviour, IE it may
be possible to design this slightly odd behaviour out in the application
design you will have to look at complex options.

You will either need a custom action to change the component state.

Or maybe you could place your core application components in a hidden
feature that is always installed and give the user two visible features
in the UI that are mutualy exclusive.

Feature1 - all core components - Hidden in the UI.
Feature2 - component A - just has the abc.txt component
Feature3 - component B - has xyz.txt component and other optional
features.

I'm not sure how painful making the feature UI do mutex features will be
though as we don't use the built in UI.

Dave W.

-----Original Message-----
From: mahesh u [mailto:[hidden email]]
Sent: 10 July 2009 01:12
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Conditionally pass the property value
toFileElementName, Source attributes.

Yes.. This is exactly the problem I am facing. I have a requirement that
Feature 2 should be a child of Feature 1. Feature 1 is always installed.
Feature 2 is an optional component.

--thanks.


On Thu, Jul 9, 2009 at 10:45 PM, David Watson <[hidden email]> wrote:

>
>  Hi,
>        So you want to install file a or b depending on feature 1 and
2.

> But the problem arises as you have feature 2 as a sub feature of
> feature one.
>
> So :-
>
> <Component Id="a">
>        <File Id ="abc" Name="abc.txt" Source="C:\abc.txt"/>
> </Component> <Component Id="b">
>        <File Id ="xyz" Name="xyz.txt" Source="C:\xyz.txt"/>
> </Component>
>
> <Feature1>
>        <ComponentRef a />
>         <Feature2>
>                <ComponentRef b />
>        </Feature2>
> </Feature1>
>
> ...will partly work but if you choose feature two you will get both
> files as it is a child feature.
>
> The simplest fix is to make Feature2 not a child.
>
> Unfortunatly it is not a trivial task just to condition the components

> on the feature state (see Bob's article here
> http://www.joyofsetup.com/2008/04/09/feature-states-in-component-condi
> ti
> ons/<http://www.joyofsetup.com/2008/04/09/feature-states-in-component-
> conditi%0Aons/>
> ).
>
> Bob's article suggests calling a custom action from the UI to set the
> component state directly, my guess in this case that would be to stop
> component a installing if feature 2 is selected.
>
> Dave
>
>
> -----Original Message-----
> From: mahesh u [mailto:[hidden email]]
> Sent: 09 July 2009 16:06
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] Conditionally pass the property value
> toFileElement Name, Source attributes.
>
> My WiX file is something like this:
>
> <Component Id="a">
> <File Id ="abc" Name="abc.txt" Source="C:\abc.txt"/> </Component>
>
> <Component
> <Feature1>
> <ComponentRef a />
> <ComponentRef b/>
> <Feature2>
> <ComponentRef z/>
> </Feature2>
> </Feature1>
>
> So, my requirement is Component 'a' should be executed with file
> "abc.txt"
> if Feature1 is marked for install and it should be executed with
> Name="xyz.txt" if Feature2 is marked for install.
>
> I can know whether a feature is marked for install or not only after
> CostFinalize action. But, conditions are valid only before
> CostFinalize action.
> So, I have written a CustomAction to check for this after CostFinalize

> action. I thought of setting a property based on Custom Action and
> pass that value to File element Name attribute. [Instead of abc.txt] a

> property like [FILEARGS].
>
> So, Is this valid? OR Is there some other way to solve the problem?.
>
>
> --Thanks
>
>
> On Thu, Jul 9, 2009 at 4:40 PM, David Watson <[hidden email]> wrote:
>
> > Hi,
> >
> > It sounds like you are trying to condifionally install one of two
> > files based on which feature is selected.
> >
> > If you want to do this you should include both files in your
> > installer
>
> > under separate features, in separate components, possible with a
> > component condition.
> >
> > Or maybe I didn't understand what you are trying to achieve.
> >
> > Dave
> >
> >
> > -----Original Message-----
> > From: mahesh u [mailto:[hidden email]]
> > Sent: 09 July 2009 11:23
> > To: General discussion for Windows Installer XML toolset.
> > Subject: Re: [WiX-users] Conditionally pass the property value to
> > FileElement Name, Source attributes.
> >
> > The problem I am facing is that I cannot use preprocessor variables
> > for PATHARGS because the selection of feature can only be got in run
> time...
> > So, I want to set a property only based on feature selection and use

> > it in Source attribute of File element..
> >
> >
> > On Thu, Jul 9, 2009 at 3:14 PM, Sebastian Brand (Instyler Software)
> > <
> > [hidden email] <[hidden email]> <
> [hidden email] <[hidden email]>> <
> > [hidden email] <[hidden email]> <
> [hidden email] <[hidden email]>>>> wrote:
> >
> > > Hello,
> > >
> > > The @Source is used by the WiX compiler when creating the .msi
> > > file to
> >
> > > read the file you want to add to the msi. WiX does not handle any
> > > []
>
> > > Properties during compile time - Properties are handled by the MSI

> > > Engine during installation.
> > > To achieve your goal use a compiler variable, e.g.
"$(var.PATHARGS)"

>
> > > -
> >
> > > these variables can be set when starting wix and will be handled
> > > by the Preprocessor. See WiX help "Preprocessor" for more.
> > >
> > >
> > > Best regards,
> > > Sebastian Brand
> > >
> > > Instyler Setup - Creating WiX-based MSI installations, elegantly.
> > > http://www.instyler.com
> > >
> > >
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: mahesh u [mailto:[hidden email]]
> > > Sent: July 09, 2009 11:26
> > > To: [hidden email]
> > > Subject: [WiX-users] Conditionally pass the property value to File

> > > Element Name, Source attributes.
> > >
> > > I am using Wix Version 2.
> > >
> > > I have the two features F1 and F2. F2 is a sub component of F1. I
> > > have
> >
> > > a component C1 which is kept inside F1.
> > >
> > > The component C1 has a file element like this:
> > >
> > > <File Id="xyz" Name="abc.txt" Source="C:\abc.txt" />
> > >
> > > But, the Source attribute path and Name attribute depends on the
> > > Feature which is selected.
> > > So, I tried to have a custom action to set a property PATHARGS to
> > > the path based on selection of a feature (F1 or F2) and also
> > > property FILENAME to set appropriate file based on selection of
> > > Feature (F1 or F2).
> > >
> > > Now, if I redefine File element as
> > >
> > > <File Id="xyz" Name="[FILENAME]" Source="[PATHARGS]" /> ,
> > >
> > > the File element is unable to read the property value.
> > >
> > > So, my questions are:
> > >
> > > 1) Why are the above mentioned steps not working properly?
> > > 2) Is there any other way to pass property values to File Name and

> > > Source element.
> > >
> > > --thanks..
> > >
> > > ------------------------------------------------------------------
> > > --
> > > --
> > > ------
> > > --
> > > Enter the BlackBerry Developer Challenge This is your chance to
> > > win up
> >
> > > to $100,000 in prizes! For a limited time, vendors submitting new
> > > applications to BlackBerry App World(TM) will have the opportunity

> > > to enter the BlackBerry Developer Challenge. See full prize
> > >
> > > details at: http://p.sf.net/sfu/Challenge 
> > > _______________________________________________
> > > WiX-users mailing list
> > > [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/wix-users
> > >
> > >
> > >
> > > ------------------------------------------------------------------
> > > --
> > > --
> > > -------- Enter the BlackBerry Developer Challenge This is your
> > > chance to win up to $100,000 in prizes! For a limited time,
> > > vendors submitting new applications to BlackBerry App World(TM)
> > > will have the opportunity to enter the BlackBerry Developer
> > > Challenge. See full prize details at:
> > > http://p.sf.net/sfu/Challenge 
> > > _______________________________________________
> > > WiX-users mailing list
> > > [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/wix-users
> > >
> > --------------------------------------------------------------------
> > --
> > --
> > ------
> > Enter the BlackBerry Developer Challenge This is your chance to win
> > up
>
> > to $100,000 in prizes! For a limited time, vendors submitting new
> > applications to BlackBerry App World(TM) will have the opportunity
> > to enter the BlackBerry Developer Challenge. See full prize details
at:

> > http://p.sf.net/sfu/Challenge
> > _______________________________________________
> > WiX-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> > SDL PLC confidential, all rights reserved.
> > If you are not the intended recipient of this mail SDL requests and
> > requires that you delete it without acting upon or copying any of
> > its contents, and we further request that you advise us.
> > SDL PLC is a public limited company registered in England and Wales.
> >  Registered number: 02675207.
> > Registered address: Globe House, Clivemont Road, Maidenhead,
> > Berkshire
>
> > SL6 7DY, UK.
> >
> >
> >
> > --------------------------------------------------------------------
> > --
> > -------- Enter the BlackBerry Developer Challenge This is your
> > chance to win up to $100,000 in prizes! For a limited time, vendors
> > submitting new applications to BlackBerry App World(TM) will have
> > the opportunity to enter the BlackBerry Developer Challenge. See
> > full prize details at: http://p.sf.net/sfu/Challenge 
> > _______________________________________________
> > WiX-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> ----------------------------------------------------------------------
> --
> ------
> Enter the BlackBerry Developer Challenge This is your chance to win up

> to $100,000 in prizes! For a limited time, vendors submitting new
> applications to BlackBerry App World(TM) will have the opportunity to
> enter the BlackBerry Developer Challenge. See full prize details at:
> http://p.sf.net/sfu/Challenge
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
> ----------------------------------------------------------------------
> -------- Enter the BlackBerry Developer Challenge This is your chance
> to win up to $100,000 in prizes! For a limited time, vendors
> submitting new applications to BlackBerry App World(TM) will have the
> opportunity to enter the BlackBerry Developer Challenge. See full
> prize details at: http://p.sf.net/sfu/Challenge 
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------
------
Enter the BlackBerry Developer Challenge This is your chance to win up
to $100,000 in prizes! For a limited time, vendors submitting new
applications to BlackBerry App World(TM) will have the opportunity to
enter the BlackBerry Developer Challenge. See full prize details at:
http://p.sf.net/sfu/Challenge
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Mahesh@Bangalore

Re: Conditionally pass the property value toFileElementName, Source attributes.

Reply Threaded More More options
Print post
Permalink
Thanks for your replies... I am still finding a way to get out of this....
I want to know does WiX allow me to do the following:


<File Id="New" Name="abc.txt" Source="C:\abc.txt" />

Can this statement be replaced by


<File Id="New" Name="[NAMEARG]" Source="[SOURCEARG]" />

and have properties defined as

<Property Id="New1" Name="NAMEARG" Value="abc.txt" />
<Property Id="New2" Name="SOURCEARG" Value="C:\abc.txt" />


--thanks

On Fri, Jul 10, 2009 at 2:31 PM, David Watson <[hidden email]> wrote:

> Hi,
>        Well if you have no option to change this behaviour, IE it may
> be possible to design this slightly odd behaviour out in the application
> design you will have to look at complex options.
>
> You will either need a custom action to change the component state.
>
> Or maybe you could place your core application components in a hidden
> feature that is always installed and give the user two visible features
> in the UI that are mutualy exclusive.
>
> Feature1 - all core components - Hidden in the UI.
> Feature2 - component A - just has the abc.txt component
> Feature3 - component B - has xyz.txt component and other optional
> features.
>
> I'm not sure how painful making the feature UI do mutex features will be
> though as we don't use the built in UI.
>
> Dave W.
>
> -----Original Message-----
> From: mahesh u [mailto:[hidden email]]
> Sent: 10 July 2009 01:12
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] Conditionally pass the property value
> toFileElementName, Source attributes.
>
> Yes.. This is exactly the problem I am facing. I have a requirement that
> Feature 2 should be a child of Feature 1. Feature 1 is always installed.
> Feature 2 is an optional component.
>
> --thanks.
>
>
> On Thu, Jul 9, 2009 at 10:45 PM, David Watson <[hidden email]> wrote:
>
> >
> >  Hi,
> >        So you want to install file a or b depending on feature 1 and
> 2.
> > But the problem arises as you have feature 2 as a sub feature of
> > feature one.
> >
> > So :-
> >
> > <Component Id="a">
> >        <File Id ="abc" Name="abc.txt" Source="C:\abc.txt"/>
> > </Component> <Component Id="b">
> >        <File Id ="xyz" Name="xyz.txt" Source="C:\xyz.txt"/>
> > </Component>
> >
> > <Feature1>
> >        <ComponentRef a />
> >         <Feature2>
> >                <ComponentRef b />
> >        </Feature2>
> > </Feature1>
> >
> > ...will partly work but if you choose feature two you will get both
> > files as it is a child feature.
> >
> > The simplest fix is to make Feature2 not a child.
> >
> > Unfortunatly it is not a trivial task just to condition the components
>
> > on the feature state (see Bob's article here
> > http://www.joyofsetup.com/2008/04/09/feature-states-in-component-condi
> > ti
> > ons/<http://www.joyofsetup.com/2008/04/09/feature-states-in-component-
> > conditi%0Aons/>
> > ).
> >
> > Bob's article suggests calling a custom action from the UI to set the
> > component state directly, my guess in this case that would be to stop
> > component a installing if feature 2 is selected.
> >
> > Dave
> >
> >
> > -----Original Message-----
> > From: mahesh u [mailto:[hidden email]]
> > Sent: 09 July 2009 16:06
> > To: General discussion for Windows Installer XML toolset.
> > Subject: Re: [WiX-users] Conditionally pass the property value
> > toFileElement Name, Source attributes.
> >
> > My WiX file is something like this:
> >
> > <Component Id="a">
> > <File Id ="abc" Name="abc.txt" Source="C:\abc.txt"/> </Component>
> >
> > <Component
> > <Feature1>
> > <ComponentRef a />
> > <ComponentRef b/>
> > <Feature2>
> > <ComponentRef z/>
> > </Feature2>
> > </Feature1>
> >
> > So, my requirement is Component 'a' should be executed with file
> > "abc.txt"
> > if Feature1 is marked for install and it should be executed with
> > Name="xyz.txt" if Feature2 is marked for install.
> >
> > I can know whether a feature is marked for install or not only after
> > CostFinalize action. But, conditions are valid only before
> > CostFinalize action.
> > So, I have written a CustomAction to check for this after CostFinalize
>
> > action. I thought of setting a property based on Custom Action and
> > pass that value to File element Name attribute. [Instead of abc.txt] a
>
> > property like [FILEARGS].
> >
> > So, Is this valid? OR Is there some other way to solve the problem?.
> >
> >
> > --Thanks
> >
> >
> > On Thu, Jul 9, 2009 at 4:40 PM, David Watson <[hidden email]> wrote:
> >
> > > Hi,
> > >
> > > It sounds like you are trying to condifionally install one of two
> > > files based on which feature is selected.
> > >
> > > If you want to do this you should include both files in your
> > > installer
> >
> > > under separate features, in separate components, possible with a
> > > component condition.
> > >
> > > Or maybe I didn't understand what you are trying to achieve.
> > >
> > > Dave
> > >
> > >
> > > -----Original Message-----
> > > From: mahesh u [mailto:[hidden email]]
> > > Sent: 09 July 2009 11:23
> > > To: General discussion for Windows Installer XML toolset.
> > > Subject: Re: [WiX-users] Conditionally pass the property value to
> > > FileElement Name, Source attributes.
> > >
> > > The problem I am facing is that I cannot use preprocessor variables
> > > for PATHARGS because the selection of feature can only be got in run
> > time...
> > > So, I want to set a property only based on feature selection and use
>
> > > it in Source attribute of File element..
> > >
> > >
> > > On Thu, Jul 9, 2009 at 3:14 PM, Sebastian Brand (Instyler Software)
> > > <
> > > [hidden email] <[hidden email]> <
> [hidden email] <[hidden email]>> <
> > [hidden email] <[hidden email]> <
> [hidden email] <[hidden email]>>> <
> > > [hidden email] <[hidden email]> <
> [hidden email] <[hidden email]>> <
> > [hidden email] <[hidden email]> <
> [hidden email] <[hidden email]>>>>> wrote:
> > >
> > > > Hello,
> > > >
> > > > The @Source is used by the WiX compiler when creating the .msi
> > > > file to
> > >
> > > > read the file you want to add to the msi. WiX does not handle any
> > > > []
> >
> > > > Properties during compile time - Properties are handled by the MSI
>
> > > > Engine during installation.
> > > > To achieve your goal use a compiler variable, e.g.
> "$(var.PATHARGS)"
> >
> > > > -
> > >
> > > > these variables can be set when starting wix and will be handled
> > > > by the Preprocessor. See WiX help "Preprocessor" for more.
> > > >
> > > >
> > > > Best regards,
> > > > Sebastian Brand
> > > >
> > > > Instyler Setup - Creating WiX-based MSI installations, elegantly.
> > > > http://www.instyler.com
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: mahesh u [mailto:[hidden email]]
> > > > Sent: July 09, 2009 11:26
> > > > To: [hidden email]
> > > > Subject: [WiX-users] Conditionally pass the property value to File
>
> > > > Element Name, Source attributes.
> > > >
> > > > I am using Wix Version 2.
> > > >
> > > > I have the two features F1 and F2. F2 is a sub component of F1. I
> > > > have
> > >
> > > > a component C1 which is kept inside F1.
> > > >
> > > > The component C1 has a file element like this:
> > > >
> > > > <File Id="xyz" Name="abc.txt" Source="C:\abc.txt" />
> > > >
> > > > But, the Source attribute path and Name attribute depends on the
> > > > Feature which is selected.
> > > > So, I tried to have a custom action to set a property PATHARGS to
> > > > the path based on selection of a feature (F1 or F2) and also
> > > > property FILENAME to set appropriate file based on selection of
> > > > Feature (F1 or F2).
> > > >
> > > > Now, if I redefine File element as
> > > >
> > > > <File Id="xyz" Name="[FILENAME]" Source="[PATHARGS]" /> ,
> > > >
> > > > the File element is unable to read the property value.
> > > >
> > > > So, my questions are:
> > > >
> > > > 1) Why are the above mentioned steps not working properly?
> > > > 2) Is there any other way to pass property values to File Name and
>
> > > > Source element.
> > > >
> > > > --thanks..
> > > >
> > > > ------------------------------------------------------------------
> > > > --
> > > > --
> > > > ------
> > > > --
> > > > Enter the BlackBerry Developer Challenge This is your chance to
> > > > win up
> > >
> > > > to $100,000 in prizes! For a limited time, vendors submitting new
> > > > applications to BlackBerry App World(TM) will have the opportunity
>
> > > > to enter the BlackBerry Developer Challenge. See full prize
> > > >
> > > > details at: http://p.sf.net/sfu/Challenge
> > > > _______________________________________________
> > > > WiX-users mailing list
> > > > [hidden email]
> > > > https://lists.sourceforge.net/lists/listinfo/wix-users
> > > >
> > > >
> > > >
> > > > ------------------------------------------------------------------
> > > > --
> > > > --
> > > > -------- Enter the BlackBerry Developer Challenge This is your
> > > > chance to win up to $100,000 in prizes! For a limited time,
> > > > vendors submitting new applications to BlackBerry App World(TM)
> > > > will have the opportunity to enter the BlackBerry Developer
> > > > Challenge. See full prize details at:
> > > > http://p.sf.net/sfu/Challenge
> > > > _______________________________________________
> > > > WiX-users mailing list
> > > > [hidden email]
> > > > https://lists.sourceforge.net/lists/listinfo/wix-users
> > > >
> > > --------------------------------------------------------------------
> > > --
> > > --
> > > ------
> > > Enter the BlackBerry Developer Challenge This is your chance to win
> > > up
> >
> > > to $100,000 in prizes! For a limited time, vendors submitting new
> > > applications to BlackBerry App World(TM) will have the opportunity
> > > to enter the BlackBerry Developer Challenge. See full prize details
> at:
> > > http://p.sf.net/sfu/Challenge
> > > _______________________________________________
> > > WiX-users mailing list
> > > [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/wix-users
> > >
> > > SDL PLC confidential, all rights reserved.
> > > If you are not the intended recipient of this mail SDL requests and
> > > requires that you delete it without acting upon or copying any of
> > > its contents, and we further request that you advise us.
> > > SDL PLC is a public limited company registered in England and Wales.
> > >  Registered number: 02675207.
> > > Registered address: Globe House, Clivemont Road, Maidenhead,
> > > Berkshire
> >
> > > SL6 7DY, UK.
> > >
> > >
> > >
> > > --------------------------------------------------------------------
> > > --
> > > -------- Enter the BlackBerry Developer Challenge This is your
> > > chance to win up to $100,000 in prizes! For a limited time, vendors
> > > submitting new applications to BlackBerry App World(TM) will have
> > > the opportunity to enter the BlackBerry Developer Challenge. See
> > > full prize details at: http://p.sf.net/sfu/Challenge
> > > _______________________________________________
> > > WiX-users mailing list
> > > [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/wix-users
> > >
> > ----------------------------------------------------------------------
> > --
> > ------
> > Enter the BlackBerry Developer Challenge This is your chance to win up
>
> > to $100,000 in prizes! For a limited time, vendors submitting new
> > applications to BlackBerry App World(TM) will have the opportunity to
> > enter the BlackBerry Developer Challenge. See full prize details at:
> > http://p.sf.net/sfu/Challenge
> > _______________________________________________
> > WiX-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> >
> > ----------------------------------------------------------------------
> > -------- Enter the BlackBerry Developer Challenge This is your chance
> > to win up to $100,000 in prizes! For a limited time, vendors
> > submitting new applications to BlackBerry App World(TM) will have the
> > opportunity to enter the BlackBerry Developer Challenge. See full
> > prize details at: http://p.sf.net/sfu/Challenge
> > _______________________________________________
> > WiX-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> ------------------------------------------------------------------------
> ------
> Enter the BlackBerry Developer Challenge This is your chance to win up
> to $100,000 in prizes! For a limited time, vendors submitting new
> applications to BlackBerry App World(TM) will have the opportunity to
> enter the BlackBerry Developer Challenge. See full prize details at:
> http://p.sf.net/sfu/Challenge
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users