Tuesday, June 20, 2017

wix support localization with .wixproj


          
   
1:  your .wixproj files include the .wxl  file
          
         <ItemGroup>
             <EmbeddedResource Include="en_us.wxl" />
             <EmbeddedResource Include="zh_cn.wxl" />
       </ItemGroup>

2:  .wxl file look like:


       <?xml version="1.0" encoding="utf-8"?>
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
<String Id="WelcomeDlgDescription">This Setup Wizard will install [ProductName] [MajorVersion].[MinorVersion] on your computer. Click Next to continue or Cancel to exit.</String>
</WixLocalization>
   
         http://wixtoolset.org/documentation/manual/v3/wixui/wixui_localization.html

             Table of culture codes.        
LanguageLocationCulture codeWXL file
ArabicSaudi Arabiaar-SAWixUI_ar-SA.wxl
BulgarianBulgariabg-BGWixUI_bg-BG.wxl
CatalanSpainca-ESWixUI_ca-ES.wxl
CroatianCroatiahr-HRWixUI_hr-HR.wxl
CzechCzech Republiccs-CZWixUI_cs-CZ.wxl
DanishDenmarkda-DKWixUI_da-DK.wxl
DutchNetherlandsnl-NLWixUI_nl-NL.wxl
EnglishUnited Statesen-USWixUI_en-US.wxl
EstonianEstoniaet-EEWixUI_et-EE.wxl
FinnishFinlandfi-FIWixUI_fi-FI.wxl
FrenchFrancefr-FRWixUI_fr-FR.wxl
GermanGermanyde-DEWixUI_de-DE.wxl
GreekGreeceel-GRWixUI_el-GR.wxl
HebrewIsraelhe-ILWixUI_he-IL.wxl
HindiIndiahi-INWixUI_hi-IN.wxl
HungarianHungaryhu-HUWixUI_hu-HU.wxl
ItalianItalyit-ITWixUI_it-IT.wxl
JapaneseJapanja-JPWixUI_ja-JP.wxl
KazakhKazakhstankk-KZWixUI_kk-KZ.wxl
KoreanKoreako-KRWixUI_ko-KR.wxl
LatvianLatvialv-LVWixUI_lv-LV.wxl
LithuanianLithuanialt-LTWixUI_lt-LT.wxl
Norwegian (Bokmål)Norwaynb-NOWixUI_nb-NO.wxl
PolishPolandpl-PLWixUI_pl-PL.wxl
PortugueseBrazilpt-BRWixUI_pt-BR.wxl
PortuguesePortugalpt-PTWixUI_pt-PT.wxl
RomanianRomaniaro-ROWixUI_ro-RO.wxl
RussianRussiaru-RUWixUI_ru-RU.wxl
Serbian (Latin)Serbia and Montenegrosr-Latn-CSWixUI_sr-Latn-CS.wxl
Simplified ChineseChinazh-CNWixUI_zh-CN.wxl
SlovakSlovak Republicsk-SKWixUI_sk-SK.wxl
SlovenianSolveniasl-SIWixUI_sl_SI.wxl
SpanishSpaines-ESWixUI_es-ES.wxl
SwedishSwedensv-SEWixUI_sv-SE.wxl
ThaiThailandth-THWixUI_th-TH.wxl
Traditional ChineseHong Kong SARzh-HKWixUI_zh-HK.wxl
Traditional ChineseTaiwanzh-TWWixUI_zh-TW.wxl
TurkishTurkeytr-TRWixUI_tr-TR.wxl
UkrainianUkraineuk-UAWixUI_uk-UA.wxl

embedding dlls into exe .net C#

https://stackoverflow.com/questions/6920920/embedding-dlls-into-exe-in-in-visual-c-sharp-2010

1: visual studio project include the dlls  Build Action as "Embedded Resource"

2: in program.cs  file  ,
    using System.Reflection;
    using System.IO;

3:  in main() function
      //Load embedded resources dll to CurrentDomain.
            AppDomain.CurrentDomain.AssemblyResolve += (sender, args) =>
            {
                String dllName = new AssemblyName(args.Name).Name + ".dll";
                var assem = Assembly.GetExecutingAssembly();
                String resourceName = assem.GetManifestResourceNames().FirstOrDefault(rn => rn.EndsWith(dllName));
                if (resourceName == null) return null;
                using (var stream = assem.GetManifestResourceStream(resourceName))
                {
                    Byte[] assemblyData = new Byte[stream.Length];
                    stream.Read(assemblyData, 0, assemblyData.Length);
                    return Assembly.Load(assemblyData);
                }
            };