ADD: Create doublecmd.xml backup on configuration version change

This commit is contained in:
Alexander Koblov 2023-07-08 20:01:41 +03:00
commit 60283a3305

View file

@ -2539,6 +2539,14 @@ begin
gPreviousVersion:= GetAttr(Root, 'DCVersion', EmptyStr);
LoadedConfigVersion := GetAttr(Root, 'ConfigVersion', ConfigVersion);
{ Create config backup }
if (LoadedConfigVersion < ConfigVersion) then
try
WriteToFile(gpCfgDir + 'doublecmd-' + IntToStr(LoadedConfigVersion) + '.bak');
except
// Ignore
end;
if (LoadedConfigVersion < 13) then
begin
DeleteNode(Root, 'Configuration/UseConfigInProgramDir');