Hi Lian,
If you're using Visual Studio and Votive, I would:
1.
Move Main_<whatever language>.wxs into a common location, Main.wxs, and
add it to your English and Japanese projects as a *linked* item. Main.wxs would
also have an include, <?include ../$(var.LanguageId)/language-code.wxi?>
2.
Add a pre-processor variable "LanguageId" to both your projects that
would be set to the name of the directories, in this case, "en-us" and "ja-jp".
This is how Main.wxs will find each language-code.wxi file specified in the
<?include?> during build time.
\MyInstaller
\common
Main.wxs
\en-us
Myinstaller_en.wixproj (LanguageId=en-us)
<link to ..\common\Main.wxs>
language-code.wxi
\ja-jp
Myinstaller_ja.wixproj (LanguageId=ja-jp)
<link to ..\common\Main.wxs>
language-code.wxi
I've used this setup for the installers for a number of payment gateway
plug-ins that we support. Over 80% of the code-base for each plug-in is common
code that is shared by all plug-ins including the custom actions, properties,
and directory structure. Each plug-in has its own WXI file that contains unique
GUIDs and a unique path. Now, any changes on how the plug-ins are installed is
made is one file (or set of files) and is propogated across the 10+ plug-ins.
________________________________
From: Lian Jiang [mailto:[email protected]]
Sent: Wed 8/12/2009 6:05 PM
To: General discussion for Windows Installer XML toolset.
Subject: [WiX-users] how to refactor my code to support multiple localeseasier
Hi,
I have below file structure for supporting multiple locales:
\MyInstaller
\en-us
Myinstaller_en.wixproj
Main_en.wxs
\ja-jp
Myinstaller_ja.wixproj
Main_ja.wxs
The only difference between Main_en.wxs and Main_ja.wxs is that the former uses
1033 as language ID and the latter uses 1041.
<?define LCID="1041"?>
<Product Id="$(var.PRODUCT_GUID)">
......
</Product>
As you can see, it is a big pain that every time when I update <Product> node
in Main_en.wxs, I need to update Main_ja.wxs correspondingly. To relieve this
pain, I tried to change the file structure into below one but did not succeed:
\MyInstaller
Commondefine.wxi
\en-us
Myinstaller_en.wixproj
Main_en.wxs
\ja-jp
Myinstaller_ja.wixproj
Main_ja.wxs
This does not work because the whole <Product> node is the same for en-us and
ja-jp. Only the macro which can be defined in wxi file is different.
I know there is a way to create multiple locales installers using only one
wixproj but it does not work here because I need to generate transform from
en-us installer to ja-jp installer to create a MUI-based installer.
How can I decouple <Product> node from the locale-specific part (e.g. LCID
define) so that changing <Product> node does not need to change both locales'
wxs files?
Appreciate your help.
Thanks
Lian
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users