Only check for updates based on update frequency setting. Changed design of Check for Updates page.

This commit is contained in:
Riley McArdle
2010-01-17 18:25:37 -06:00
parent 149f5785ad
commit 2a5121d07a
9 changed files with 208 additions and 130 deletions

View File

@@ -254,26 +254,33 @@ Namespace App
End Sub
Public Shared Sub UpdateCheck()
If My.Settings.CheckForUpdatesOnStartup Then
frmMain.tmrShowUpdate.Enabled = True
Windows.updateForm.CheckForUpdate()
AddHandler Windows.updateForm.UpdateCheckCompleted, AddressOf UpdateCheckComplete
If My.Settings.CheckForUpdatesAsked And My.Settings.CheckForUpdatesOnStartup Then
If My.Settings.UpdatePending Or My.Settings.CheckForUpdatesLastCheck < Date.Now.Subtract(TimeSpan.FromDays(My.Settings.CheckForUpdatesFrequencyDays)) Then
frmMain.tmrShowUpdate.Enabled = True
Windows.updateForm.CheckForUpdate()
AddHandler Windows.updateForm.UpdateCheckCompleted, AddressOf UpdateCheckComplete
End If
End If
End Sub
Private Shared Sub UpdateCheckComplete(ByVal UpdateAvailable As Boolean)
My.Settings.CheckForUpdatesLastCheck = Date.Now
My.Settings.UpdatePending = UpdateAvailable
IsUpdateAvailable = UpdateAvailable
End Sub
Public Shared Sub AnnouncementCheck()
If App.Editions.Spanlink.Enabled = False Then
frmMain.tmrShowUpdate.Enabled = True
Windows.AnnouncementForm.CheckForAnnouncement()
AddHandler Windows.AnnouncementForm.AnnouncementCheckCompleted, AddressOf AnnouncementCheckComplete
If My.Settings.CheckForUpdatesAsked And My.Settings.CheckForUpdatesOnStartup And App.Editions.Spanlink.Enabled = False Then
If My.Settings.CheckForUpdatesLastCheck < Date.Now.Subtract(TimeSpan.FromDays(My.Settings.CheckForUpdatesFrequencyDays)) Then
frmMain.tmrShowUpdate.Enabled = True
Windows.AnnouncementForm.CheckForAnnouncement()
AddHandler Windows.AnnouncementForm.AnnouncementCheckCompleted, AddressOf AnnouncementCheckComplete
End If
End If
End Sub
Private Shared Sub AnnouncementCheckComplete(ByVal AnnouncementAvailable As Boolean)
My.Settings.CheckForUpdatesLastCheck = Date.Now
IsAnnouncementAvailable = AnnouncementAvailable
End Sub

View File

@@ -26,9 +26,15 @@ Namespace Config
Public Sub Load()
Try
With Me._MainForm
' Migrate settings from previous version
If My.Settings.DoUpgrade Then
My.Settings.Upgrade()
My.Settings.DoUpgrade = False
' Clear pending update flag
' This is used for automatic updates, not for settings migration, but it
' needs to be cleared here because we know that we just updated.
My.Settings.UpdatePending = False
End If
If My.Settings.MainFormLocation <> New Point(999, 999) Then

View File

@@ -51,7 +51,7 @@ Public Class frmMain
If Not My.Settings.CheckForUpdatesAsked Then
Windows.Show(UI.Window.Type.Options)
Windows.optionsForm.ShowUpdatesTab()
My.Settings.CheckForUpdatesAsked = True
End If
Startup.UpdateCheck()
@@ -125,10 +125,8 @@ Public Class frmMain
End If
If App.Runtime.IsUpdateAvailable Then
If My.Settings.CheckForUpdatesOnStartup Then
App.Runtime.Windows.Show(UI.Window.Type.Update)
Me.tmrShowUpdate.Enabled = False
End If
App.Runtime.Windows.Show(UI.Window.Type.Update)
Me.tmrShowUpdate.Enabled = False
End If
If App.Runtime.IsAnnouncementAvailable Then

