ForceCheckForUpdate() 공개 메소드

Check for updates forcefully -- returns true if the updating has begun. Use the "CheckingFailed", "UpdateAvailable", or "UpToDate" events for the result.
public ForceCheckForUpdate ( ) : bool
리턴 bool
예제 #1
0
        AutomaticUpdaterBackend updater; //this is what we are adding

        public MainWindow() // remember to change this to UpdateWindow if above changed
        {
            System.Threading.Thread.Sleep(3000); //We are telling program to pause here 

            InitializeComponent(); // now lets start

            updater = new AutomaticUpdaterBackend() // we still have to properly define AutoUpBackend
            {
                GUID = "06AF8C3C-BA10-4938-9D4C-5CAC43A006A7", // have to define this thing as well :/
                UpdateType = UpdateType.CheckAndDownload, // What type of update is you doing?
            }; // f*****g semicolon

            // we define the updater things

            updater.CheckingFailed += Updater_CheckingFailed;
            
            updater.UpdateAvailable += OnUpdateAvailable;
            updater.DownloadingFailed += OnDownloadingFailed;
            updater.ExtractingFailed += OnExtractingFailed;
            //alot of things fail
            updater.ReadyToBeInstalled += OnReadyToBeInstalled;
            updater.UpdateSuccessful += OnUpdateSuccessful;
            updater.UpdateFailed += OnFailed;
            updater.UpToDate += OnUpToDate;

            // telling the updater we are good to go
            updater.Initialize();
            updater.AppLoaded();

            updater.ForceCheckForUpdate(); // the most controversial command

            // Console.WriteLine("legggo b0$$");

        }
예제 #2
0
        public SettingsForm()
        {
            InitializeComponent();

            var backEnd = new AutomaticUpdaterBackend
            {
                GUID = "Fireball AutoUpdater",
                UpdateType = UpdateType.Automatic
            };

            backEnd.Initialize();
            backEnd.AppLoaded();

            backEnd.ReadyToBeInstalled += (s, e) =>
            {
                if (backEnd.UpdateStepOn != UpdateStepOn.UpdateReadyToInstall)
                    return;

                backEnd.InstallNow();
                Application.Exit();
            };

            if (backEnd.ClosingForInstall)
                return;

            backEnd.ForceCheckForUpdate(true);

            Icon = tray.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);

            var builder = new StringBuilder();
            {
                builder.Append("Image Files (*.png;*.gif;*.jpg;*.jpeg;*.bmp)|*.png;*.gif;*.jpg;*.jpeg;*.bmp|");
                builder.Append("PNG|*.png|");
                builder.Append("GIF|*.gif|");
                builder.Append("JPG|*.jpg|");
                builder.Append("JPEG|*.jpeg|");
                builder.Append("BMP|*.bmp");
            }

            imageFilter = builder.ToString();

            PopulateCombos();
            Settings.Instance = SettingsManager.Load();
            settings = Settings.Instance;
            PopulateSettings();

            PluginManager.Load();

            foreach (IPlugin plugin in PluginManager.Plugins)
            {
                PluginItem item = new PluginItem(plugin);
                cPlugins.Items.Add(item);

                if (settings.ActivePlugin.Equals(plugin.Name))
                    cPlugins.SelectedItem = item;
            }

            if (cPlugins.SelectedItem == null && cPlugins.Items.Count > 0)
                cPlugins.SelectedIndex = 0;

            #region :: Register Hotkeys ::
            /*StringBuilder hotkeyRegisterErrorBuilder = new StringBuilder();

            if (settings.CaptureScreenHotey.GetCanRegister(this))
            {
                settings.CaptureScreenHotey.Register(this);
                settings.CaptureScreenHotey.Pressed += CaptureScreenHotkeyPressed;
            }
            else
            {
                if (settings.CaptureScreenHotey.KeyCode != Keys.None)
                    hotkeyRegisterErrorBuilder.AppendFormat(" - Can't register capture screen hotkey ({0})\n", settings.CaptureScreenHotey);
            }

            if (settings.CaptureAreaHotkey.GetCanRegister(this))
            {
                settings.CaptureAreaHotkey.Register(this);
                settings.CaptureAreaHotkey.Pressed += CaptureAreaHotkeyPressed;
            }
            else
            {
                if (settings.CaptureScreenHotey.KeyCode != Keys.None)
                    hotkeyRegisterErrorBuilder.AppendFormat(" - Can't register capture area hotkey ({0})\n", settings.CaptureAreaHotkey);
            }

            if (hotkeyRegisterErrorBuilder.Length > 0)
            {
                Helper.InfoBoxShow(String.Format("Failed to register hotkeys!\n{0}", hotkeyRegisterErrorBuilder));
            }*/
            #endregion

            SaveSettings();

            Application.ApplicationExit += (s, e) => SettingsManager.Save();
        }
예제 #3
0
 void tmrWaitBeforeCheck_Tick(object sender, EventArgs e)
 {
     //Visible = false;
     auBackend.ForceCheckForUpdate(false);
 }