Defines the base class that represents an offline Windows image. Namespace: Microsoft.ComponentStudio.ComponentPlatformInterface
Assembly: Microsoft.ComponentStudio.ComponentPlatformInterface (in microsoft.componentstudio.componentplatforminterface.dll)

Usage

Visual Basic
Dim imageInfo As OfflineImageInfo
Dim offlineImage1 As New OfflineImage(imageInfo)

Syntax

Visual Basic
MustInherit Public Class OfflineImage
C#
public abstract class OfflineImage
C++
public ref class OfflineImage abstract
J#
public abstract class OfflineImage
JScript
public abstract class OfflineImage

Example

In this example, you open an offline image on your hard drive and create a new answer file from the image. Then you display the name of the answer file and several image properties.

noteNote:
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.
// OfflineImage1.cs

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

namespace MyNameSpace
{
	public class MyClass
	{
		static void Main()
		{
			// Define the .wim file path:
			string wimPath = @"C:\myWorkingFolder\install.wim";

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

			// Check if the catalog file is created, if not create one:
			WimInfo wimInfo = n.OpenWim(wimPath);
			if (!wimInfo.Images[0].ValidateCatalog().Succeeded)
				wimInfo.Images[0].CreateCatalog();

			// Open the offline image:
			OfflineImage image = n.OpenOfflineImage(wimInfo.Images[0]);

			// Create the new answer file from the image:
			AnswerFile ansFile = Cpi.Instance.CreateAnswerFile(image);

			// Display the answer file:
			Console.WriteLine("The answer file object:\t{0}",
				ansFile);

			// Display the image properties:
			Console.WriteLine("The image name is:\t{0}",
				image.Name);
			Console.WriteLine(
				"The image WindowsFoundationPackageId:\t{0}",
				image.WindowsFoundationPackageId);
			Console.WriteLine("The componentSettings count:\t{0}",
				image.ComponentSettings.Count);
	}
}
}

/* Output:
The answer file object: Microsoft.ComponentStudio.ComponentPlatformInterface.Ans
werFile
The image name is:	Windows Vista ULTIMATE
The image WindowsFoundationPackageId:   x86_Microsoft-Windows-Foundation-Package
_6.0.5322.0__31bf3856ad364e35_
The componentSettings count:	32
*/

Remarks

An offline image is a Windows image that is not currently running. Typically, you can access an offline image to expose any components, settings, and packages available.


Inheritance Hierarchy

System.Object
  Microsoft.ComponentStudio.ComponentPlatformInterface.OfflineImage

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

[an error occurred while processing this directive]