View File

@@ -320,13 +320,13 @@
Public Const CollapseAllFolders As String = "Collapse all folders"
Public Const NewConnection As String = "New Connection"
Public Const NewFolder As String = "New Folder"
Public Const CheckForUpdate As String = "Check for update"
Public Const CheckForUpdate As String = "Check Again"
Public Const DownloadAndInstall As String = "Download and Install"
Public Const AvailableVersion As String = "Available Version"
Public Const CurrentVersion As String = "Current Version"
Public Const AvailableVersion As String = "Current version"
Public Const CurrentVersion As String = "Installed version"
Public Const Version As String = "Version"
Public Const UpdateAvailable As String = "Update available!"
Public Const NoUpdateAvailable As String = "No update available!"
Public Const UpdateAvailable As String = "mRemoteNG requires an update"
Public Const NoUpdateAvailable As String = "mRemoteNG is up to date"
Public Const UpdateDownloadComplete As String = "Download complete!" & vbNewLine & "mRemoteNG will now quit and begin with the installation."
Public Const SendTo As String = "Send to..."
Public Const Screen As String = "Screen"

View File

@@ -1949,6 +1949,32 @@ Namespace My
Me("CheckForUpdatesFrequencyDays") = value
End Set
End Property
<Global.System.Configuration.UserScopedSettingAttribute(), _
Global.System.Configuration.SettingsProviderAttribute(GetType(mRemote.Config.Settings.Providers.ChooseProvider)), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("1980-01-01")> _
Public Property CheckForUpdatesLastCheck() As Date
Get
Return CType(Me("CheckForUpdatesLastCheck"),Date)
End Get
Set
Me("CheckForUpdatesLastCheck") = value
End Set
End Property
<Global.System.Configuration.UserScopedSettingAttribute(), _
Global.System.Configuration.SettingsProviderAttribute(GetType(mRemote.Config.Settings.Providers.ChooseProvider)), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Configuration.DefaultSettingValueAttribute("False")> _
Public Property UpdatePending() As Boolean
Get
Return CType(Me("UpdatePending"),Boolean)
End Get
Set
Me("UpdatePending") = value
End Set
End Property
End Class
End Namespace

View File

@@ -440,5 +440,11 @@
<Setting Name="CheckForUpdatesFrequencyDays" Provider="mRemote.Config.Settings.Providers.ChooseProvider" Type="System.Int32" Scope="User">
<Value Profile="(Default)">7</Value>
</Setting>
<Setting Name="CheckForUpdatesLastCheck" Provider="mRemote.Config.Settings.Providers.ChooseProvider" Type="System.DateTime" Scope="User">
<Value Profile="(Default)">1980-01-01</Value>
</Setting>
<Setting Name="UpdatePending" Provider="mRemote.Config.Settings.Providers.ChooseProvider" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>

View File

