Esempio n. 1
0
        // C o n s t r u c t o r s

        public Main()
        {
            // G u i
            this.Shown       += Main_Shown;
            this.FormClosed  += Main_FormClosed;
            this.FormClosing += Main_FormClosing;

            // Get arguments
            var args = My.MyProject.Application.CommandLineArgs.ToArray();

            if (args.Any())
            {
                // Load config
                Installer = new UpdateInstaller(UpdateInstallerConfig.Parse(args[0]));

                // Init Form
                InitializeComponent();

                // Init Style
                StyleManager.Style = eStyle.Office2016;
                StyleManager.MetroColorGeneratorParameters = new DevComponents.DotNetBar.Metro.ColorTables.MetroColorGeneratorParameters(Installer.Configuration.UpdateWindowCanvasColor, Installer.Configuration.UpdateWindowBaseColor);
                StyleManager.UpdateAmbientColors(this);

                // Init Application Header Text
                string header;
                if (!string.IsNullOrEmpty(Installer.Configuration.ApplicationName))
                {
                    header = string.Format(My.Resources.UpdateInstallerGuiLangRes.String_UpdatingApplicationX, Installer.Configuration.ApplicationName);
                }
                else
                {
                    header = My.Resources.UpdateInstallerGuiLangRes.String_UpdateIsRunning;
                }

                LabelX_Header.Text = $"<div align=\"center\" valign=\"center\"><font color=\"#B7472A\" size=\"20\"><b>{header}</b></font></div>";
            }

            if (Installer is null)
            {
                Environment.Exit(0);
            }
        }
Esempio n. 2
0
        // C o n s t r c u t o r s

        public UpdateInstaller(UpdateInstallerConfig config)
        {
            Configuration = config;
        }