@@ -906,11 +906,12 @@ begin
906
906
Result:=Result+1 ;
907
907
end ;
908
908
909
- function IsDowngrade (CurrentVersion,PreviousVersion :String):Boolean;
909
+ function IsDowngrade (CurrentVersion:String):Boolean;
910
910
var
911
- Path:String;
911
+ Path,PreviousVersion :String;
912
912
i,j,CurrentLength,PreviousLength:Integer;
913
913
begin
914
+ PreviousVersion:=PreviousGitForWindowsVersion;
914
915
Result:=(VersionCompare(CurrentVersion,PreviousVersion)<0 );
915
916
#ifdef GIT_VERSION
916
917
if Result or (CountDots(CurrentVersion)>3 ) or (CountDots(PreviousVersion)>3 ) then begin
@@ -926,13 +927,16 @@ begin
926
927
#endif
927
928
end ;
928
929
929
- function IsUpgrade (CurrentVersion,PreviousVersion:String):Boolean;
930
+ function IsUpgrade (CurrentVersion:String):Boolean;
931
+ var
932
+ PreviousVersion:String;
930
933
begin
934
+ PreviousVersion:=PreviousGitForWindowsVersion;
931
935
// It is not an upgrade:
932
936
// - if there was no previous version
933
937
// - or if the previous version is identical to the current one (re-install)
934
938
// - or if it is actually a downgrade
935
- Result:=(PreviousVersion<>' ' ) and (CurrentVersion<>PreviousVersion) and not IsDowngrade(CurrentVersion,PreviousVersion )
939
+ Result:=(PreviousVersion<>' ' ) and (CurrentVersion<>PreviousVersion) and not IsDowngrade(CurrentVersion)
936
940
end ;
937
941
938
942
{ Represent a set as a string of comma-separated values }
@@ -1004,7 +1008,7 @@ begin
1004
1008
#if APP_VERSION!=' 0-test'
1005
1009
if Result and not ParamIsSet(' ALLOWDOWNGRADE' ) then begin
1006
1010
CurrentVersion:=ExpandConstant(' {#APP_VERSION}' );
1007
- if IsDowngrade(CurrentVersion,PreviousGitForWindowsVersion ) then begin
1011
+ if IsDowngrade(CurrentVersion) then begin
1008
1012
if WizardSilent() and (ParamIsSet(' SKIPDOWNGRADE' ) or ParamIsSet(' VSNOTICE' )) then begin
1009
1013
Msg:=' Skipping downgrade from ' +PreviousGitForWindowsVersion+' to ' +CurrentVersion;
1010
1014
if ParamIsSet(' SKIPDOWNGRADE' ) or (ExpandConstant(' {log}' )=' ' ) then
@@ -1658,7 +1662,7 @@ begin
1658
1662
Caption:=' &Only show new options' ;
1659
1663
Width:=GetTextWidth(Caption,Font)+20 ; // 20 is the estimated width of the checkbox itself
1660
1664
Left:=WizardForm.BackButton.Left-Width-(WizardForm.CancelButton.Left-WizardForm.NextButton.Left-WizardForm.NextButton.Width);
1661
- Checked:=IsUpgrade(ExpandConstant(' {#APP_VERSION}' ),PreviousGitForWindowsVersion );
1665
+ Checked:=IsUpgrade(ExpandConstant(' {#APP_VERSION}' ));
1662
1666
OnClick:=@AdjustNextButtonLabel;
1663
1667
Height:=WizardForm.CancelButton.Height;
1664
1668
Top:=WizardForm.CancelButton.Top;
@@ -2131,7 +2135,7 @@ begin
2131
2135
RdbGitCredentialManager[GCM_Core].Checked:=True;
2132
2136
end ;
2133
2137
// Auto-upgrade GCM to GCM Core in version v2.29.0
2134
- if RdbGitCredentialManager[GCM_Classic].Checked and ((PreviousGitForWindowsVersion=' ' ) or IsUpgrade(' 2.29.0' ,PreviousGitForWindowsVersion )) then begin
2138
+ if RdbGitCredentialManager[GCM_Classic].Checked and ((PreviousGitForWindowsVersion=' ' ) or IsUpgrade(' 2.29.0' )) then begin
2135
2139
RdbGitCredentialManager[GCM_Core].Checked:=True;
2136
2140
AddToSet(CustomPagesWithUnseenOptions,GitCredentialManagerPage);
2137
2141
end ;
0 commit comments