[wix-users] Current culture being built

Edwin Castro egcastr at gmail.com
Fri May 1 13:21:46 PDT 2020


In which target are you running your heat commands?

%(CultureGroup.Identity) is a good option but it is only valid after the
AssignCultures target has run.

You will likely get msbuild batching and as a result run both heat commands
once per culture. The result would be that Auto-generated\tutorials.wxs
would likely have the content for the last heat command executed.

How are you planning on building your two MSIs? In other words, how are you
going to tell msbuild to build an English MSI versus a Chinese MSI?

--
Edwin G. Castro


On Fri, May 1, 2020 at 10:51 AM Andrew Patterson via wix-users <
wix-users at lists.wixtoolset.org> wrote:

> Hello all,
>
> We've been using Wix for a short time now but we have a working installer
> that supports two languages: English & Chinese (i.e. Cultures: "en_US;
> zh_CN"). I'm currently working to streamline it a little bit and I had what
> I think is a sound idea, but I'm at a loss about how to make it work.
>
> We're using the Visual Studio extension with Wix 3.11. The best way to
> describe my problem and my idea is with this example. We ship tutorial
> data, but we ship different tutorial data for each language. Right now,
> we're doing something like the following:
>
> We're running a pair of heat commands like so:
>
> heat dir "$(ProjectDir)\Tutorials\en_US" -g1 -gg -cg Cg.Tutorials.en_US
> -sreg -srd -dr D.Tutorials.en_US -o
> $(ProjectDir)\Auto-generated\tutorials_enUSA.wxs
> heat dir "$(ProjectDir)\Tutorials\zh_CN" -g1 -gg -cg Cg.Tutorials.zh_CN
> -sreg  -srd -dr D.Tutorials.zh_CN -o
> $(ProjectDir)\Auto-generated\tutorials_zh_CN.wxs
>
> With some wxs XML like so:
> ...
> <Directory Id="Tutorials.en_US"/>
> <Directory Id="Tutorials.zh_CN"/>
> ...
> <Feature Id="F.Tutorials.en_US" Display="hidden" Level="0">
>   <ComponentGroupRef Id="Cg.Tutorials.en_US" />
>   <Condition Level="1">P.LanguageCode = "en_US"</Condition>
> </Feature>
> <Feature Id="F.Tutorials.zh_CN" Display="hidden" Level="0">
>   <ComponentGroupRef Id="Cg.Tutorials.zh_CN" />
>   <Condition Level="1">P.LanguageCode = "zh_CN"</Condition>
> </Feature>
>
> What I'd like to do is something more like this:
> ...
> <Directory Id="Tutorials"/>
> ...
> <Feature Id="F. Tutorials>
>   <ComponentGroupRef Id="Cg.Tutorials" />
> </Feature>
>
> But that would require my heat commands to look like this:
>
> heat dir "$(ProjectDir)\Tutorials\[current culture variable goes here]" -g1
> -gg -cg Cg.Tutorials -sreg -srd -dr D.Tutorials -o
> $(ProjectDir)\Auto-generated\tutorials.wxs
>
> This way, it'd only harvest the culture being built, and I wouldn't have to
> distinguish between which one is currently being built by checking that
> property. Of course, this has one missing piece, which you probably
> noticed: [current culture variable goes here].
>
> I've tried various things, $(Culture), $(CultureGroup.Identity),
> $(CultureGroup.OutputPath) (all of these prefixed with % or @). Is there a
> variable that I'm missing? Or is this a feature that's currently missing?
> If it's the latter, I can file it to the Issue tracker, but before I do
> that, I wanted to ask if I'm missing something obvious. Also possible: this
> won't work the way I think, and if that's the case, feel free to tell me as
> well!
>
> Any help greatly appreciated!
> ..............................
> Andrew Patterson
> Lead Software Architect
> Avenza Systems Inc.
>
> email: andrew at avenza.com
> phone: 416.487.5116
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>



More information about the wix-users mailing list