Represents the root object for
Cpi.
Namespace:
Microsoft.ComponentStudio.ComponentPlatformInterface
Assembly:
Microsoft.ComponentStudio.ComponentPlatformInterface (in
microsoft.componentstudio.componentplatforminterface.dll)
Usage
Visual Basic |
Dim cpi1 As Cpi
|
Syntax
Visual Basic |
NotInheritable Public Class Cpi
|
C# |
public sealed class Cpi
|
C++ |
public ref class Cpi sealed
|
J# |
public final class Cpi
|
Example
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.
Note: |
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);
wInfo.Images[0].CreateCatalog();
// Open the offline image:
OfflineImage img = n.OpenOfflineImage(wInfo.Images[0]);
Console.WriteLine("The image file is:\n{0}",
img.Name.ToString());
// Get the answer file:
AnswerFile an = n.OpenAnswerFile(ansFile);
Console.WriteLine("The answer file is:\n{0}",
an.Path.ToString());
// Display the object type:
System.Console.WriteLine("The object type is: {0}",
n.GetType());
}
}
}
/* 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
System.Object
Microsoft.ComponentStudio.ComponentPlatformInterface.Cpi
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.
Platforms
Development Platforms
Windows XP Home Edition, Windows XP Professional, Windows Server
2003, Windows Vista, and Windows 2000
Target Platforms
See Also