Friday, February 15, 2008

Managed ISO (CD/DVD Image) Creation via IMAPIv2

CodeProject - How to Create File Optical Images using IMAPIv2.0

build

Introduction

There are several free utilities that allow you to create file images, but the code is usually not available or available only in C++ like this or in other scripting languages.
Hence I tried to create this utility using managed code, so you can reuse it easily if other languages is not an option.

Background

Initially available only on Windows Vista, in 2007 Microsoft introduced IMAPIv2.0 for Windows XP and Windows 2003 server.

Unlike the first version, the new one works with new types of media, and more importantly, for my purpose has some support for creating optical file images. Unfortunately there is no managed API to use, so we still have to use COM Interop to use this functionality, nor is there any way I know of reading an optical file image using IMAPIv2.0.

One way to use COM objects is just to add references to them in your managed code project. In order to run or even to build this solution, you would have to have those COM objects registered, in our case IMAPIv2.0 installed. A better approach is by using the attribute based types, we can hook them up with the right COM binaries at runtime, so we can at least build the solution with no hassle. Fortunately Microsoft provided such a shim file and I was glad to use it.

..."

Interesting... I can see a number of places where programmatically creating ISO/Disc images could come in handy.

No comments: