Using Variables with YesNoType Attributes

6 messages Options
Embed this post
Permalink
jnewton

Using Variables with YesNoType Attributes

Reply Threaded More More options
Print post
Permalink
I have a scenario where I need to changed the value of a YesNoType attribute based upon a property I specify. In particular, during our beta period, we remove assemblies from the GAC. However, during release, we leak the assemblies to the GAC. This is done by setting the Permanent attribute on a component. I would like to do something like:

<?if Beta = 0 ?>
<?define permanent = "Yes" ?>
<?else ?>
<?define permanent = "No" ?>
<?endif?>

<Component ... Permanent="$(var.permanent)" />

But the problem is variables don't match the YesNoType.

Anybody got throughts on the best way to handle this issue?
Yan Sklyarenko

Re: Using Variables with YesNoType Attributes

Reply Threaded More More options
Print post
Permalink
Try it lowercased: 'yes' and 'no', instead of 'Yes' and 'No'.

-- Yan

-----Original Message-----
From: jnewton [mailto:[hidden email]]
Sent: Tuesday, June 30, 2009 5:46 PM
To: [hidden email]
Subject: [WiX-users] Using Variables with YesNoType Attributes


I have a scenario where I need to changed the value of a YesNoType
attribute
based upon a property I specify. In particular, during our beta period,
we
remove assemblies from the GAC. However, during release, we leak the
assemblies to the GAC. This is done by setting the Permanent attribute
on a
component. I would like to do something like:

<?if Beta = 0 ?>
<?define permanent = "Yes" ?>
<?else ?>
<?define permanent = "No" ?>
<?endif?>

<Component ... Permanent="$(var.permanent)" />

But the problem is variables don't match the YesNoType.

Anybody got throughts on the best way to handle this issue?
--
View this message in context:
http://n2.nabble.com/Using-Variables-with-YesNoType-Attributes-tp3182903
p3182903.html
Sent from the wix-users mailing list archive at Nabble.com.


------------------------------------------------------------------------
------
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
jnewton

Re: Using Variables with YesNoType Attributes

Reply Threaded More More options
Print post
Permalink
Yeah, I meant to put 'yes' or 'no' in the post, but it doesn't matter. The wix compiler always says the value is invalid according to its datatype.
Castro, Edwin G. (Hillsboro)

Re: Using Variables with YesNoType Attributes

Reply Threaded More More options
Print post
Permalink
In reply to this post by jnewton
That smells like a bug to me. The validation code for Component/@Permanent _probably_ validates the literal attribute value rather than expanding preprocessor variables first and then validating. I've noticed this problem with other attributes too. From a toolset architecture perspective, which component is responsible for preprocessing wix source files before the compiler processes them?

Edwin G. Castro
Software Developer - Staff
Electronic Banking Services
Fiserv
Office: 503-746-0643
Fax: 503-617-0291
www.fiserv.com
Please consider the environment before printing this e-mail

> -----Original Message-----
> From: jnewton [mailto:[hidden email]]
> Sent: Tuesday, June 30, 2009 7:46 AM
> To: [hidden email]
> Subject: [WiX-users] Using Variables with YesNoType Attributes
>
>
> I have a scenario where I need to changed the value of a YesNoType
> attribute
> based upon a property I specify. In particular, during our beta period,
> we
> remove assemblies from the GAC. However, during release, we leak the
> assemblies to the GAC. This is done by setting the Permanent attribute
> on a
> component. I would like to do something like:
>
> <?if Beta = 0 ?>
> <?define permanent = "Yes" ?>
> <?else ?>
> <?define permanent = "No" ?>
> <?endif?>
>
> <Component ... Permanent="$(var.permanent)" />
>
> But the problem is variables don't match the YesNoType.
>
> Anybody got throughts on the best way to handle this issue?
> --
> View this message in context: http://n2.nabble.com/Using-Variables-
> with-YesNoType-Attributes-tp3182903p3182903.html
> Sent from the wix-users mailing list archive at Nabble.com.
>
>
> -----------------------------------------------------------------------
> -------
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Bob Arnson-6

Re: Using Variables with YesNoType Attributes

Reply Threaded More More options
Print post
Permalink
In reply to this post by jnewton
jnewton wrote:
> Yeah, I meant to put 'yes' or 'no' in the post, but it doesn't matter. The
> wix compiler always says the value is invalid according to its datatype.
>  

What's the actual error message? Is it coming from the compiler or
Visual Studio?

--
sig://boB
http://joyofsetup.com/



------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
jnewton

Re: Using Variables with YesNoType Attributes

Reply Threaded More More options
Print post
Permalink
Hi Bob,

I found out it actual works but you just get a warning from Visual Studio. I assume its validating the datatype in schema to what's being used. So everything is fine now.

Thanks