Files
docker-wine-dotnet/VisualStudioMock/ISetupInstance2.cs
2025-02-04 00:55:10 +01:00

83 lines
3.1 KiB
C#

using System;
using System.Runtime.InteropServices;
namespace VisualStudioMock
{
/// <summary>
/// Information about an instance of a product.
/// </summary>
/// <remarks>
/// You can enumerate all properties of basic types by casting to an <see cref="ISetupPropertyStore" />.
/// </remarks>
[ComImport]
[Guid("89143C9A-05AF-49B0-B717-72E218A2185C")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ISetupInstance2 : ISetupInstance
{
/// <summary>
/// Gets the state of the instance.
/// </summary>
/// <returns>The state of the instance.</returns>
[return: MarshalAs(UnmanagedType.U4)]
InstanceState GetState();
/// <summary>
/// Gets an array of package references registered to the instance.
/// </summary>
/// <returns>An array of package references registered to the instance.</returns>
[return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_UNKNOWN)]
ISetupPackageReference[] GetPackages();
/// <summary>
/// Gets a package reference to the product registered to the instance
/// </summary>
/// <returns>A package reference to the product registered to the instance. This may be null if <see cref="M:Microsoft.VisualStudio.Setup.Configuration.ISetupInstance2.GetState" /> does not return <see cref="F:Microsoft.VisualStudio.Setup.Configuration.InstanceState.Complete" />.</returns>
ISetupPackageReference GetProduct();
/// <summary>
/// Gets the relative path to the product application, if available.
/// </summary>
/// <returns>The relative path to the product application, if available.</returns>
[return: MarshalAs(UnmanagedType.BStr)]
string GetProductPath();
/// <summary>
/// Gets the error state of the instance, if available.
/// </summary>
/// <returns>The error state of the instance, if available.</returns>
ISetupErrorState GetErrors();
/// <summary>
/// Gets a value indicating whether the instance can be launched.
/// </summary>
/// <returns>Whether the instance can be launched.</returns>
/// <remarks>
/// An instance could have had errors during install but still be launched. Some features may not work correctly, but others will.
/// </remarks>
[return: MarshalAs(UnmanagedType.VariantBool)]
bool IsLaunchable();
/// <summary>
/// Gets a value indicating whether the instance is complete.
/// </summary>
/// <returns>Whether the instance is complete.</returns>
/// <remarks>
/// An instance is complete if it had no errors during install, resume, or repair.
/// </remarks>
[return: MarshalAs(UnmanagedType.VariantBool)]
bool IsComplete();
/// <summary>
/// Gets product-specific properties.
/// </summary>
/// <returns>An <see cref="T:Microsoft.VisualStudio.Setup.Configuration.ISetupPropertyStore" /> of product-specific properties, or null if no properties are defined.</returns>
ISetupPropertyStore GetProperties();
/// <summary>
/// Gets the directory path to the setup engine that installed the instance.
/// </summary>
/// <returns>The directory path to the setup engine that installed the instance.</returns>
[return: MarshalAs(UnmanagedType.BStr)]
string GetEnginePath();
}
}