Exemplo n.º 1
0
        public Main()
        {
            InitializeComponent();

            ControlPanel.DefaultSettings = new Logger.LogSettings
            {
                FilePath  = @"Logs\Log.xml",
                WriteMode = Logger.WriteMode.XML
            };

            ControlPanel.ResourceSettingsPath = Application.StartupPath + @"\\CometSettings.resources";
            ControlPanel.SettingsManager      = new SettingsManager(@"Logs\Settings.xml");
            ControlPanel.SettingsManager.Load();
            ControlPanel.FileHistoryLocation = @"Logs\History.xml";
            ControlPanel.PackageFileTypes    = @"Package File|*.package";
            ControlPanel.InstallerPath       = "Installer.exe";

            Logger.Log(ControlPanel.DefaultSettings, $"Started {Application.ProductName}");

            Uri _updaterServerPath = new Uri(@"https://raw.githubusercontent.com/DarkByte7/Comet/master/PackageManager/Update.package");

            _updater = new CometUpdater(_updaterServerPath, Assembly.GetExecutingAssembly().Location, ControlPanel.SettingsManager.UpdaterSettings.AutoUpdate, ControlPanel.SettingsManager.UpdaterSettings.DisplayWelcomePage);
            _updater.CheckingForUpdate += CometUpdater_CheckingForUpdate;
            _updater.CheckForUpdate();

            string _source = ResourcesManager.ReadResource(Application.StartupPath + @"\Comet.dll", "Comet.Setup.MainEntryPoint.cs");

            tbSource.Text = _source;

            InitializeDownloadSitesTabPage();
        }
Exemplo n.º 2
0
        /// <summary>The about tool strip menu item.</summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The event.</param>
        private void CheckForUpdatesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            _updater.CheckForUpdate();
            _updater.DisplayWelcomePage = ControlPanel.SettingsManager.UpdaterSettings.DisplayWelcomePage;

            if (_updater.UpdateAvailable)
            {
                _updater.ShowProgressDialog();
            }
        }