diff --git a/src/apps/installer/CopyEngine.cpp b/src/apps/installer/CopyEngine.cpp index 72557a4f85..8eded33c5b 100644 --- a/src/apps/installer/CopyEngine.cpp +++ b/src/apps/installer/CopyEngine.cpp @@ -158,11 +158,18 @@ CopyEngine::Start(BMenu *srcMenu, BMenu *targetMenu) // copy source volume BDirectory targetDir(targetDirectory.Path()); - srcDirectory.Append("beos"); - BEntry srcEntry(srcDirectory.Path()); - Undo undo; - printf("Copying folder '%s' to '%s'.\n", srcDirectory.Path(), targetDirectory.Path()); - FSCopyFolder(&srcEntry, &targetDir, fControl, NULL, false, undo); + BDirectory srcDir(srcDirectory.Path()); + BEntry entry; + status_t status; + while (srcDir.GetNextEntry(&entry) == B_OK) { + Undo undo; + status = FSCopyFolder(&entry, &targetDir, fControl, NULL, false, undo); + if (status != B_OK) { + BPath path; + entry.GetPath(&path); + fprintf(stderr, "error while copying %s : %s\n", path.Path(), strerror(status)); + } + } // copy selected packages diff --git a/src/apps/installer/InstallerWindow.cpp b/src/apps/installer/InstallerWindow.cpp index 7fc93481ee..0bb8201353 100644 --- a/src/apps/installer/InstallerWindow.cpp +++ b/src/apps/installer/InstallerWindow.cpp @@ -64,9 +64,10 @@ LogoView::Draw(BRect update) InstallerWindow::InstallerWindow(BRect frame_rect) : BWindow(frame_rect, "Installer", B_TITLED_WINDOW, B_NOT_ZOOMABLE | B_NOT_RESIZABLE), - fDriveSetupLaunched(false), - fCopyEngine(this) + fDriveSetupLaunched(false) { + fCopyEngine = new CopyEngine(this); + BRect bounds = Bounds(); bounds.bottom += 1; bounds.right += 1; @@ -164,7 +165,7 @@ InstallerWindow::MessageReceived(BMessage *msg) StartScan(); break; case BEGIN_MESSAGE: - BMessenger(&fCopyEngine).SendMessage(ENGINE_START); + BMessenger(fCopyEngine).SendMessage(ENGINE_START); break; case SHOW_BOTTOM_MESSAGE: ShowBottom(); @@ -217,7 +218,7 @@ InstallerWindow::QuitRequested() return false; } be_app->PostMessage(B_QUIT_REQUESTED); - fCopyEngine.PostMessage(B_QUIT_REQUESTED); + fCopyEngine->PostMessage(B_QUIT_REQUESTED); return true; } @@ -280,7 +281,7 @@ InstallerWindow::StartScan() while ((item = fDestMenu->RemoveItem((int32)0))) delete item; - fCopyEngine.ScanDisksPartitions(fSrcMenu, fDestMenu); + fCopyEngine->ScanDisksPartitions(fSrcMenu, fDestMenu); if (fSrcMenu->ItemAt(0)) { PublishPackages(); diff --git a/src/apps/installer/InstallerWindow.h b/src/apps/installer/InstallerWindow.h index bd65add960..2a07106e56 100644 --- a/src/apps/installer/InstallerWindow.h +++ b/src/apps/installer/InstallerWindow.h @@ -52,7 +52,7 @@ private: BBitmap *fLogo; BPoint fDrawPoint; - CopyEngine fCopyEngine; + CopyEngine *fCopyEngine; }; #endif /* _InstallerWindow_h */