diff --git a/src/apps/installer/CopyEngine.cpp b/src/apps/installer/CopyEngine.cpp index 8021855926..e94b914374 100644 --- a/src/apps/installer/CopyEngine.cpp +++ b/src/apps/installer/CopyEngine.cpp @@ -241,13 +241,18 @@ CopyEngine::CopyFolder(BDirectory &srcDir, BDirectory &targetDir) BEntry entry; status_t err; while (srcDir.GetNextEntry(&entry) == B_OK) { - char name[B_FILE_NAME_LENGTH]; - entry.GetName(name); - if (strcmp(name, PACKAGES_DIRECTORY) == 0) - continue; - + StatStruct statbuf; + entry.GetStat(&statbuf); + Undo undo; - err = FSCopyFolder(&entry, &targetDir, fControl, NULL, false, undo); + if (S_ISDIR(statbuf.st_mode)) { + char name[B_FILE_NAME_LENGTH]; + if (strcmp(name, PACKAGES_DIRECTORY) == 0) + continue; + err = FSCopyFolder(&entry, &targetDir, fControl, NULL, false, undo); + } else { + err = FSCopyFile(&entry, &statbuf, &targetDir, fControl, NULL, false, undo); + } if (err != B_OK) { BPath path; entry.GetPath(&path); diff --git a/src/apps/installer/FSUtils.cpp b/src/apps/installer/FSUtils.cpp index 5db3870942..5686509ccd 100644 --- a/src/apps/installer/FSUtils.cpp +++ b/src/apps/installer/FSUtils.cpp @@ -1512,20 +1512,18 @@ FSCopyAttributesAndStats(BNode *srcNode, BNode *destNode) } -#if 0 status_t FSCopyFile(BEntry* srcFile, StatStruct *srcStat, BDirectory* destDir, - CopyLoopControl *loopControl, BPoint *loc, bool makeOriginalName) + CopyLoopControl *loopControl, BPoint *loc, bool makeOriginalName, Undo &undo) { try { - CopyFile(srcFile, srcStat, destDir, loopControl, loc, makeOriginalName); + CopyFile(srcFile, srcStat, destDir, loopControl, loc, makeOriginalName, undo); } catch (status_t error) { return error; } return B_OK; } -#endif static status_t diff --git a/src/apps/installer/FSUtils.h b/src/apps/installer/FSUtils.h index 5e87dcab23..d93d4f6464 100644 --- a/src/apps/installer/FSUtils.h +++ b/src/apps/installer/FSUtils.h @@ -150,6 +150,8 @@ TrackerCopyLoopControl::TrackerCopyLoopControl(thread_id thread) #endif _IMPEXP_TRACKER status_t FSCopyAttributesAndStats(BNode *, BNode *); +_IMPEXP_TRACKER status_t FSCopyFile(BEntry* srcFile, StatStruct *srcStat, BDirectory* destDir, + CopyLoopControl *loopControl, BPoint *loc, bool makeOriginalName, Undo &undo); _IMPEXP_TRACKER status_t FSCopyFolder(BEntry *srcEntry, BDirectory *destDir, CopyLoopControl *loopControl, BPoint *loc, bool makeOriginalName, Undo &undo); _IMPEXP_TRACKER void FSDuplicate(BObjectList *srcList, BList *pointList);