From: s_kawamoto Date: Thu, 19 Jun 2014 15:32:49 +0000 (+0900) Subject: Add workarounds for Windows 2000/XP. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=1b037e2a162a82cbaa0f5ac8c37aa986be102ad8;p=ffftp%2Fffftp.git Add workarounds for Windows 2000/XP. --- diff --git a/FFFTP_Eng_Release/FFFTP.exe b/FFFTP_Eng_Release/FFFTP.exe index 658c9b2..0ad2903 100644 Binary files a/FFFTP_Eng_Release/FFFTP.exe and b/FFFTP_Eng_Release/FFFTP.exe differ diff --git a/Release/FFFTP.exe b/Release/FFFTP.exe index cb5cf91..7d30b84 100644 Binary files a/Release/FFFTP.exe and b/Release/FFFTP.exe differ diff --git a/updater.c b/updater.c index 305d363..943d436 100644 --- a/updater.c +++ b/updater.c @@ -465,20 +465,23 @@ BOOL ApplyUpdates(LPCTSTR DestinationDir, LPCTSTR BackupDirName) _tcscat(Backup, _T("\\")); _tcscat(Backup, BackupDirName); DeleteDirectoryAndContents(Backup); - if(CopyAllFilesInDirectory(DestinationDir, Backup)) + if(CreateDirectory(Backup, NULL)) { - _tcscpy(DestinationBackup, DestinationDir); - _tcscat(DestinationBackup, _T("\\")); - _tcscat(DestinationBackup, BackupDirName); - if(CopyAllFilesInDirectory(Source, DestinationDir)) + if(CopyAllFilesInDirectory(DestinationDir, Backup)) { - DeleteDirectoryAndContents(DestinationBackup); - bResult = TRUE; - } - else - { - DeleteDirectoryAndContents(DestinationBackup); - CopyAllFilesInDirectory(Backup, DestinationDir); + _tcscpy(DestinationBackup, DestinationDir); + _tcscat(DestinationBackup, _T("\\")); + _tcscat(DestinationBackup, BackupDirName); + if(CopyAllFilesInDirectory(Source, DestinationDir)) + { + DeleteDirectoryAndContents(DestinationBackup); + bResult = TRUE; + } + else + { + DeleteDirectoryAndContents(DestinationBackup); + CopyAllFilesInDirectory(Backup, DestinationDir); + } } } }