Represents the root object for Cpi. Namespace: Microsoft.ComponentStudio.ComponentPlatformInterface
Assembly: Microsoft.ComponentStudio.ComponentPlatformInterface (in microsoft.componentstudio.componentplatforminterface.dll)


Visual Basic
Dim cpi1 As Cpi


Visual Basic
NotInheritable Public Class Cpi
public sealed class Cpi
public ref class Cpi sealed
public final class Cpi
public class Cpi


In this example, you define the path strings of the Windows image folder and the Windows unattended setup answer file (.wim file), and then open the offline image and the answer file. Finally, you display the names of the offline image, the answer file and the object type of the Cpi instance.

To run this example, you must change the value of the variable wimPath to the folder name that contains the .wim file on your computer. You must also change the name of the answer file as appropriate.
// CpiExample.cs

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.ComponentStudio.ComponentPlatformInterface;

namespace CpiExample
	class Program
		static void Main(string[] args)
			string wimPath = @"C:\myWorkingFolder";
			string wimFile = wimPath + @"\install.wim";
			string ansFile = wimPath + @"\My Unattend1.xml";

			// Create a Cpi instance:
			Cpi n = Cpi.Instance;

			// Create the catalog:
			WimInfo wInfo = n.OpenWim(wimFile);

			// Open the offline image:
			OfflineImage img = n.OpenOfflineImage(wInfo.Images[0]);
			Console.WriteLine("The image file is:\n{0}",

			// Get the answer file:
			AnswerFile an = n.OpenAnswerFile(ansFile);
			Console.WriteLine("The answer file is:\n{0}",

			// Display the object type:
			System.Console.WriteLine("The object type is: {0}",
/* Output:
The image file is:
Windows Vista BUSINESS
The answer file is:
C:\myWorkingFolder\My Unattend1.xml
The object type is: Microsoft.ComponentStudio.ComponentPlatformInterface.Cpi

Inheritance Hierarchy


Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Vista, and Windows 2000

Target Platforms

See Also

[an error occurred while processing this directive]