[wix-users] Best Practices Question on Conditionally Setting Multiple Properties

Gary M garym at oedata.com
Fri Apr 22 01:24:55 PDT 2016


Very nice..

Thanks :)

On Fri, Apr 22, 2016 at 1:30 AM, Andreas Hirth <a.hirth at luratech.com> wrote:

> Hi Gary,
>
> I successfully used the <?foreach?> preprocessor statement in the past
> for something similar. For your needs the code could probably look like
> this (not tested):
>
> <?define MyProperties=PROP1;PROP2;PROP3?>
> ...
> <?foreach Propertyname in $(var.MyProperties)?>
>      <Property Id="$(var.Propertyname)" />
>      <SetProperty Id="$(var.Propertyname)" ...>...</SetProperty>
> <?endforeach?>
>
> -- Andreas
>
> Am 22.04.2016 um 08:59 schrieb Gary M:
> > Ughh never mind, the properties element under feature elements doesn't
> > play. (too tired)
> >
> > Any suggestions or am I stuck with defining many properties ?
> >
> > On Thu, Apr 21, 2016 at 11:46 PM, Gary M <garym at oedata.com> wrote:
> >
> >> I have a best practices question about conditionally setting about 60
> >> properties.
> >>
> >> I'm setting the properties with default values when "NOT Installed".
> >>
> >> When installed, the values are sourced from the registry and  some ini
> >> files.
> >>
> >> I would like to reduce the number of conditional statements and make the
> >> wxs a bit more readable and maintainable.
> >>
> >> The only was I can see hierarchically organizing  the properties is to
> >> place them in a Feature element, make the feature hidden and add a
> >> conditional element to the feature..
> >>
> >>   Is there a different/better convention to achieve this ?
> >>
> >> v/r
> >> gary
> >>
> > ____________________________________________________________________
> > WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>
>
>
>
>
> Webinare:
>
>
> "Der neue LuraTech Rendition Server stellt sich vor!"
> 28.04.2016, 11:00 Uhr, deutsch
> 28.04.2016, 16,00 Uhr, englisch
> Gert Michiels, Carsten Heiermann
>
> „Die perfekte digitale Mieterakte erstellen!“
> Donnerstag, 12. Mai 2016, deutsch
> Markus Wenig, Thomas Zellmann
>
>
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>



More information about the wix-users mailing list