示例#1
0
 public void EmbeddResourcesInto(ManagedProject project)
 {
     project.AddBinary(new Binary(new Id("WixSharp_UIText"), LocalizationFileFor(project)));
     project.AddBinary(new Binary(new Id("WixSharp_LicenceFile"), LicenceFileFor(project)));
     project.AddBinary(new Binary(new Id("WixUI_Bmp_Dialog"), DialogBitmapFileFor(project)));
     project.AddBinary(new Binary(new Id("WixUI_Bmp_Banner"), DialogBannerFileFor(project)));
 }
示例#2
0
        /// <summary>
        /// Localizes the specified <see cref="ManagedProject"/> project.
        /// </summary>
        /// <param name="project">The <see cref="ManagedProject"/> project to localize.</param>
        public static void Localize(this ManagedProject project)
        {
            project.AddBinary(new Binary(new Id("fi_FI_xsl"), @"Files\Localization\WixUI_fi-FI.wxl"));
            project.AddBinary(new Binary(new Id("en_US_xsl"), @"Files\Localization\WixUI_en-US.wxl"));

            project.UIInitialized += e =>
            {
                MsiRuntime runtime = e.ManagedUI.Shell.MsiRuntime();


                var language = DetectLanguage();
                e.Session["LANGNAME"] = GetAttribute(language).Code;

                switch (language)
                {
                case SupportedLanguages.FinnishFinland:
                    runtime.UIText.InitFromWxl(e.Session.ReadBinary("fi_FI_xsl"));
                    break;

                case SupportedLanguages.EnglishUnitedStates:
                    runtime.UIText.InitFromWxl(e.Session.ReadBinary("en_US_xsl"));
                    break;

                default:     // default to English (US)..
                    runtime.UIText.InitFromWxl(e.Session.ReadBinary("en_US_xsl"));
                    break;
                }
            };
        }
示例#3
0
    static void Localize(this ManagedProject project)
    {
        project.AddBinary(new Binary(new Id("de_xsl"), "WixUI_de-DE.wxl"))
        .AddBinary(new Binary(new Id("gr_xsl"), "WixUI_el-GR.wxl"));

        project.UIInitialized += (SetupEventArgs e) =>
        {
            MsiRuntime runtime = e.ManagedUI.Shell.MsiRuntime();

            switch (DetectLanguage())
            {
            case SupportedLanguages.German:
                runtime.UIText.InitFromWxl(e.Session.ReadBinary("de_xsl"));
                break;

            case SupportedLanguages.Greek:
                runtime.UIText.InitFromWxl(e.Session.ReadBinary("gr_xsl"));
                break;
            }
        };
    }