예제 #1
0
        static string BuildUiPlayerResources()
        {
            var dir    = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"WixSharp\Demo_UIPlayer");
            var result = Path.Combine(dir, "Demo_UIPlayer.msi");

            if (System.IO.File.Exists(result))
            {
                return(result);
            }
            else
            {
                try { Compiler.OutputWriteLine("Building UIPlayer resources..."); } catch { }
                if (!Directory.Exists(dir))
                {
                    Directory.CreateDirectory(dir);
                }

                var project = new Project("Demo_UIPlayer",
                                          new Dir(@"%ProgramFiles%\WixSharp\Demo_UIPlayer"));

                project.OutDir = dir;

                string licence      = ManagedUI.Default.LicenceFileFor(project);
                string localization = ManagedUI.Default.LocalizationFileFor(project);
                string bitmap       = ManagedUI.Default.DialogBitmapFileFor(project);
                string banner       = ManagedUI.Default.DialogBannerFileFor(project);

                project.AddBinary(new Binary(new Id("WixSharp_UIText"), localization),
                                  new Binary(new Id("WixSharp_LicenceFile"), licence),
                                  new Binary(new Id("WixUI_Bmp_Dialog"), bitmap),
                                  new Binary(new Id("WixUI_Bmp_Banner"), banner));

                project.UI = WUI.WixUI_ProgressOnly;
                return(project.BuildMsi());
            }
        }