public MainApplicationContext()
        {
            Application.ApplicationExit += new EventHandler(Application_ApplicationExit);

            syncCntx = new WindowsFormsSynchronizationContext();

            installer = new Installer(this);
            if (installer.CheckNeedInstall())
            {
                installer.InstallAsync();

                return;
            }
            installer = null;

            stopTimer = new ManualResetEvent(false);
            passTimer = new ManualResetEvent(true);

            lastWorking = s.IsCheckOnlyWhenStartup;

            if (Program.ArgumentExists("/setstartup")
                || s.InitialStart)
            {
                s.RunOnStartup = true;
            }

            if (IsNeededToShowSettings())
            {
                ShowSettings();
            }

            SingleInstanceProgram.Instance.AnotherProcessLaunched += new EventHandler<EventArgs>(Instance_AnotherProcessLaunched);

            updater = new GitHubUpdater("iamxail", Program.SafeName);
            #if DEBUG
            //do nothing
            #else
            updater.CheckCompleted += new CheckCompletedEventHandler(updater_CheckCompleted);
            updater.UpdateCompleted += new UpdateCompletedEventHandler(updater_UpdateCompleted);
            updater.CheckAsync();
            #endif

            tmrDownload = new System.Timers.Timer();
            tmrDownload.Interval = 5000;
            tmrDownload.Elapsed += new System.Timers.ElapsedEventHandler(tmrDownload_Elapsed);
            tmrDownload.Start();

            tray = new TrayIcon();
        }