From edccb203c421d2bd820062024088c6698424d9ee Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Wed, 4 Feb 2026 20:47:04 -0500 Subject: Support dual-purpose packages in Burn. Fixes https://github.com/wixtoolset/issues/issues/8958 --- src/api/burn/balutil/BalBootstrapperEngine.cpp | 13 +++++++++---- src/api/burn/balutil/inc/BootstrapperApplicationBase.h | 14 ++++++++++---- src/api/burn/balutil/inc/IBootstrapperEngine.h | 3 ++- 3 files changed, 21 insertions(+), 9 deletions(-) (limited to 'src/api/burn/balutil') diff --git a/src/api/burn/balutil/BalBootstrapperEngine.cpp b/src/api/burn/balutil/BalBootstrapperEngine.cpp index 61e7e31b..14aa5c25 100644 --- a/src/api/burn/balutil/BalBootstrapperEngine.cpp +++ b/src/api/burn/balutil/BalBootstrapperEngine.cpp @@ -1188,7 +1188,8 @@ public: // IBootstrapperEngine } virtual STDMETHODIMP Plan( - __in BOOTSTRAPPER_ACTION action + __in BOOTSTRAPPER_ACTION action, + __in BOOTSTRAPPER_SCOPE plannedScope ) { HRESULT hr = S_OK; @@ -1199,17 +1200,21 @@ public: // IBootstrapperEngine PIPE_RPC_RESULT rpc = { }; // Init send structs. - args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION; + args.dwApiVersion = WIX_7_BOOTSTRAPPER_APPLICATION_API_VERSION; args.action = action; + args.plannedScope = plannedScope; - results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION; + results.dwApiVersion = WIX_7_BOOTSTRAPPER_APPLICATION_API_VERSION; // Send args. hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion); ExitOnFailure(hr, "Failed to write API version of Plan args."); hr = BuffWriteNumberToBuffer(&bufferArgs, static_cast(args.action)); - ExitOnFailure(hr, "Failed to write parent window of Plan args."); + ExitOnFailure(hr, "Failed to write action of Plan args."); + + hr = BuffWriteNumberToBuffer(&bufferArgs, static_cast(args.plannedScope)); + ExitOnFailure(hr, "Failed to write planned scope of Plan args."); // Send results. hr = BuffWriteNumberToBuffer(&bufferResults, results.dwApiVersion); diff --git a/src/api/burn/balutil/inc/BootstrapperApplicationBase.h b/src/api/burn/balutil/inc/BootstrapperApplicationBase.h index 80bfd361..41c151d9 100644 --- a/src/api/burn/balutil/inc/BootstrapperApplicationBase.h +++ b/src/api/burn/balutil/inc/BootstrapperApplicationBase.h @@ -16,7 +16,7 @@ class CBootstrapperApplicationBase : public IBootstrapperApplication public: // IUnknown virtual STDMETHODIMP QueryInterface( __in REFIID riid, - __out LPVOID *ppvObject + __out LPVOID* ppvObject ) { if (!ppvObject) @@ -478,12 +478,14 @@ public: // IBootstrapperApplication __in DWORD dwCode, __in_z LPCWSTR wzError, __in DWORD dwUIHint, - __in DWORD /*cData*/, + __in DWORD cData, __in_ecount_z_opt(cData) LPCWSTR* /*rgwzData*/, __in int /*nRecommendation*/, __inout int* pResult ) { + UNREFERENCED_PARAMETER(cData); + BalRetryErrorOccurred(wzPackageId, dwCode); if (BOOTSTRAPPER_DISPLAY_EMBEDDED == m_commandDisplay) @@ -781,12 +783,14 @@ public: // IBootstrapperApplication __in INSTALLMESSAGE /*messageType*/, __in DWORD /*dwUIHint*/, __in_z LPCWSTR /*wzMessage*/, - __in DWORD /*cData*/, + __in DWORD cData, __in_ecount_z_opt(cData) LPCWSTR* /*rgwzData*/, __in int /*nRecommendation*/, __inout int* pResult ) { + UNREFERENCED_PARAMETER(cData); + if (CheckCanceled()) { *pResult = IDCANCEL; @@ -797,13 +801,15 @@ public: // IBootstrapperApplication virtual STDMETHODIMP OnExecuteFilesInUse( __in_z LPCWSTR /*wzPackageId*/, - __in DWORD /*cFiles*/, + __in DWORD cFiles, __in_ecount_z(cFiles) LPCWSTR* /*rgwzFiles*/, __in int /*nRecommendation*/, __in BOOTSTRAPPER_FILES_IN_USE_TYPE /*source*/, __inout int* pResult ) { + UNREFERENCED_PARAMETER(cFiles); + if (CheckCanceled()) { *pResult = IDCANCEL; diff --git a/src/api/burn/balutil/inc/IBootstrapperEngine.h b/src/api/burn/balutil/inc/IBootstrapperEngine.h index 57fc9be9..ad6e6042 100644 --- a/src/api/burn/balutil/inc/IBootstrapperEngine.h +++ b/src/api/burn/balutil/inc/IBootstrapperEngine.h @@ -108,7 +108,8 @@ DECLARE_INTERFACE_IID_(IBootstrapperEngine, IUnknown, "6480D616-27A0-44D7-905B-8 ) = 0; STDMETHOD(Plan)( - __in BOOTSTRAPPER_ACTION action + __in BOOTSTRAPPER_ACTION action, + __in BOOTSTRAPPER_SCOPE plannedScope ) = 0; STDMETHOD(Elevate)( -- cgit v1.2.3-55-g6feb