Example #1
0
        public void Init(ToolkitVersionOnline onlineVersion)
        {
            // DELETE OLD UPDATER APP IF EXISTS
            var updatingAppPath = Path.Combine(localToolkitDir, APP_UPDATING);

            if (File.Exists(updatingAppPath))
            {
                File.Delete(updatingAppPath);
            }

            var useBeta = ConfigRepository.Instance().GetBoolean("general_usebeta");

            lblCurrentVersion.Text = ToolkitVersion.RSTKGuiVersion;
            lblNewVersion.Text     = String.Format("{0}-{1} {2}", onlineVersion.Version, onlineVersion.Revision, useBeta ? "BETA" : "");
            lblNewVersionDate.Text = onlineVersion.Date.ToShortDateString();

            if (onlineVersion.CommitMessages != null)
            {
                dgvCommitMessage.Visible = true;
                dgvCommitMessage.Rows.Clear();
                for (var i = 0; i < onlineVersion.CommitMessages.Length; i++)
                {
                    dgvCommitMessage.Rows.Add();
                    dgvCommitMessage.Rows[i].Cells["Message"].Value = onlineVersion.CommitMessages[i];
                }
            }
        }
Example #2
0
        public void Init(ToolkitVersionOnline onlineVersion)
        {
            // DELETE OLD UPDATER APP IF EXISTS
            var updatingApp = Path.Combine(RootDirectory, APP_UPDATING);

            if (File.Exists(updatingApp))
            {
                File.Delete(updatingApp);
            }

            currentVersionLabel.Text = ToolkitVersion.version;
            newVersionLabel.Text     = String.Format("{0}-{1}", onlineVersion.Version, onlineVersion.Revision);
            dateLabel.Text           = onlineVersion.Date.ToShortDateString();

            if (onlineVersion.CommitMessages != null)
            {
                commitMessageDataGrid.Visible = true;
                commitMessageDataGrid.Rows.Clear();
                for (var i = 0; i < onlineVersion.CommitMessages.Length; i++)
                {
                    commitMessageDataGrid.Rows.Add();
                    commitMessageDataGrid.Rows[i].Cells["Message"].Value = onlineVersion.CommitMessages[i];
                }
            }
        }
 private void CheckForUpdate(object sender, DoWorkEventArgs e)
 {
     try
     {// CHECK FOR NEW AVAILABLE VERSION AND ENABLE UPDATE
         onlineVersion = ToolkitVersionOnline.Load();
     }
     catch (WebException) { /* Do nothing on 404 */ }
     catch (Exception)
     {
         throw;
     }
 }
        public void Init(ToolkitVersionOnline onlineVersion)
        {
            if (onlineVersion.UpdateAvailable)
            {
                this.Text = "Toolkit update is available ...";
            }
            else
            {
                this.Text = "Toolkit is already up to date ...";
            }

            // delete old updater application
            var updatingAppPath = Path.Combine(LocalToolkitDir, APP_UPDATING);

            if (File.Exists(updatingAppPath))
            {
                File.Delete(updatingAppPath);
            }

            var updatingConfigPath = Path.Combine(LocalToolkitDir, APP_UPDATING + APP_CONFIG_EXT);

            if (File.Exists(updatingConfigPath))
            {
                File.Delete(updatingConfigPath);
            }

            var useBeta = ConfigRepository.Instance().GetBoolean("general_usebeta");

            lblCurrentVersion.Text = ToolkitVersion.RSTKGuiVersion;
            lblNewVersion.Text     = String.Format("{0}-{1} {2}", onlineVersion.OnlineVersion, onlineVersion.Revision, useBeta ? "" : "DISABLED");
            lblNewVersionDate.Text = onlineVersion.Date.ToShortDateString();

            if (onlineVersion.CommitMessages != null)
            {
                dgvCommitMessage.Visible = true;
                dgvCommitMessage.Rows.Clear();
                for (var i = 0; i < onlineVersion.CommitMessages.Length; i++)
                {
                    dgvCommitMessage.Rows.Add();
                    dgvCommitMessage.Rows[i].Cells["Message"].Value = onlineVersion.CommitMessages[i];
                }
            }
        }