diff --git a/general/kn_UpdateVersion.pas b/general/kn_UpdateVersion.pas index 84f4a97..261c4a2 100644 --- a/general/kn_UpdateVersion.pas +++ b/general/kn_UpdateVersion.pas @@ -98,20 +98,23 @@ function IsLaterVersion(const CurrentVersion, NewVersion: string): Boolean; StrsC, StrsL: TStrings; begin Result:= false; - if (CurrentVersion = NewVersion) or (NewVersion = '') then exit; + if (CurrentVersion = NewVersion) or (NewVersion = '') or (CurrentVersion = '') then exit; - StrsC:= TStringList.Create; - StrsL:= TStringList.Create; try - SplitString(StrsC, CurrentVersion, '.', false); - SplitString(StrsL, NewVersion, '.', false); - for i := 0 to StrsC.Count - 1 do begin - if StrToInt(StrsC[i]) < StrToInt(StrsL[i]) then - Exit(true); + StrsC:= TStringList.Create; + StrsL:= TStringList.Create; + try + SplitString(StrsC, CurrentVersion, '.', false); + SplitString(StrsL, NewVersion, '.', false); + for i := 0 to StrsC.Count - 1 do begin + if StrToInt(StrsC[i]) < StrToInt(StrsL[i]) then + Exit(true); + end; + finally + StrsC.Free; + StrsL.Free; end; - finally - StrsC.Free; - StrsL.Free; + except end; end; @@ -241,11 +244,11 @@ function CheckForUpdate (ShowOnlyIfNewVersionToNotify: boolean): boolean; LastInformedVersion:= KeyOptions.LastInformedVersion; try + KeyOptions.VersionLastChecked := Today(); newVersionToNotify:= GetLatestVersionInfo (KeyOptions.LastInformedVersion, CurrentVersion, Changes, not ShowOnlyIfNewVersionToNotify, WithoutInternetAccess); - if ShowOnlyIfNewVersionToNotify and not newVersionToNotify then begin - KeyOptions.VersionLastChecked := Today(); + + if ShowOnlyIfNewVersionToNotify and not newVersionToNotify then exit; - end; UV := TUpdateVersion.Create( Application ); try