Ignore:
Timestamp:
Nov 3, 2021, 11:22:02 AM (3 years ago)
Author:
chronos
Message:
  • Modified: Merged changes from trunk r404.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/Packages/CevoComponents/Directories.pas

    r246 r405  
    6767  Src, Dst: TSearchRec;
    6868begin
    69   if not DirectoryExists(DestinationDir) then CreateDir(DestinationDir);
     69  if not DirectoryExists(DestinationDir) then ForceDirectories(DestinationDir);
    7070  if FindFirst(SourceDir + DirectorySeparator + Filter, $21, Src) = 0 then
    7171    repeat
     
    7979end;
    8080
     81procedure CopyFiles;
     82begin
     83  if DirectoryExists(GetSavedDir(True)) and not DirectoryExists(GetSavedDir(False)) then
     84    CopyDir(GetSavedDir(True), GetSavedDir(False), '*.*');
     85  if DirectoryExists(GetMapsDir(True)) and not DirectoryExists(GetMapsDir(False)) then
     86    CopyDir(GetMapsDir(True), GetMapsDir(False), '*.*');
     87end;
     88
    8189procedure UnitInit;
    8290var
     
    8795
    8896  AppDataDir := GetAppConfigDir(False);
    89   if AppDataDir = '' then
    90     DataDir := HomeDir
    91   else
    92   begin
    93     if not DirectoryExists(AppDataDir) then CreateDir(AppDataDir);
     97  if AppDataDir = '' then DataDir := HomeDir
     98  else begin
     99    if not DirectoryExists(AppDataDir) then ForceDirectories(AppDataDir);
    94100    DataDir := AppDataDir;
    95101  end;
    96 
    97   CopyDir(GetSavedDir(True), GetSavedDir(False), '*.*');
    98   CopyDir(GetMapsDir(True), GetMapsDir(False), '*.*');
     102  CopyFiles;
    99103end;
    100104
Note: See TracChangeset for help on using the changeset viewer.