[wix-users] SPOOFED: Re: [EXTERNAL] - Re: Language condition on file?

Persson, Magnus (SE-TLX) magnus.persson at assaabloy.com
Tue Mar 28 00:14:29 PDT 2017


Hi guys,

Sometimes one can't see the forest due to all the trees...

The solution for my problem was so easy I almost beat my self for not 
seeing this earlier.
Thing is that my 'SourceFiles' variable points to where our build server 
compiles everything and the resulting files are in subfolders with the 
language name as part of the path.

By adding a string in my localization file I can add that as a part of 
the path like below

<File Id="FILE_TextDll" 
Source="$(var.SourceFiles)\Resources\!(loc.Language)\Texts.dll" 
KeyPath="yes" />

The Spanish localization file would then contain the below element:
<String Id="Language" Localizable="no">Spanish</String>

Worked like a charm.

/Magnus

On 2017-03-28 08:47, Persson, Magnus (SE-TLX) wrote:
> Hi,
>
> Our software keeps text resources in a DLL and we do not switch language
> at runtime. So if you install the Spanish text resource DLL the whole
> application will be in Spanish.
>
> InstallShield have the option to include multiple languages in a single
> setup-file. You then select GUI language of the installer when launching
> the setup-file. The language selected will the be available as a copy
> conditional for each component and that's how you can control which
> language resource DLL gets copied.
> The downside of this is that the setup-file will be bigger since it will
> contain all languages not just the language you want to install.
>
> With WiX there will be one msi-file for each localization you add but
> they will all contain the same files.
> What I wanted was a way to conditionally include the language specific
> files into the msi-file with the same culture.
> This can be solves by adding one wix-project for each language. All
> project will use the same wxs-files but the ones that include language
> specific components so there will not be duplicate code.
> But it would be nice if I could do it without multiple project files.
>
> If the culture can be checked via a CustomAction, a property could be
> set which would be a condition for the component.
> All resource DLLs will have to be included but only the single one which
> meets the above condition set by the CA will be copied.
> Can the msi-culture be read in a CustomAction?
>
> I'll take a deeper look into the MediaTemplate element to see if that
> can do the trick.
>
> Thanks,
> Magnus
>
> . The only thing I'm after here is that the msi with installer dialogs
> in Spanish should include the Spanish DLL in the installation folder.
>
> On 2017-03-27 15:47, Lewis Henderson wrote:
>> Hi Guys,
>>
>> While I'm certainly not the expert some others (like Phill) are, this sounds like you might use culture-specific files included in a set of culture-specific features (or possibly components), that are enabled or selected based on the culture chosen for the install.  Does that make sense?
>>
>> I currently have an installer that has an option to install French language files in addition to the default English, but the selection is based on a checkbox dialog.  Not the same, but perhaps a similar situation.
>>
>> 				Lewis Henderson
>>
>>
>> -----Original Message-----
>> From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Phill Hogland
>> Sent: Friday, March 24, 2017 9:02 PM
>> To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
>> Subject: [EXTERNAL] - Re: [wix-users] Language condition on file?
>>
>> Or another approach is to have a single WiX setup project, in which you specify multiple cultures, as you indicated, but in the MediaTemplate element specify an external cab.
>>
>> Then in the MsiPackage element used in a bundle chain (or through some
>> script) change the name of each msi to include the culture in the name of the msi and copy the msi and the cab for each language to a common output folder.
>>
>> This results in an output folder which contains a single cab file (as the cab in each batch build is identical) and culture named msi files.
>>
>> I have not tried your suggested approach of conditionally including culture specific files but I assume it may be possible.  I use the above approach.
>>
>> On Fri, Mar 24, 2017 at 2:39 AM, Persson, Magnus (SE-TLX) < magnus.persson at assaabloy.com> wrote:
>>
>>> If I create a WiX project in VS2015 and add localization files for
>>> English and Spanish I will get two msi-files as a result. One English
>>> and one Spanish. This is fine.
>>>
>>> However, can I in the same WiX prtoject specify English files that
>>> only compile into the English msi-file and Spanish files that will
>>> only be included in the Spanish msi-file?
>>>
>>> Or do I have to create two WiX projects in VS2015 (one for each language).
>>>
>>> Thanks
>>> Magnus
>>>
>>> ____________________________________________________________________
>>> WiX Toolset Users Mailing List provided by FireGiant
>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.firegiant.com_
>>> &d=DwICAg&c=ZgVRmm3mf2P1-XDAyDsu4A&r=yAhF6NGJ7EPmZkvswZOswwnYxaueKkO53
>>> V282tTn1P4&m=C9R-0zMvbjR5K-sjlmtIZbFZSGIxg8o1pbw1i4EUAbw&s=-i6LkzBGXO6
>>> -W4-m8ViL7HeQBa83jdGFL0_RaOUDmls&e=
>>>
>> ____________________________________________________________________
>> WiX Toolset Users Mailing List provided by FireGiant https://urldefense.proofpoint.com/v2/url?u=http-3A__www.firegiant.com_&d=DwICAg&c=ZgVRmm3mf2P1-XDAyDsu4A&r=yAhF6NGJ7EPmZkvswZOswwnYxaueKkO53V282tTn1P4&m=C9R-0zMvbjR5K-sjlmtIZbFZSGIxg8o1pbw1i4EUAbw&s=-i6LkzBGXO6-W4-m8ViL7HeQBa83jdGFL0_RaOUDmls&e=
>>
>> ____________________________________________________________________
>> WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/
>>
>>
>>    ----------------------------------------------------------------------------------------------
>> This E-mail is PLAIN text, not support HTML, see instruction below on how to report SPAM.
>> -----------------------------------------------------------------------------------------------
>> To submit spam as an attachment to an email message using a mail client:
>> 1. Open a new email message.
>> 2. Drag the spam email from the Inbox into the new email message.
>> 3. Enter asa at websense.com in the To field.
>> 4. Click Send.
>> -----------------------------------------------------------------------------------------------
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/


More information about the wix-users mailing list