From 9f29c9cc03633f1a94c56f816132681ec4f8b711 Mon Sep 17 00:00:00 2001 From: ZeqMacaw Date: Tue, 19 Nov 2019 22:30:18 -0500 Subject: [PATCH] Fixed issues with Update. --- Crowbar/Core/Updater/Updater.vb | 23 ++++++++++++------ Crowbar/Resources/CrowbarLauncher.exe | Bin 166400 -> 165888 bytes .../Widgets/Main Tabs/UpdateUserControl.vb | 9 ++++--- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/Crowbar/Core/Updater/Updater.vb b/Crowbar/Core/Updater/Updater.vb index 018659d..112274d 100644 --- a/Crowbar/Core/Updater/Updater.vb +++ b/Crowbar/Core/Updater/Updater.vb @@ -21,6 +21,7 @@ Public Class Updater Public StatusMessage As String Public UpdateIsAvailable As Boolean Public DownloadIsEnabled As Boolean + Public UpdateIsEnabled As Boolean End Class Public Sub CheckForUpdate(ByVal given_ProgressChanged As ProgressChangedEventHandler, ByVal given_RunWorkerCompleted As RunWorkerCompletedEventHandler) @@ -40,7 +41,6 @@ Public Class Updater Private Sub CheckForUpdate_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Dim bw As BackgroundWorkerEx = CType(sender, BackgroundWorkerEx) - Dim appVersion As Version = Nothing Dim fileSize As ULong = 0 'FROM: https://www.codeproject.com/Questions/1255767/Could-not-create-SSL-TLS-secure-channel @@ -77,7 +77,7 @@ Public Class Updater Dim appNameVersion As String = CType(root("name"), String) 'NOTE: Must append ".0.0" to version so that Version comparisons are correct. Dim appVersionText As String = appNameVersion.Replace("Crowbar ", "") + ".0.0" - appVersion = New Version(appVersionText) + Me.theAppVersion = New Version(appVersionText) 'Dim appVersionIsNewer As Boolean = appVersion > My.Application.Info.Version 'Dim appVersionIsOlder As Boolean = appVersion < My.Application.Info.Version @@ -103,22 +103,23 @@ Public Class Updater Dim outputInfo As New Updater.StatusOutputInfo() outputInfo.UpdateIsAvailable = False Dim updateCheckStatusMessage As String - If appVersion Is Nothing Then + If Me.theAppVersion Is Nothing Then updateCheckStatusMessage = "Unable to get update info. Please try again later. " - ElseIf appVersion = My.Application.Info.Version Then + ElseIf Me.theAppVersion = My.Application.Info.Version Then updateCheckStatusMessage = "Crowbar is up to date. " - ElseIf appVersion > My.Application.Info.Version Then - updateCheckStatusMessage = "Update to version " + appVersion.ToString(2) + " available. Size: " + MathModule.ByteUnitsConversion(fileSize) + " " + ElseIf Me.theAppVersion > My.Application.Info.Version Then + updateCheckStatusMessage = "Update to version " + Me.theAppVersion.ToString(2) + " available. Size: " + MathModule.ByteUnitsConversion(fileSize) + " " outputInfo.UpdateIsAvailable = True Else 'NOTE: Should not get here if versioning is done correctly. - updateCheckStatusMessage = "" + updateCheckStatusMessage = "Crowbar is up to date. " End If Dim now As DateTime = DateTime.Now() Dim lastCheckedMessage As String = "Last checked: " + now.ToLongDateString() + " " + now.ToShortTimeString() outputInfo.StatusMessage = updateCheckStatusMessage + lastCheckedMessage outputInfo.DownloadIsEnabled = Me.theDownloadTaskIsEnabled + outputInfo.UpdateIsEnabled = Me.theUpdateTaskIsEnabled e.Result = outputInfo End Try End Sub @@ -145,6 +146,10 @@ Public Class Updater End Sub Private Sub DownloadAfterCheckForUpdate() + If Me.theUpdateTaskIsEnabled AndAlso Me.theAppVersion <= My.Application.Info.Version Then + Exit Sub + End If + Me.theLocalPathFileName = Path.Combine(Me.theLocalPath, Me.theLocalFileName) Me.theLocalPathFileName = FileManager.GetTestedPathFileName(Me.theLocalPathFileName) @@ -267,7 +272,7 @@ Public Class Updater #If DEBUG Then crowbarOrLauncherExeProcess.StartInfo.CreateNoWindow = False #Else - lzmaExeProcess.StartInfo.CreateNoWindow = True + crowbarOrLauncherExeProcess.StartInfo.CreateNoWindow = True #End If crowbarOrLauncherExeProcess.Start() Application.Exit() @@ -329,6 +334,8 @@ Public Class Updater Private theUpdateRunWorkerCompletedHandler As RunWorkerCompletedEventHandler Private theUpdateTaskIsEnabled As Boolean + Private theAppVersion As Version = Nothing + #End Region End Class diff --git a/Crowbar/Resources/CrowbarLauncher.exe b/Crowbar/Resources/CrowbarLauncher.exe index 6fb487dad29b0355c9b3e17866b2558dbaaaac2f..89ddaf1537c969e7be298f32414fa49987bb6556 100644 GIT binary patch delta 5442 zcmZ`-4Rlo1wch94xp(fpGnr&2$s~{flY}HUKScfnX{k*btzu1;AAhh=6A>*?nUFyQ z0+~Tt8?8m@XsJbQkgg)Fv__sq9<>cGd8mEX6;@fTREuF@pVjqLqRZu@TI{#?oltbG z&Pu+s_qTt~x#yg@N#+4JbH96kZ{_KqA0MLJXM`##q^>6F(L}aSHa)!kXV*qv*{SI& zCi-BpwpSE}2Q-DDPln;5?9rKx*~O~Xow*6-1n8dZJ*q)vvcFQb>aOewRau+=FiiMd zj$chCy>lKxz_8NEJvWSTa~b z8aESQsgflVQhieoyCzg!D_PAn*s*TqK@|>aH{Xo zUK3cY&sv4hQx~9;>rKs$8u9crb|)&EYS4#RC^QoFrh`k(0Jz>vVAqA{&I7n1t28+a zW7ta0#!xzKomC=4R~ua7-bElAZ_07r9B6rt_c;v7&jU{6S9^0Y76!a8u!Km~<3%o;s;Pp*@i7_; zb+>~D(irl`B=(+r!q$d255lWha8d=lP18iBrT$4M#3ML>lGsVnVLU#6FQl$OfU8qq z!H_ILp`195MejfrcmL@zzB9?PgV>HK=kb$$C^^;pl$r&$?|L2*lezN_>D*h)jCTX0)JcBrJc1X=C#{TGO>0`AZ~!b=| zwa_)>MFUg}kro(dz`XW_7zKPK zd)O&S*MHy8-FcXJ(|DsX)U^}cr|y7xqt=_4_HZjV{M)Q}RG-O8g;Nz3p-tT2xo0%R z_SdgL^Xw`=)p0!<>FQaJg7>1svMH{IxP}Z9!k(KKQTDVu`Qj(=jH-HY`q3NVw`$?q zt`)0q#f-s?Cwd)Es_L4B^l=#xZVIZp?3#JF&?t-r9Wt{ELNybxISD(8aK}>vemN8B z5jHjjvJZx)r4O3Of{#W28JO)_RBJM>HP$=%^dhEg(bLBDL5m&x=}ypL}-@tUHG>J)~BJoXcV{+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