views:

2867

answers:

8

In an effort to satisfy "The Joel Test" question #2 "Can you make a build in one step?", I'm trying to complete a release candidate build script with the creation of a CD iso from the collection of files gathered and generated by the installer creator.

There seem to be many good tools (many free) out there that will create ISOs, but I need to find one that can be run at the windows command line so I can integrate it into the NAnt build script that's fired off by Cruise Control.

Build environment is:

  • Windows Server 2003
  • .NET 1.1 - 3.5 (application we're creating is built on 2.0)
  • NullSoft installer (NSIS)
  • CruiseControl.net
  • NAnt

I've been googling around, but no luck yet.

Anyone have a recommendation?

+7  A: 

Try mkisofs. It's part of the cdrecord project.

Andrew
+2  A: 

I've used magiciso, but haven't tested it extensivly. (I may try some of the others mentioned here after some testing) I first make an installer (single file) then just make this an iso.

http://www.magiciso.com/

Here's the result of my struggle to get this working in python:

add_option = '-a'
add_option_value = installer_fullpath
response_option = '-py' # answer yes to all options 


# Get the tempfile name -- to resolve long name issue
# --> My file names were initially too long for MagicIso and it would choke
f_handle = tempfile.TemporaryFile(suffix='.iso', prefix='mi_', dir='.')
temp_filename = f_handle.name
f_handle.close() # File automatically deleted on close                                

args = (magiciso_exe_fullpath,temp_filename,response_option,add_option,add_option_value)

# log output to file
magiciso_con_f = open(MAGICISO_CON_LOG,'w')

magiciso_process = subprocess.Popen(args,stdout=magiciso_con_f,stderr=magiciso_con_f)
magiciso_process.wait()
monkut
mksiofs is turning out to be a bit of a pain in the ass to build. I think we may go with magiciso
Brian
+1  A: 

Get mkisofs Download it here it is part of Cdrtools. Available for most platforms. Useage examples:

mkisofs -v -dvd-video -V "VOLUME_NAME" -o "c:\my movies\iso\movie.iso" "c:\my movies\dvd"
mkisofs -r -R -J -l -L -o image-file.iso c:\project\install
Gerhard
+1  A: 

If you want to be Microsoft addictive (not install additional software). You can use IMAPI, build into Windows to burn images. Additional information regarding scripting IMAPI can be found in MSDN

Tamir
+6  A: 

Blatant plug, but I've just released an alpha version of an OpenSource C# library that can create ISO files. Doesn't directly integrate with Nant, but you could wrap up the library to achieve that. Theres a sample app (ISOCreate) that creates ISOs from a directory structure, but this sample could also get you started:

CDBuilder builder = new CDBuilder();
builder.UseJoliet = true;
builder.VolumeIdentifier = "A_SAMPLE_DISK";
builder.AddFile(@"Folder\Hello.txt", Encoding.ASCII.GetBytes("Hello World!"));
builder.Build(@"C:\temp\sample.iso");

.NET DiscUtils (on CodePlex)

festive_ken
A: 

I am using mkisofs.exe from the installation kit of nLite or BartPE, from where I also learned the required parameters for building a bootable cd.

alexandrul
+1  A: 

Creating a simple CD ISO

I've found a significantly easier approach, and it doesn't require Cygwin: CDBurnerXP

It's not really advertised on the site, but it includes a command-line edition, as cdbxpcmd.exe. There is also some documentation about the command-line options.

Of particular interest is the -iso option; used something like:

cdbxpcmd --burn-data -folder:input -iso:output.iso -changefiledates

to generate an ISO called output.iso from the files in the input folder


Creating a Bootable ISO

The command line tool doesn't appear to let you make a bootable CD directly. However, if you know your list of files isn't going to change (ie only the content of those files), you could try the following (untested):

  • Load up the CDBurnerXP GUI version
  • Add the files interactively
  • Select Disc->Burn Options...
  • Set up your boot image
  • Select File->Save to create a DXP file (which is CDBurnerXP's compilation format)

Then, you can use the following command

cdbxpcmd --burn-data -layout:mycompilation.dxp -iso:output.iso
kibibu
I tried the other tools and found this to be the best option.
stimms
If anybody tries the bootable bit, please comment with your success or otherwise
kibibu
A: 

Kibibu,

Do you know an argument to pass to make the ISO bootable? I have the boot image file.

WPFEnthusiast
Sorry, I didn't get notified of this. I'll update my answer
kibibu