troubleshooting Question

Magic CD/DVD: Burning contents of 3 folders and more

Avatar of routerboy309
routerboy309 asked on
Delphi
9 Comments1 Solution367 ViewsLast Modified:
Hello --

I'm using Binary Magic Magic CD/DVD Burner control for Delphi 6. I have 3 CheckListBoxes (each holds a certain file extension: Thanks to Cynna for clearing that mess up) on a form so that then when I click the burn button the CheckListBox contents of each three gets moved to three pre-created folders (folder names are video, reports, images). Once they get moved, the burn procedure starts. There will be an executable (and an autorun file) that is at the root of the folders that gets copied and burned as well.

So during the installation (and providing the defaults were used during the installation) of the buring EXE, the target machine gets this setup:

C:\Program Files\MyApp

and inside the 'MyApp' folder is:

BurnApp.exe --- the application that is used to burn CDs.
a folder called: APP

Inside 'APP' folder is:

mainapp.exe
autorun.ini
A VIDEO folder
A REPORTS folder
A IMAGES folder

Procedure is that a user would launch the BurnApp.exe and they'd add the contents of each folders into the CheckListBoxes by draging and dropping.

When the burn sequence is complete, on the CD-ROM is mainapp.exe file (stored at the root), the three folders and the contents of each CheckListBox has been placed in each folder.

Example:

At the root is a executable

mainapp.exe

then three folders are just below that part:

VIDEO folder:
test.avi
REPORT folder:
myreport.doc
IMAGES folder:
file1.jpg
file2.jpg

And then Ideally, the contents of the folders would get 'emptied'.

The demo application created by Magic CD/DVD uses this, but then it only focuses on one CheckListBox and doesn't look at the 3 folders:

procedure TMainForm.AddFilesToCD;
var
  i: Integer;
  Entries: Integer;
  fPath, fName: String;
begin
  if SessionToImport <> 0 then
  begin
    mcdb.SessionToImport := 0;
    mcdb.ImportSession(sessionToImport, nil);
  end;
  Entries := clBox.Items.Count;
  if Entries < 1 then
  begin
    ShowMessage('Atleast one file/directory should be selected');
    exit;
  end;
  for i:=0 to Entries-1 do
  begin
    fPath := ExtractFilePath(clBox.Items[i]);
    fName := ExtractFileName(clBox.Items[i]);
    if DirectoryExists(clBox.Items[i]) then
      mcdb.InsertDir(mcdb.RootDir, fPath, '*.*', faAnyFile, clBox.Checked[i], cPathInfo.Checked, oArchiveFiles)
    else
      mcdb.InsertFile('\', fPath+fName, cPathInfo.Checked);
  end;
  mcdb.RemoveEmptyDirs;
end;

I'd like to modify this part as the procedure is already called by the main burn procedure. Any help would be great. Sorry but my Delphi skills are not the best.

RB
ASKER CERTIFIED SOLUTION
Cynna

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros