Ejemplo n.º 1
0
        void m_msiUpdater_onDataPump(msiupdater.MSIUpdaterEventArgs e)
        {
            Console.WriteLine("m_msiUpdater_onDataPump: " + e.Data + " " + e.XMLFile);
            SetStatusText(e.Data);

            if (e.UpdateAvailable)
            {
                //                barUpdatestatus.ImageIndex = 28;
                //ShowChangeLog(e.Version);
                //this.Invoke(m_DelegateShowChangeLog, e.Version);

                if (e.XMLFile != "" && e.Version.ToString() != "0.0")
                {
                    if (!this.IsDisposed)
                    {
                        try
                        {
                            this.Invoke(m_DelegateStartReleaseNotePanel, e.XMLFile, e.Version.ToString());
                        }
                        catch (Exception E)
                        {
                            Console.WriteLine(E.Message);
                        }
                    }
                }

                frmUpdateAvailable frmUpdate = new frmUpdateAvailable();
                frmUpdate.SetVersionNumber(e.Version.ToString());
                if (m_msiUpdater != null)
                {
                    m_msiUpdater.Blockauto_updates = false;
                }
                if (frmUpdate.ShowDialog() == DialogResult.OK)
                {
                    if (m_msiUpdater != null)
                    {
                        m_msiUpdater.ExecuteUpdate(e.Version);
                        System.Windows.Forms.Application.Exit();
                    }
                }
                else
                {
                    // gebruiker heeft nee gekozen, niet meer lastig vallen
                    if (m_msiUpdater != null)
                    {
                        m_msiUpdater.Blockauto_updates = false;
                    }
                }
            }
            // test
            //frmUpdateAvailable frmUpdatetest = new frmUpdateAvailable();
            //frmUpdatetest.ShowDialog();
            // test
        }
Ejemplo n.º 2
0
 void m_msiUpdater_onUpdateProgressChanged(msiupdater.MSIUpdateProgressEventArgs e)
 {
     Console.WriteLine("m_msiUpdater_onUpdateProgressChanged: " + e.PercentageDone.ToString());
 }
Ejemplo n.º 3
0
        private void Form1_Shown(object sender, EventArgs e)
        {
            if (!_immoValid)
            {
                ribbonFile.Visible = false;
                ribbonActions.Visible = false;
                ribbonAdvancedTuning.Visible = false;
                ribbonManualTuning.Visible = false;
                ribbonOnline.Visible = false;
                rbnPageLogging.Visible = false;
                ribbonProgramming.Visible = false;
                //ribbonProgramming.Visible = false;

                ribbonControl1.SelectedPage = ribbonHelp;
                btnSwitchMode.Enabled = false;
                Application.DoEvents();
            }
            else
            {
                ribbonControl1.SelectedPage = ribbonFile;
                Application.DoEvents();
            }
            SetModeAndFilters();
            _splash.Hide();

            if (m_startFromCommandLine)
            {
                if (File.Exists(m_commandLineFile))
                {
                    OpenWorkingFile(m_commandLineFile);
                }
            }
            else if (m_appSettings.AutoLoadLastFile)
            {
                //check if last opened was a project or a seperate file
                if (m_appSettings.LastOpenedType == 0)
                {
                    if (m_appSettings.Lastfilename != "")
                    {
                        if (File.Exists(m_appSettings.Lastfilename))
                        {
                            if (_immoValid)
                            {
                                OpenWorkingFile(m_appSettings.Lastfilename);
                            }
                        }
                    }
                }
                else
                {
                    if (m_appSettings.Lastprojectname != "")
                    {
                        if (_immoValid)
                        {
                            OpenProject(m_appSettings.Lastprojectname);
                        }
                    }
                }
            }
               // InitSkins();
            try
            {
                m_msiUpdater = new msiupdater(new Version(System.Windows.Forms.Application.ProductVersion));
                m_msiUpdater.Apppath = System.Windows.Forms.Application.UserAppDataPath;
                m_msiUpdater.onDataPump += new msiupdater.DataPump(m_msiUpdater_onDataPump);
                m_msiUpdater.onUpdateProgressChanged += new msiupdater.UpdateProgressChanged(m_msiUpdater_onUpdateProgressChanged);
                m_msiUpdater.CheckForUpdates("Global", "http://develop.trionictuning.com/T5Suite2/", "", "", false);

            }
            catch (Exception E)
            {
                Console.WriteLine("Failed to get initial update: " + E.Message);
            }
            if (IsChristmasTime())
            {
                ShowChristmasWish();
            }
        }