@@ -102,6 +102,7 @@ Namespace UI
Friend WithEvents cboUpdateCheckFrequency As System.Windows.Forms.ComboBox
Friend WithEvents lblUpdatesExplanation As System.Windows.Forms.Label
Friend WithEvents pnlUpdateCheck As System.Windows.Forms.Panel
Friend WithEvents btnUpdateCheckNow As System.Windows.Forms.Button
Friend WithEvents TabController As Crownwood.Magic.Controls.TabControl
Private Sub InitializeComponent()
@@ -110,6 +111,7 @@ Namespace UI
Me.pnlUpdates = New System.Windows.Forms.Panel
Me.lblUpdatesExplanation = New System.Windows.Forms.Label
Me.pnlUpdateCheck = New System.Windows.Forms.Panel
Me.btnUpdateCheckNow = New System.Windows.Forms.Button
Me.chkCheckForUpdatesOnStartup = New System.Windows.Forms.CheckBox
Me.cboUpdateCheckFrequency = New System.Windows.Forms.ComboBox
Me.pnlProxy = New System.Windows.Forms.Panel
@@ -277,13 +279,24 @@ Namespace UI
'
'pnlUpdateCheck
'
Me.pnlUpdateCheck.Controls.Add(Me.btnUpdateCheckNow)
Me.pnlUpdateCheck.Controls.Add(Me.chkCheckForUpdatesOnStartup)
Me.pnlUpdateCheck.Controls.Add(Me.cboUpdateCheckFrequency)
Me.pnlUpdateCheck.Location = New System.Drawing.Point(16, 64)
Me.pnlUpdateCheck.Name = "pnlUpdateCheck"
Me.pnlUpdateCheck.Size = New System.Drawing.Size(536, 72)
Me.pnlUpdateCheck.Size = New System.Drawing.Size(536, 120)
Me.pnlUpdateCheck.TabIndex = 137
'
'btnUpdateCheckNow
'
Me.btnUpdateCheckNow.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnUpdateCheckNow.Location = New System.Drawing.Point(8, 80)
Me.btnUpdateCheckNow.Name = "btnUpdateCheckNow"
Me.btnUpdateCheckNow.Size = New System.Drawing.Size(80, 32)
Me.btnUpdateCheckNow.TabIndex = 136
Me.btnUpdateCheckNow.Text = "Check Now"
Me.btnUpdateCheckNow.UseVisualStyleBackColor = True
'
'chkCheckForUpdatesOnStartup
'
Me.chkCheckForUpdatesOnStartup.AutoSize = True
@@ -298,6 +311,7 @@ Namespace UI
'cboUpdateCheckFrequency
'
Me.cboUpdateCheckFrequency.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cboUpdateCheckFrequency.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.cboUpdateCheckFrequency.FormattingEnabled = True
Me.cboUpdateCheckFrequency.Location = New System.Drawing.Point(48, 40)
Me.cboUpdateCheckFrequency.Name = "cboUpdateCheckFrequency"
@@ -311,7 +325,7 @@ Namespace UI
Me.pnlProxy.Controls.Add(Me.chkUseProxyAuthentication)
Me.pnlProxy.Controls.Add(Me.pnlProxyAuthentication)
Me.pnlProxy.Controls.Add(Me.btnTestProxy)
Me.pnlProxy.Location = New System.Drawing.Point(16, 168)
Me.pnlProxy.Location = New System.Drawing.Point(16, 216)
Me.pnlProxy.Name = "pnlProxy"
Me.pnlProxy.Size = New System.Drawing.Size(536, 224)
Me.pnlProxy.TabIndex = 134
@@ -1758,6 +1772,10 @@ Namespace UI
cboUpdateCheckFrequency.Enabled = chkCheckForUpdatesOnStartup.Checked
End Sub
Private Sub btnUpdateCheckNow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdateCheckNow.Click
App.Runtime.Windows.Show(UI.Window.Type.Update)
End Sub
Private Sub chkUseProxyForAutomaticUpdates_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkUseProxyForAutomaticUpdates.CheckedChanged
Me.pnlProxyBasic.Enabled = Me.chkUseProxyForAutomaticUpdates.Checked
Me.btnTestProxy.Enabled = Me.chkUseProxyForAutomaticUpdates.Checked

View File

