wyDay.Controls.AutomaticUpdaterBackend.Initialize C# (CSharp) Method

Initialize() public method

The intialize function must be called before you can use any other functions.
public Initialize ( ) : void
return void
        public void Initialize()
        {
            // read settings file for last check time
            AutoUpdaterInfo = new AutoUpdaterInfo(m_GUID, null);

            // see if update is pending, if so force install
            if (AutoUpdaterInfo.UpdateStepOn == UpdateStepOn.UpdateReadyToInstall)
            {
                //TODO: test funky non-compliant state file

                // then KillSelf&StartUpdater
                ClosingForInstall = true;

                // start the updater
                InstallPendingUpdate();
            }
        }

Usage Example

Example #1
0
        static void Main(string[] args)
        {
            auBackend = new AutomaticUpdaterBackend
                            {
                                //TODO: set a unique string. For instance, "appname-companyname"
                                GUID = "a-string-that-uniquely-IDs-your-app",

                                // With UpdateType set to Automatic, you're still in charge of
                                // checking for updates, but the AutomaticUpdaterBackend
                                // continues with the downloading and extracting automatically.
                                UpdateType = UpdateType.Automatic
                            };

            auBackend.ReadyToBeInstalled += auBackend_ReadyToBeInstalled;
            auBackend.UpdateSuccessful += auBackend_UpdateSuccessful;

            //TODO: use the failed events for logging & error reporting:
            // CheckingFailed, DownloadingFailed, ExtractingFailed, UpdateFailed

            // the functions to be called after all events have been set.
            auBackend.Initialize();
            auBackend.AppLoaded();

            // sees if you checked in the last 10 days, if not it rechecks
            CheckEvery10Days();

            // Blocks until "resetEvent.Set()" on another thread
            resetEvent.WaitOne();
        }
All Usage Examples Of wyDay.Controls.AutomaticUpdaterBackend::Initialize