You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This topic branch teaches the installer to detect and discourage
downgrades: In the case that a newer Git for Windows version is already
installed, the user will be asked whether a downgrade is intended,
defaulting to "No".
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
if CurrentVersion[i]<>PreviousVersion[j] thenbegin
566
+
Result:=PreviousVersion[j]='.';
567
+
Exit;
568
+
end;
569
+
if CurrentVersion[i]<>'.'then
570
+
Exit;
571
+
i:=i+1;
572
+
j:=j+1;
573
+
end;
574
+
end;
575
+
518
576
functionInitializeSetup:Boolean;
577
+
var
578
+
CurrentVersion,PreviousVersion:String;
519
579
begin
520
580
UpdateInfFilenames;
521
581
#if BITNESS=='32'
@@ -528,6 +588,13 @@ begin
528
588
Result:=True;
529
589
end;
530
590
#endif
591
+
#if APP_VERSION!='0-test'
592
+
if Result andnot ParamIsSet('ALLOWDOWNGRADE') and RegQueryStringValue(HKEY_LOCAL_MACHINE,'Software\GitForWindows','CurrentVersion',PreviousVersion) thenbegin
593
+
CurrentVersion:=ExpandConstant('{#APP_VERSION}');
594
+
if (IsDowngrade(CurrentVersion,PreviousVersion)) and (SuppressibleMsgBox('Git for Windows '+PreviousVersion+' is currently installed.'+#13+'Do you really want to downgrade to Git for Windows '+CurrentVersion+'?',mbConfirmation,MB_YESNO or MB_DEFBUTTON2,IDNO)=IDNO) then
0 commit comments