@@ -11,30 +11,30 @@ Namespace UI
#Region "Form Init"
Friend WithEvents lblStatus As System.Windows.Forms.Label
Friend WithEvents txtChangeLog As System.Windows.Forms.TextBox
Friend WithEvents lblCurrentVersion As System.Windows.Forms.Label
Friend WithEvents lblAvailableVersion As System.Windows.Forms.Label
Friend WithEvents prgbDownload As System.Windows.Forms.ProgressBar
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents btnDownload As System.Windows.Forms.Button
Friend WithEvents Label7 As System.Windows.Forms.Label
Friend WithEvents lblChangeLogLabel As System.Windows.Forms.Label
Friend WithEvents pnlUp As System.Windows.Forms.Panel
Friend WithEvents lblCurrentVersionLabel As System.Windows.Forms.Label
Friend WithEvents lblInstalledVersionLabel As System.Windows.Forms.Label
Friend WithEvents lblAvailableVersion As System.Windows.Forms.Label
Friend WithEvents lblCurrentVersion As System.Windows.Forms.Label
Friend WithEvents pbUpdateImage As System.Windows.Forms.PictureBox
Friend WithEvents btnCheckForUpdate As System.Windows.Forms.Button
Private Sub InitializeComponent()
Me.btnCheckForUpdate = New System.Windows.Forms.Button
Me.pnlUp = New System.Windows.Forms.Panel
Me.pbUpdateImage = New System.Windows.Forms.PictureBox
Me.Label7 = New System.Windows.Forms.Label
Me.lblChangeLogLabel = New System.Windows.Forms.Label
Me.btnDownload = New System.Windows.Forms.Button
Me.Label4 = New System.Windows.Forms.Label
Me.Label5 = New System.Windows.Forms.Label
Me.prgbDownload = New System.Windows.Forms.ProgressBar
Me.lblAvailableVersion = New System.Windows.Forms.Label
Me.lblCurrentVersion = New System.Windows.Forms.Label
Me.txtChangeLog = New System.Windows.Forms.TextBox
Me.lblStatus = New System.Windows.Forms.Label
Me.lblCurrentVersionLabel = New System.Windows.Forms.Label
Me.lblInstalledVersionLabel = New System.Windows.Forms.Label
Me.lblAvailableVersion = New System.Windows.Forms.Label
Me.lblCurrentVersion = New System.Windows.Forms.Label
Me.pbUpdateImage = New System.Windows.Forms.PictureBox
Me.pnlUp.SuspendLayout()
CType(Me.pbUpdateImage, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
@@ -42,11 +42,11 @@ Namespace UI
'btnCheckForUpdate
'
Me.btnCheckForUpdate.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnCheckForUpdate.Location = New System.Drawing.Point(12, 12)
Me.btnCheckForUpdate.Location = New System.Drawing.Point(16, 104)
Me.btnCheckForUpdate.Name = "btnCheckForUpdate"
Me.btnCheckForUpdate.Size = New System.Drawing.Size(136, 23)
Me.btnCheckForUpdate.TabIndex = 10
Me.btnCheckForUpdate.Text = "Check for update"
Me.btnCheckForUpdate.Size = New System.Drawing.Size(80, 32)
Me.btnCheckForUpdate.TabIndex = 5
Me.btnCheckForUpdate.Text = "Check Again"
Me.btnCheckForUpdate.UseVisualStyleBackColor = True
'
'pnlUp
@@ -54,98 +54,45 @@ Namespace UI
Me.pnlUp.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.pnlUp.Controls.Add(Me.pbUpdateImage)
Me.pnlUp.Controls.Add(Me.Label7)
Me.pnlUp.Controls.Add(Me.lblChangeLogLabel)
Me.pnlUp.Controls.Add(Me.btnDownload)
Me.pnlUp.Controls.Add(Me.Label4)
Me.pnlUp.Controls.Add(Me.Label5)
Me.pnlUp.Controls.Add(Me.prgbDownload)
Me.pnlUp.Controls.Add(Me.lblAvailableVersion)
Me.pnlUp.Controls.Add(Me.lblCurrentVersion)
Me.pnlUp.Controls.Add(Me.txtChangeLog)
Me.pnlUp.Location = New System.Drawing.Point(12, 41)
Me.pnlUp.Location = New System.Drawing.Point(16, 152)
Me.pnlUp.Name = "pnlUp"
Me.pnlUp.Size = New System.Drawing.Size(668, 370)
Me.pnlUp.TabIndex = 30
Me.pnlUp.Size = New System.Drawing.Size(672, 248)
Me.pnlUp.TabIndex = 6
Me.pnlUp.Visible = False
'
'pbUpdateImage
'lblChangeLogLabel
'
Me.pbUpdateImage.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.pbUpdateImage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.pbUpdateImage.Cursor = System.Windows.Forms.Cursors.Hand
Me.pbUpdateImage.Location = New System.Drawing.Point(197, 3)
Me.pbUpdateImage.Name = "pbUpdateImage"
Me.pbUpdateImage.Size = New System.Drawing.Size(468, 60)
Me.pbUpdateImage.TabIndex = 31
Me.pbUpdateImage.TabStop = False
Me.pbUpdateImage.Visible = False
'
'Label7
'
Me.Label7.AutoSize = True
Me.Label7.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label7.Location = New System.Drawing.Point(3, 69)
Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(79, 13)
Me.Label7.TabIndex = 50
Me.Label7.Text = "Change Log:"
Me.lblChangeLogLabel.AutoSize = True
Me.lblChangeLogLabel.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblChangeLogLabel.Location = New System.Drawing.Point(0, 0)
Me.lblChangeLogLabel.Name = "lblChangeLogLabel"
Me.lblChangeLogLabel.Size = New System.Drawing.Size(79, 13)
Me.lblChangeLogLabel.TabIndex = 0
Me.lblChangeLogLabel.Text = "Change Log:"
'
'btnDownload
'
Me.btnDownload.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.btnDownload.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnDownload.Location = New System.Drawing.Point(6, 341)
Me.btnDownload.Location = New System.Drawing.Point(0, 216)
Me.btnDownload.Name = "btnDownload"
Me.btnDownload.Size = New System.Drawing.Size(145, 23)
Me.btnDownload.TabIndex = 70
Me.btnDownload.Size = New System.Drawing.Size(144, 32)
Me.btnDownload.TabIndex = 2
Me.btnDownload.Text = "Download and Install"
Me.btnDownload.UseVisualStyleBackColor = True
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label4.Location = New System.Drawing.Point(3, 39)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(109, 13)
Me.Label4.TabIndex = 30
Me.Label4.Text = "Available Version:"
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label5.Location = New System.Drawing.Point(3, 9)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(98, 13)
Me.Label5.TabIndex = 10
Me.Label5.Text = "Current Version:"
'
'prgbDownload
'
Me.prgbDownload.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.prgbDownload.Location = New System.Drawing.Point(157, 341)
Me.prgbDownload.Location = New System.Drawing.Point(160, 224)
Me.prgbDownload.Name = "prgbDownload"
Me.prgbDownload.Size = New System.Drawing.Size(508, 23)
Me.prgbDownload.TabIndex = 80
'
'lblAvailableVersion
'
Me.lblAvailableVersion.Location = New System.Drawing.Point(118, 39)
Me.lblAvailableVersion.Name = "lblAvailableVersion"
Me.lblAvailableVersion.Size = New System.Drawing.Size(67, 13)
Me.lblAvailableVersion.TabIndex = 40
Me.lblAvailableVersion.Text = "Version"
'
'lblCurrentVersion
'
Me.lblCurrentVersion.Location = New System.Drawing.Point(118, 9)
Me.lblCurrentVersion.Name = "lblCurrentVersion"
Me.lblCurrentVersion.Size = New System.Drawing.Size(67, 13)
Me.lblCurrentVersion.TabIndex = 20
Me.lblCurrentVersion.Text = "Version"
Me.prgbDownload.Size = New System.Drawing.Size(496, 23)
Me.prgbDownload.TabIndex = 3
'
'txtChangeLog
'
@@ -154,31 +101,85 @@ Namespace UI
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.txtChangeLog.BorderStyle = System.Windows.Forms.BorderStyle.None
Me.txtChangeLog.Cursor = System.Windows.Forms.Cursors.Arrow
Me.txtChangeLog.Location = New System.Drawing.Point(121, 69)
Me.txtChangeLog.Location = New System.Drawing.Point(16, 24)
Me.txtChangeLog.Multiline = True
Me.txtChangeLog.Name = "txtChangeLog"
Me.txtChangeLog.ReadOnly = True
Me.txtChangeLog.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
Me.txtChangeLog.Size = New System.Drawing.Size(544, 266)
Me.txtChangeLog.TabIndex = 60
Me.txtChangeLog.Size = New System.Drawing.Size(653, 181)
Me.txtChangeLog.TabIndex = 1
Me.txtChangeLog.TabStop = False
'
'lblStatus
'
Me.lblStatus.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.lblStatus.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblStatus.ForeColor = System.Drawing.SystemColors.ControlText
Me.lblStatus.Location = New System.Drawing.Point(342, 12)
Me.lblStatus.Location = New System.Drawing.Point(12, 16)
Me.lblStatus.Name = "lblStatus"
Me.lblStatus.Size = New System.Drawing.Size(338, 23)
Me.lblStatus.TabIndex = 20
Me.lblStatus.Size = New System.Drawing.Size(660, 23)
Me.lblStatus.TabIndex = 0
Me.lblStatus.Text = "Status"
Me.lblStatus.TextAlign = System.Drawing.ContentAlignment.MiddleRight
Me.lblStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'lblCurrentVersionLabel
'
Me.lblCurrentVersionLabel.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblCurrentVersionLabel.Location = New System.Drawing.Point(16, 72)
Me.lblCurrentVersionLabel.Name = "lblCurrentVersionLabel"
Me.lblCurrentVersionLabel.Size = New System.Drawing.Size(120, 16)
Me.lblCurrentVersionLabel.TabIndex = 3
Me.lblCurrentVersionLabel.Text = "Current version:"
Me.lblCurrentVersionLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'lblInstalledVersionLabel
'
Me.lblInstalledVersionLabel.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblInstalledVersionLabel.Location = New System.Drawing.Point(16, 48)
Me.lblInstalledVersionLabel.Name = "lblInstalledVersionLabel"
Me.lblInstalledVersionLabel.Size = New System.Drawing.Size(120, 16)
Me.lblInstalledVersionLabel.TabIndex = 1
Me.lblInstalledVersionLabel.Text = "Installed version:"
Me.lblInstalledVersionLabel.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'lblAvailableVersion
'
Me.lblAvailableVersion.Location = New System.Drawing.Point(136, 72)
Me.lblAvailableVersion.Name = "lblAvailableVersion"
Me.lblAvailableVersion.Size = New System.Drawing.Size(64, 16)
Me.lblAvailableVersion.TabIndex = 4
Me.lblAvailableVersion.Text = "Version"
Me.lblAvailableVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'lblCurrentVersion
'
Me.lblCurrentVersion.Location = New System.Drawing.Point(136, 48)
Me.lblCurrentVersion.Name = "lblCurrentVersion"
Me.lblCurrentVersion.Size = New System.Drawing.Size(64, 16)
Me.lblCurrentVersion.TabIndex = 2
Me.lblCurrentVersion.Text = "Version"
Me.lblCurrentVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'pbUpdateImage
'
Me.pbUpdateImage.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.pbUpdateImage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.pbUpdateImage.Cursor = System.Windows.Forms.Cursors.Hand
Me.pbUpdateImage.Location = New System.Drawing.Point(200, 48)
Me.pbUpdateImage.Name = "pbUpdateImage"
Me.pbUpdateImage.Size = New System.Drawing.Size(468, 60)
Me.pbUpdateImage.TabIndex = 45
Me.pbUpdateImage.TabStop = False
Me.pbUpdateImage.Visible = False
'
'Update
'
Me.ClientSize = New System.Drawing.Size(692, 423)
Me.ClientSize = New System.Drawing.Size(688, 418)
Me.Controls.Add(Me.pbUpdateImage)
Me.Controls.Add(Me.lblCurrentVersionLabel)
Me.Controls.Add(Me.lblInstalledVersionLabel)
Me.Controls.Add(Me.lblAvailableVersion)
Me.Controls.Add(Me.btnCheckForUpdate)
Me.Controls.Add(Me.lblCurrentVersion)
Me.Controls.Add(Me.pnlUp)
Me.Controls.Add(Me.lblStatus)
Me.Icon = Global.mRemote.My.Resources.Resources.Update_Icon
@@ -247,31 +248,41 @@ Namespace UI
Private Sub UpdateCheckComplete(ByVal UpdateAvailable As Boolean)
Try
My.Settings.CheckForUpdatesLastCheck = Date.Now
If UpdateAvailable = True Then
Me.SetStatus(Color.ForestGreen, Language.Base.UpdateAvailable)
Me.SetVisible(pnlUp, True)
My.Settings.UpdatePending = True
SetStatus(Color.OrangeRed, Language.Base.UpdateAvailable)
SetVisible(pnlUp, True)
Dim uI As App.Update.Info = uD.GetUpdateInfo()
Me.SetCurrentVersionText(My.Application.Info.Version.Major & "." & My.Application.Info.Version.Minor)
Me.SetAvailableVersionText(uI.Version.ToString)
Me.SetChangeLogText(uI.ChangeLog)
SetCurrentVersionText(My.Application.Info.Version.Major & "." & My.Application.Info.Version.Minor)
SetAvailableVersionText(uI.Version.ToString)
SetChangeLogText(uI.ChangeLog)
If uI.ImageURL <> String.Empty Then
Me.SetImageURL(uI.ImageURL)
SetImageURL(uI.ImageURL)
If uI.ImageURLLink <> String.Empty Then
pbUpdateImage.Tag = uI.ImageURLLink
End If
Me.SetVisible(pbUpdateImage, True)
SetVisible(pbUpdateImage, True)
Else
Me.SetVisible(pbUpdateImage, False)
SetVisible(pbUpdateImage, False)
End If
Me.FocusDownloadButton()
FocusDownloadButton()
Else
Me.SetStatus(Color.OrangeRed, Language.Base.NoUpdateAvailable)
Me.SetVisible(pnlUp, False)
My.Settings.UpdatePending = False
SetStatus(Color.ForestGreen, Language.Base.NoUpdateAvailable)
SetVisible(pnlUp, False)
Dim uI As App.Update.Info = uD.GetUpdateInfo()
SetCurrentVersionText(My.Application.Info.Version.Major & "." & My.Application.Info.Version.Minor)
SetAvailableVersionText(uI.Version.ToString)
End If
Catch ex As Exception
mC.AddMessage(Messages.MessageClass.ErrorMsg, "UpdateCheckComplete (UI.Window.Update) failed" & vbNewLine & ex.Message, True)
@@ -362,10 +373,10 @@ Namespace UI
Private Sub ApplyLanguage()
btnCheckForUpdate.Text = Language.Base.CheckForUpdate
Label7.Text = Language.Base.ChangeLog
lblChangeLogLabel.Text = Language.Base.ChangeLog
btnDownload.Text = Language.Base.DownloadAndInstall
Label4.Text = Language.Base.AvailableVersion & ":"
Label5.Text = Language.Base.CurrentVersion & ":"
lblCurrentVersionLabel.Text = Language.Base.AvailableVersion & ":"
lblInstalledVersionLabel.Text = Language.Base.CurrentVersion & ":"
lblAvailableVersion.Text = Language.Base.Version
lblCurrentVersion.Text = Language.Base.Version
lblStatus.Text = Language.Base.Status
@@ -434,7 +445,7 @@ Namespace UI
End Sub
#End Region
Private Sub pbUpdateImage_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pbUpdateImage.Click
Private Sub pbUpdateImage_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
If pbUpdateImage.Tag IsNot Nothing Then
Process.Start(pbUpdateImage.Tag)
End If

View File

@@ -495,6 +495,12 @@
<setting name="CheckForUpdatesFrequencyDays" serializeAs="String">
<value>7</value>
</setting>
<setting name="CheckForUpdatesLastCheck" serializeAs="String">
<value>1980-01-01</value>
</setting>
<setting name="UpdatePending" serializeAs="String">
<value>False</value>
</setting>
</mRemote.My.MySettings>
</userSettings>
</configuration>