Path: blob/master/Utilities/cmvssetup/Setup.Configuration.h
3148 views
// <copyright file="Setup.Configuration.h" company="Microsoft Corporation">1// Copyright (C) Microsoft Corporation. All rights reserved.2// </copyright>34// This file is licensed under "The MIT License(MIT)".5// This file is released by Visual Studio setup team for consumption by external applications.6// For more information please look at this git repo https://github.com/microsoft/vs-setup-samples78#ifndef SetupConfiguration_h9#define SetupConfiguration_h1011#include <objbase.h>1213// Constants14//15#ifndef E_NOTFOUND16#define E_NOTFOUND HRESULT_FROM_WIN32(ERROR_NOT_FOUND)17#endif1819#ifndef E_FILENOTFOUND20#define E_FILENOTFOUND HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)21#endif2223#if defined(_WIN32) && !defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)2425#ifndef _Outptr_result_maybenull_26#define _Outptr_result_maybenull_27#endif28#ifndef _Out_writes_to_29#define _Out_writes_to_(x,y)30#endif31#ifndef _Reserved_32#define _Reserved_33#endif34#ifndef MAXUINT35#define MAXUINT ((UINT)~((UINT)0))36#endif3738// Enumerations39//40/// <summary>41/// The state of an instance.42/// </summary>43enum InstanceState44{45/// <summary>46/// The instance state has not been determined.47/// </summary>48eNone = 0,4950/// <summary>51/// The instance installation path exists.52/// </summary>53eLocal = 1,5455/// <summary>56/// A product is registered to the instance.57/// </summary>58eRegistered = 2,5960/// <summary>61/// No reboot is required for the instance.62/// </summary>63eNoRebootRequired = 4,6465/// <summary>66/// The instance represents a complete install.67/// </summary>68eComplete = MAXUINT,69};7071// Forward interface declarations72//73#ifndef __ISetupInstance_FWD_DEFINED__74#define __ISetupInstance_FWD_DEFINED__75typedef struct ISetupInstance ISetupInstance;76#endif7778#ifndef __ISetupInstance2_FWD_DEFINED__79#define __ISetupInstance2_FWD_DEFINED__80typedef struct ISetupInstance2 ISetupInstance2;81#endif8283#ifndef __IEnumSetupInstances_FWD_DEFINED__84#define __IEnumSetupInstances_FWD_DEFINED__85typedef struct IEnumSetupInstances IEnumSetupInstances;86#endif8788#ifndef __ISetupConfiguration_FWD_DEFINED__89#define __ISetupConfiguration_FWD_DEFINED__90typedef struct ISetupConfiguration ISetupConfiguration;91#endif9293#ifndef __ISetupConfiguration2_FWD_DEFINED__94#define __ISetupConfiguration2_FWD_DEFINED__95typedef struct ISetupConfiguration2 ISetupConfiguration2;96#endif9798#ifndef __ISetupPackageReference_FWD_DEFINED__99#define __ISetupPackageReference_FWD_DEFINED__100typedef struct ISetupPackageReference ISetupPackageReference;101#endif102103#ifndef __ISetupHelper_FWD_DEFINED__104#define __ISetupHelper_FWD_DEFINED__105typedef struct ISetupHelper ISetupHelper;106#endif107108// Forward class declarations109//110#ifndef __SetupConfiguration_FWD_DEFINED__111#define __SetupConfiguration_FWD_DEFINED__112113#ifdef __cplusplus114typedef class SetupConfiguration SetupConfiguration;115#endif116117#endif118119#ifdef __cplusplus120extern "C" {121#endif122123// Interface definitions124//125EXTERN_C const IID IID_ISetupInstance;126127#if defined(__cplusplus) && !defined(CINTERFACE)128/// <summary>129/// Information about an instance of a product.130/// </summary>131struct DECLSPEC_UUID("B41463C3-8866-43B5-BC33-2B0676F7F42E") DECLSPEC_NOVTABLE ISetupInstance : public IUnknown132{133/// <summary>134/// Gets the instance identifier (should match the name of the parent instance directory).135/// </summary>136/// <param name="pbstrInstanceId">The instance identifier.</param>137/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>138STDMETHOD(GetInstanceId)(139_Out_ BSTR* pbstrInstanceId140) = 0;141142/// <summary>143/// Gets the local date and time when the installation was originally installed.144/// </summary>145/// <param name="pInstallDate">The local date and time when the installation was originally installed.</param>146/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>147STDMETHOD(GetInstallDate)(148_Out_ LPFILETIME pInstallDate149) = 0;150151/// <summary>152/// Gets the unique name of the installation, often indicating the branch and other information used for telemetry.153/// </summary>154/// <param name="pbstrInstallationName">The unique name of the installation, often indicating the branch and other information used for telemetry.</param>155/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>156STDMETHOD(GetInstallationName)(157_Out_ BSTR* pbstrInstallationName158) = 0;159160/// <summary>161/// Gets the path to the installation root of the product.162/// </summary>163/// <param name="pbstrInstallationPath">The path to the installation root of the product.</param>164/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>165STDMETHOD(GetInstallationPath)(166_Out_ BSTR* pbstrInstallationPath167) = 0;168169/// <summary>170/// Gets the version of the product installed in this instance.171/// </summary>172/// <param name="pbstrInstallationVersion">The version of the product installed in this instance.</param>173/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>174STDMETHOD(GetInstallationVersion)(175_Out_ BSTR* pbstrInstallationVersion176) = 0;177178/// <summary>179/// Gets the display name (title) of the product installed in this instance.180/// </summary>181/// <param name="lcid">The LCID for the display name.</param>182/// <param name="pbstrDisplayName">The display name (title) of the product installed in this instance.</param>183/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>184STDMETHOD(GetDisplayName)(185_In_ LCID lcid,186_Out_ BSTR* pbstrDisplayName187) = 0;188189/// <summary>190/// Gets the description of the product installed in this instance.191/// </summary>192/// <param name="lcid">The LCID for the description.</param>193/// <param name="pbstrDescription">The description of the product installed in this instance.</param>194/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>195STDMETHOD(GetDescription)(196_In_ LCID lcid,197_Out_ BSTR* pbstrDescription198) = 0;199200/// <summary>201/// Resolves the optional relative path to the root path of the instance.202/// </summary>203/// <param name="pwszRelativePath">A relative path within the instance to resolve, or NULL to get the root path.</param>204/// <param name="pbstrAbsolutePath">The full path to the optional relative path within the instance. If the relative path is NULL, the root path will always terminate in a backslash.</param>205/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>206STDMETHOD(ResolvePath)(207_In_opt_z_ LPCOLESTR pwszRelativePath,208_Out_ BSTR* pbstrAbsolutePath209) = 0;210};211#endif212213EXTERN_C const IID IID_ISetupInstance2;214215#if defined(__cplusplus) && !defined(CINTERFACE)216/// <summary>217/// Information about an instance of a product.218/// </summary>219struct DECLSPEC_UUID("89143C9A-05AF-49B0-B717-72E218A2185C") DECLSPEC_NOVTABLE ISetupInstance2 : public ISetupInstance220{221/// <summary>222/// Gets the state of the instance.223/// </summary>224/// <param name="pState">The state of the instance.</param>225/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>226STDMETHOD(GetState)(227_Out_ InstanceState* pState228) = 0;229230/// <summary>231/// Gets an array of package references registered to the instance.232/// </summary>233/// <param name="ppsaPackages">Pointer to an array of <see cref="ISetupPackageReference"/>.</param>234/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the packages property is not defined.</returns>235STDMETHOD(GetPackages)(236_Out_ LPSAFEARRAY* ppsaPackages237) = 0;238239/// <summary>240/// Gets a pointer to the <see cref="ISetupPackageReference"/> that represents the registered product.241/// </summary>242/// <param name="ppPackage">Pointer to an instance of <see cref="ISetupPackageReference"/>. This may be NULL if <see cref="GetState"/> does not return <see cref="eComplete"/>.</param>243/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the packages property is not defined.</returns>244STDMETHOD(GetProduct)(245_Outptr_result_maybenull_ ISetupPackageReference** ppPackage246) = 0;247248/// <summary>249/// Gets the relative path to the product application, if available.250/// </summary>251/// <param name="pbstrProductPath">The relative path to the product application, if available.</param>252/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>253STDMETHOD(GetProductPath)(254_Outptr_result_maybenull_ BSTR* pbstrProductPath255) = 0;256};257#endif258259EXTERN_C const IID IID_IEnumSetupInstances;260261#if defined(__cplusplus) && !defined(CINTERFACE)262/// <summary>263/// A enumerator of installed <see cref="ISetupInstance"/> objects.264/// </summary>265struct DECLSPEC_UUID("6380BCFF-41D3-4B2E-8B2E-BF8A6810C848") DECLSPEC_NOVTABLE IEnumSetupInstances : public IUnknown266{267/// <summary>268/// Retrieves the next set of product instances in the enumeration sequence.269/// </summary>270/// <param name="celt">The number of product instances to retrieve.</param>271/// <param name="rgelt">A pointer to an array of <see cref="ISetupInstance"/>.</param>272/// <param name="pceltFetched">A pointer to the number of product instances retrieved. If celt is 1 this parameter may be NULL.</param>273/// <returns>S_OK if the number of elements were fetched, S_FALSE if nothing was fetched (at end of enumeration), E_INVALIDARG if celt is greater than 1 and pceltFetched is NULL, or E_OUTOFMEMORY if an <see cref="ISetupInstance"/> could not be allocated.</returns>274STDMETHOD(Next)(275_In_ ULONG celt,276_Out_writes_to_(celt, *pceltFetched) ISetupInstance** rgelt,277_Out_opt_ _Deref_out_range_(0, celt) ULONG* pceltFetched278) = 0;279280/// <summary>281/// Skips the next set of product instances in the enumeration sequence.282/// </summary>283/// <param name="celt">The number of product instances to skip.</param>284/// <returns>S_OK if the number of elements could be skipped; otherwise, S_FALSE;</returns>285STDMETHOD(Skip)(286_In_ ULONG celt287) = 0;288289/// <summary>290/// Resets the enumeration sequence to the beginning.291/// </summary>292/// <returns>Always returns S_OK;</returns>293STDMETHOD(Reset)(void) = 0;294295/// <summary>296/// Creates a new enumeration object in the same state as the current enumeration object: the new object points to the same place in the enumeration sequence.297/// </summary>298/// <param name="ppenum">A pointer to a pointer to a new <see cref="IEnumSetupInstances"/> interface. If the method fails, this parameter is undefined.</param>299/// <returns>S_OK if a clone was returned; otherwise, E_OUTOFMEMORY.</returns>300STDMETHOD(Clone)(301_Deref_out_opt_ IEnumSetupInstances** ppenum302) = 0;303};304#endif305306EXTERN_C const IID IID_ISetupConfiguration;307308#if defined(__cplusplus) && !defined(CINTERFACE)309/// <summary>310/// Gets information about product instances set up on the machine.311/// </summary>312struct DECLSPEC_UUID("42843719-DB4C-46C2-8E7C-64F1816EFD5B") DECLSPEC_NOVTABLE ISetupConfiguration : public IUnknown313{314/// <summary>315/// Enumerates all completed product instances installed.316/// </summary>317/// <param name="ppEnumInstances">An enumeration of completed, installed product instances.</param>318/// <returns>Standard HRESULT indicating success or failure.</returns>319STDMETHOD(EnumInstances)(320_Out_ IEnumSetupInstances** ppEnumInstances321) = 0;322323/// <summary>324/// Gets the instance for the current process path.325/// </summary>326/// <param name="ppInstance">The instance for the current process path.</param>327/// <returns>The instance for the current process path, or E_NOTFOUND if not found.</returns>328STDMETHOD(GetInstanceForCurrentProcess)(329_Out_ ISetupInstance** ppInstance330) = 0;331332/// <summary>333/// Gets the instance for the given path.334/// </summary>335/// <param name="ppInstance">The instance for the given path.</param>336/// <returns>The instance for the given path, or E_NOTFOUND if not found.</returns>337STDMETHOD(GetInstanceForPath)(338_In_z_ LPCWSTR wzPath,339_Out_ ISetupInstance** ppInstance340) = 0;341};342#endif343344EXTERN_C const IID IID_ISetupConfiguration2;345346#if defined(__cplusplus) && !defined(CINTERFACE)347/// <summary>348/// Gets information about product instances.349/// </summary>350struct DECLSPEC_UUID("26AAB78C-4A60-49D6-AF3B-3C35BC93365D") DECLSPEC_NOVTABLE ISetupConfiguration2 : public ISetupConfiguration351{352/// <summary>353/// Enumerates all product instances.354/// </summary>355/// <param name="ppEnumInstances">An enumeration of all product instances.</param>356/// <returns>Standard HRESULT indicating success or failure.</returns>357STDMETHOD(EnumAllInstances)(358_Out_ IEnumSetupInstances** ppEnumInstances359) = 0;360};361#endif362363EXTERN_C const IID IID_ISetupPackageReference;364365#if defined(__cplusplus) && !defined(CINTERFACE)366/// <summary>367/// A reference to a package.368/// </summary>369struct DECLSPEC_UUID("da8d8a16-b2b6-4487-a2f1-594ccccd6bf5") DECLSPEC_NOVTABLE ISetupPackageReference : public IUnknown370{371/// <summary>372/// Gets the general package identifier.373/// </summary>374/// <param name="pbstrId">The general package identifier.</param>375/// <returns>Standard HRESULT indicating success or failure.</returns>376STDMETHOD(GetId)(377_Out_ BSTR* pbstrId378) = 0;379380/// <summary>381/// Gets the version of the package.382/// </summary>383/// <param name="pbstrVersion">The version of the package.</param>384/// <returns>Standard HRESULT indicating success or failure.</returns>385STDMETHOD(GetVersion)(386_Out_ BSTR* pbstrVersion387) = 0;388389/// <summary>390/// Gets the target process architecture of the package.391/// </summary>392/// <param name="pbstrChip">The target process architecture of the package.</param>393/// <returns>Standard HRESULT indicating success or failure.</returns>394STDMETHOD(GetChip)(395_Out_ BSTR* pbstrChip396) = 0;397398/// <summary>399/// Gets the language and optional region identifier.400/// </summary>401/// <param name="pbstrLanguage">The language and optional region identifier.</param>402/// <returns>Standard HRESULT indicating success or failure.</returns>403STDMETHOD(GetLanguage)(404_Out_ BSTR* pbstrLanguage405) = 0;406407/// <summary>408/// Gets the build branch of the package.409/// </summary>410/// <param name="pbstrBranch">The build branch of the package.</param>411/// <returns>Standard HRESULT indicating success or failure.</returns>412STDMETHOD(GetBranch)(413_Out_ BSTR* pbstrBranch414) = 0;415416/// <summary>417/// Gets the type of the package.418/// </summary>419/// <param name="pbstrType">The type of the package.</param>420/// <returns>Standard HRESULT indicating success or failure.</returns>421STDMETHOD(GetType)(422_Out_ BSTR* pbstrType423) = 0;424425/// <summary>426/// Gets the unique identifier consisting of all defined tokens.427/// </summary>428/// <param name="pbstrUniqueId">The unique identifier consisting of all defined tokens.</param>429/// <returns>Standard HRESULT indicating success or failure, including E_UNEXPECTED if no Id was defined (required).</returns>430STDMETHOD(GetUniqueId)(431_Out_ BSTR* pbstrUniqueId432) = 0;433};434#endif435436EXTERN_C const IID IID_ISetupHelper;437438#if defined(__cplusplus) && !defined(CINTERFACE)439/// <summary>440/// Helper functions.441/// </summary>442/// <remarks>443/// You can query for this interface from the <see cref="SetupConfiguration"/> class.444/// </remarks>445struct DECLSPEC_UUID("42b21b78-6192-463e-87bf-d577838f1d5c") DECLSPEC_NOVTABLE ISetupHelper : public IUnknown446{447/// <summary>448/// Parses a dotted quad version string into a 64-bit unsigned integer.449/// </summary>450/// <param name="pwszVersion">The dotted quad version string to parse, e.g. 1.2.3.4.</param>451/// <param name="pullVersion">A 64-bit unsigned integer representing the version. You can compare this to other versions.</param>452/// <returns>Standard HRESULT indicating success or failure.</returns>453STDMETHOD(ParseVersion)(454_In_ LPCOLESTR pwszVersion,455_Out_ PULONGLONG pullVersion456) = 0;457458/// <summary>459/// Parses a dotted quad version string into a 64-bit unsigned integer.460/// </summary>461/// <param name="pwszVersionRange">The string containing 1 or 2 dotted quad version strings to parse, e.g. [1.0,) that means 1.0.0.0 or newer.</param>462/// <param name="pullMinVersion">A 64-bit unsigned integer representing the minimum version, which may be 0. You can compare this to other versions.</param>463/// <param name="pullMaxVersion">A 64-bit unsigned integer representing the maximum version, which may be MAXULONGLONG. You can compare this to other versions.</param>464/// <returns>Standard HRESULT indicating success or failure.</returns>465STDMETHOD(ParseVersionRange)(466_In_ LPCOLESTR pwszVersionRange,467_Out_ PULONGLONG pullMinVersion,468_Out_ PULONGLONG pullMaxVersion469) = 0;470};471#endif472473// Class declarations474//475EXTERN_C const CLSID CLSID_SetupConfiguration;476477#ifdef __cplusplus478/// <summary>479/// This class implements <see cref="ISetupConfiguration"/>, <see cref="ISetupConfiguration2"/>, and <see cref="ISetupHelper"/>.480/// </summary>481class DECLSPEC_UUID("177F0C4A-1CD3-4DE7-A32C-71DBBB9FA36D") SetupConfiguration;482#endif483484// Function declarations485//486/// <summary>487/// Gets an <see cref="ISetupConfiguration"/> that provides information about product instances installed on the machine.488/// </summary>489/// <param name="ppConfiguration">The <see cref="ISetupConfiguration"/> that provides information about product instances installed on the machine.</param>490/// <param name="pReserved">Reserved for future use.</param>491/// <returns>Standard HRESULT indicating success or failure.</returns>492STDMETHODIMP GetSetupConfiguration(493_Out_ ISetupConfiguration** ppConfiguration,494_Reserved_ LPVOID pReserved495);496497#ifdef __cplusplus498}499#endif500501#else502503#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)504#define VS_SETUP_GCC_DIAGNOSTIC_PUSHED505#pragma GCC diagnostic push506#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"507#endif508509#ifndef MAXUINT510#define MAXUINT ((UINT)~((UINT)0))511#endif512513#ifndef DECLSPEC_NOVTABLE514#if (_MSC_VER >= 1100) && defined(__cplusplus)515#define DECLSPEC_NOVTABLE __declspec(novtable)516#else517#define DECLSPEC_NOVTABLE518#endif519#endif520521// Enumerations522//523/// <summary>524/// The state of an instance.525/// </summary>526enum InstanceState527{528/// <summary>529/// The instance state has not been determined.530/// </summary>531eNone = 0,532533/// <summary>534/// The instance installation path exists.535/// </summary>536eLocal = 1,537538/// <summary>539/// A product is registered to the instance.540/// </summary>541eRegistered = 2,542543/// <summary>544/// No reboot is required for the instance.545/// </summary>546eNoRebootRequired = 4,547548/// <summary>549/// The instance represents a complete install.550/// </summary>551eComplete = MAXUINT,552};553554// Forward interface declarations555//556#ifndef __ISetupInstance_FWD_DEFINED__557#define __ISetupInstance_FWD_DEFINED__558typedef struct ISetupInstance ISetupInstance;559#endif560561#ifndef __ISetupInstance2_FWD_DEFINED__562#define __ISetupInstance2_FWD_DEFINED__563typedef struct ISetupInstance2 ISetupInstance2;564#endif565566#ifndef __IEnumSetupInstances_FWD_DEFINED__567#define __IEnumSetupInstances_FWD_DEFINED__568typedef struct IEnumSetupInstances IEnumSetupInstances;569#endif570571#ifndef __ISetupConfiguration_FWD_DEFINED__572#define __ISetupConfiguration_FWD_DEFINED__573typedef struct ISetupConfiguration ISetupConfiguration;574#endif575576#ifndef __ISetupConfiguration2_FWD_DEFINED__577#define __ISetupConfiguration2_FWD_DEFINED__578typedef struct ISetupConfiguration2 ISetupConfiguration2;579#endif580581#ifndef __ISetupPackageReference_FWD_DEFINED__582#define __ISetupPackageReference_FWD_DEFINED__583typedef struct ISetupPackageReference ISetupPackageReference;584#endif585586#ifndef __ISetupHelper_FWD_DEFINED__587#define __ISetupHelper_FWD_DEFINED__588typedef struct ISetupHelper ISetupHelper;589#endif590591// Forward class declarations592//593#ifndef __SetupConfiguration_FWD_DEFINED__594#define __SetupConfiguration_FWD_DEFINED__595596#ifdef __cplusplus597typedef class SetupConfiguration SetupConfiguration;598#endif599600#endif601602#ifdef __cplusplus603extern "C" {604#endif605606// Interface definitions607//608EXTERN_C const IID IID_ISetupInstance;609610#if defined(__cplusplus) && !defined(CINTERFACE)611/// <summary>612/// Information about an instance of a product.613/// </summary>614struct DECLSPEC_UUID("B41463C3-8866-43B5-BC33-2B0676F7F42E") DECLSPEC_NOVTABLE ISetupInstance : public IUnknown615{616/// <summary>617/// Gets the instance identifier (should match the name of the parent instance directory).618/// </summary>619/// <param name="pbstrInstanceId">The instance identifier.</param>620/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>621STDMETHOD(GetInstanceId)(622BSTR* pbstrInstanceId623) = 0;624625/// <summary>626/// Gets the local date and time when the installation was originally installed.627/// </summary>628/// <param name="pInstallDate">The local date and time when the installation was originally installed.</param>629/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>630STDMETHOD(GetInstallDate)(631LPFILETIME pInstallDate632) = 0;633634/// <summary>635/// Gets the unique name of the installation, often indicating the branch and other information used for telemetry.636/// </summary>637/// <param name="pbstrInstallationName">The unique name of the installation, often indicating the branch and other information used for telemetry.</param>638/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>639STDMETHOD(GetInstallationName)(640BSTR* pbstrInstallationName641) = 0;642643/// <summary>644/// Gets the path to the installation root of the product.645/// </summary>646/// <param name="pbstrInstallationPath">The path to the installation root of the product.</param>647/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>648STDMETHOD(GetInstallationPath)(649BSTR* pbstrInstallationPath650) = 0;651652/// <summary>653/// Gets the version of the product installed in this instance.654/// </summary>655/// <param name="pbstrInstallationVersion">The version of the product installed in this instance.</param>656/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>657STDMETHOD(GetInstallationVersion)(658BSTR* pbstrInstallationVersion659) = 0;660661/// <summary>662/// Gets the display name (title) of the product installed in this instance.663/// </summary>664/// <param name="lcid">The LCID for the display name.</param>665/// <param name="pbstrDisplayName">The display name (title) of the product installed in this instance.</param>666/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>667STDMETHOD(GetDisplayName)(668LCID lcid,669BSTR* pbstrDisplayName670) = 0;671672/// <summary>673/// Gets the description of the product installed in this instance.674/// </summary>675/// <param name="lcid">The LCID for the description.</param>676/// <param name="pbstrDescription">The description of the product installed in this instance.</param>677/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>678STDMETHOD(GetDescription)(679LCID lcid,680BSTR* pbstrDescription681) = 0;682683/// <summary>684/// Resolves the optional relative path to the root path of the instance.685/// </summary>686/// <param name="pwszRelativePath">A relative path within the instance to resolve, or NULL to get the root path.</param>687/// <param name="pbstrAbsolutePath">The full path to the optional relative path within the instance. If the relative path is NULL, the root path will always terminate in a backslash.</param>688/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the property is not defined.</returns>689STDMETHOD(ResolvePath)(690LPCOLESTR pwszRelativePath,691BSTR* pbstrAbsolutePath692) = 0;693};694#endif695696EXTERN_C const IID IID_ISetupInstance2;697698#if defined(__cplusplus) && !defined(CINTERFACE)699/// <summary>700/// Information about an instance of a product.701/// </summary>702struct DECLSPEC_UUID("89143C9A-05AF-49B0-B717-72E218A2185C") DECLSPEC_NOVTABLE ISetupInstance2 : public ISetupInstance703{704/// <summary>705/// Gets the state of the instance.706/// </summary>707/// <param name="pState">The state of the instance.</param>708/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>709STDMETHOD(GetState)(710InstanceState* pState711) = 0;712713/// <summary>714/// Gets an array of package references registered to the instance.715/// </summary>716/// <param name="ppsaPackages">Pointer to an array of <see cref="ISetupPackageReference"/>.</param>717/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the packages property is not defined.</returns>718STDMETHOD(GetPackages)(719LPSAFEARRAY* ppsaPackages720) = 0;721722/// <summary>723/// Gets a pointer to the <see cref="ISetupPackageReference"/> that represents the registered product.724/// </summary>725/// <param name="ppPackage">Pointer to an instance of <see cref="ISetupPackageReference"/>. This may be NULL if <see cref="GetState"/> does not return <see cref="eComplete"/>.</param>726/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist and E_NOTFOUND if the packages property is not defined.</returns>727STDMETHOD(GetProduct)(728ISetupPackageReference** ppPackage729) = 0;730731/// <summary>732/// Gets the relative path to the product application, if available.733/// </summary>734/// <param name="pbstrProductPath">The relative path to the product application, if available.</param>735/// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>736STDMETHOD(GetProductPath)(737BSTR* pbstrProductPath738) = 0;739};740#endif741742EXTERN_C const IID IID_IEnumSetupInstances;743744#if defined(__cplusplus) && !defined(CINTERFACE)745/// <summary>746/// A enumerator of installed <see cref="ISetupInstance"/> objects.747/// </summary>748struct DECLSPEC_UUID("6380BCFF-41D3-4B2E-8B2E-BF8A6810C848") DECLSPEC_NOVTABLE IEnumSetupInstances : public IUnknown749{750/// <summary>751/// Retrieves the next set of product instances in the enumeration sequence.752/// </summary>753/// <param name="celt">The number of product instances to retrieve.</param>754/// <param name="rgelt">A pointer to an array of <see cref="ISetupInstance"/>.</param>755/// <param name="pceltFetched">A pointer to the number of product instances retrieved. If celt is 1 this parameter may be NULL.</param>756/// <returns>S_OK if the number of elements were fetched, S_FALSE if nothing was fetched (at end of enumeration), E_INVALIDARG if celt is greater than 1 and pceltFetched is NULL, or E_OUTOFMEMORY if an <see cref="ISetupInstance"/> could not be allocated.</returns>757STDMETHOD(Next)(758ULONG celt,759ISetupInstance** rgelt,760ULONG* pceltFetched761) = 0;762763/// <summary>764/// Skips the next set of product instances in the enumeration sequence.765/// </summary>766/// <param name="celt">The number of product instances to skip.</param>767/// <returns>S_OK if the number of elements could be skipped; otherwise, S_FALSE;</returns>768STDMETHOD(Skip)(769ULONG celt770) = 0;771772/// <summary>773/// Resets the enumeration sequence to the beginning.774/// </summary>775/// <returns>Always returns S_OK;</returns>776STDMETHOD(Reset)(void) = 0;777778/// <summary>779/// Creates a new enumeration object in the same state as the current enumeration object: the new object points to the same place in the enumeration sequence.780/// </summary>781/// <param name="ppenum">A pointer to a pointer to a new <see cref="IEnumSetupInstances"/> interface. If the method fails, this parameter is undefined.</param>782/// <returns>S_OK if a clone was returned; otherwise, E_OUTOFMEMORY.</returns>783STDMETHOD(Clone)(784IEnumSetupInstances** ppenum785) = 0;786};787#endif788789EXTERN_C const IID IID_ISetupConfiguration;790791#if defined(__cplusplus) && !defined(CINTERFACE)792/// <summary>793/// Gets information about product instances set up on the machine.794/// </summary>795struct DECLSPEC_UUID("42843719-DB4C-46C2-8E7C-64F1816EFD5B") DECLSPEC_NOVTABLE ISetupConfiguration : public IUnknown796{797/// <summary>798/// Enumerates all completed product instances installed.799/// </summary>800/// <param name="ppEnumInstances">An enumeration of completed, installed product instances.</param>801/// <returns>Standard HRESULT indicating success or failure.</returns>802STDMETHOD(EnumInstances)(803IEnumSetupInstances** ppEnumInstances804) = 0;805806/// <summary>807/// Gets the instance for the current process path.808/// </summary>809/// <param name="ppInstance">The instance for the current process path.</param>810/// <returns>The instance for the current process path, or E_NOTFOUND if not found.</returns>811STDMETHOD(GetInstanceForCurrentProcess)(812ISetupInstance** ppInstance813) = 0;814815/// <summary>816/// Gets the instance for the given path.817/// </summary>818/// <param name="ppInstance">The instance for the given path.</param>819/// <returns>The instance for the given path, or E_NOTFOUND if not found.</returns>820STDMETHOD(GetInstanceForPath)(821LPCWSTR wzPath,822ISetupInstance** ppInstance823) = 0;824};825#endif826827EXTERN_C const IID IID_ISetupConfiguration2;828829#if defined(__cplusplus) && !defined(CINTERFACE)830/// <summary>831/// Gets information about product instances.832/// </summary>833struct DECLSPEC_UUID("26AAB78C-4A60-49D6-AF3B-3C35BC93365D") DECLSPEC_NOVTABLE ISetupConfiguration2 : public ISetupConfiguration834{835/// <summary>836/// Enumerates all product instances.837/// </summary>838/// <param name="ppEnumInstances">An enumeration of all product instances.</param>839/// <returns>Standard HRESULT indicating success or failure.</returns>840STDMETHOD(EnumAllInstances)(841IEnumSetupInstances** ppEnumInstances842) = 0;843};844#endif845846EXTERN_C const IID IID_ISetupPackageReference;847848#if defined(__cplusplus) && !defined(CINTERFACE)849/// <summary>850/// A reference to a package.851/// </summary>852struct DECLSPEC_UUID("da8d8a16-b2b6-4487-a2f1-594ccccd6bf5") DECLSPEC_NOVTABLE ISetupPackageReference : public IUnknown853{854/// <summary>855/// Gets the general package identifier.856/// </summary>857/// <param name="pbstrId">The general package identifier.</param>858/// <returns>Standard HRESULT indicating success or failure.</returns>859STDMETHOD(GetId)(860BSTR* pbstrId861) = 0;862863/// <summary>864/// Gets the version of the package.865/// </summary>866/// <param name="pbstrVersion">The version of the package.</param>867/// <returns>Standard HRESULT indicating success or failure.</returns>868STDMETHOD(GetVersion)(869BSTR* pbstrVersion870) = 0;871872/// <summary>873/// Gets the target process architecture of the package.874/// </summary>875/// <param name="pbstrChip">The target process architecture of the package.</param>876/// <returns>Standard HRESULT indicating success or failure.</returns>877STDMETHOD(GetChip)(878BSTR* pbstrChip879) = 0;880881/// <summary>882/// Gets the language and optional region identifier.883/// </summary>884/// <param name="pbstrLanguage">The language and optional region identifier.</param>885/// <returns>Standard HRESULT indicating success or failure.</returns>886STDMETHOD(GetLanguage)(887BSTR* pbstrLanguage888) = 0;889890/// <summary>891/// Gets the build branch of the package.892/// </summary>893/// <param name="pbstrBranch">The build branch of the package.</param>894/// <returns>Standard HRESULT indicating success or failure.</returns>895STDMETHOD(GetBranch)(896BSTR* pbstrBranch897) = 0;898899/// <summary>900/// Gets the type of the package.901/// </summary>902/// <param name="pbstrType">The type of the package.</param>903/// <returns>Standard HRESULT indicating success or failure.</returns>904STDMETHOD(GetType)(905BSTR* pbstrType906) = 0;907908/// <summary>909/// Gets the unique identifier consisting of all defined tokens.910/// </summary>911/// <param name="pbstrUniqueId">The unique identifier consisting of all defined tokens.</param>912/// <returns>Standard HRESULT indicating success or failure, including E_UNEXPECTED if no Id was defined (required).</returns>913STDMETHOD(GetUniqueId)(914BSTR* pbstrUniqueId915) = 0;916};917#endif918919EXTERN_C const IID IID_ISetupHelper;920921#if defined(__cplusplus) && !defined(CINTERFACE)922/// <summary>923/// Helper functions.924/// </summary>925/// <remarks>926/// You can query for this interface from the <see cref="SetupConfiguration"/> class.927/// </remarks>928struct DECLSPEC_UUID("42b21b78-6192-463e-87bf-d577838f1d5c") DECLSPEC_NOVTABLE ISetupHelper : public IUnknown929{930/// <summary>931/// Parses a dotted quad version string into a 64-bit unsigned integer.932/// </summary>933/// <param name="pwszVersion">The dotted quad version string to parse, e.g. 1.2.3.4.</param>934/// <param name="pullVersion">A 64-bit unsigned integer representing the version. You can compare this to other versions.</param>935/// <returns>Standard HRESULT indicating success or failure.</returns>936STDMETHOD(ParseVersion)(937LPCOLESTR pwszVersion,938PULONGLONG pullVersion939) = 0;940941/// <summary>942/// Parses a dotted quad version string into a 64-bit unsigned integer.943/// </summary>944/// <param name="pwszVersionRange">The string containing 1 or 2 dotted quad version strings to parse, e.g. [1.0,) that means 1.0.0.0 or newer.</param>945/// <param name="pullMinVersion">A 64-bit unsigned integer representing the minimum version, which may be 0. You can compare this to other versions.</param>946/// <param name="pullMaxVersion">A 64-bit unsigned integer representing the maximum version, which may be MAXULONGLONG. You can compare this to other versions.</param>947/// <returns>Standard HRESULT indicating success or failure.</returns>948STDMETHOD(ParseVersionRange)(949LPCOLESTR pwszVersionRange,950PULONGLONG pullMinVersion,951PULONGLONG pullMaxVersion952) = 0;953};954#endif955956// Class declarations957//958EXTERN_C const CLSID CLSID_SetupConfiguration;959960#ifdef __cplusplus961/// <summary>962/// This class implements <see cref="ISetupConfiguration"/>, <see cref="ISetupConfiguration2"/>, and <see cref="ISetupHelper"/>.963/// </summary>964class DECLSPEC_UUID("177F0C4A-1CD3-4DE7-A32C-71DBBB9FA36D") SetupConfiguration;965#endif966967// Function declarations968//969/// <summary>970/// Gets an <see cref="ISetupConfiguration"/> that provides information about product instances installed on the machine.971/// </summary>972/// <param name="ppConfiguration">The <see cref="ISetupConfiguration"/> that provides information about product instances installed on the machine.</param>973/// <param name="pReserved">Reserved for future use.</param>974/// <returns>Standard HRESULT indicating success or failure.</returns>975STDMETHODIMP GetSetupConfiguration(976ISetupConfiguration** ppConfiguration,977LPVOID pReserved978);979980#ifdef __cplusplus981}982#endif983984#ifdef VS_SETUP_GCC_DIAGNOSTIC_PUSHED985#pragma GCC diagnostic pop986#undef VS_SETUP_GCC_DIAGNOSTIC_PUSHED987#endif988989#endif990#endif991992993