Browse Source

ADD: Create doublecmd.xml backup on configuration version change

Alexander Koblov 2 years ago
parent
commit
60283a3305
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/uglobs.pas

+ 8 - 0
src/uglobs.pas

@@ -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');