Skip to content

Commit

Permalink
Rename "bundle extension" to "bootstrapper extension" for more consis…
Browse files Browse the repository at this point in the history
…tency

Also renames WixToolet.BextUtil nupkg to WixToolset.BootstrapperExtensionApi.
  • Loading branch information
robmen committed Mar 7, 2024
1 parent dea25ba commit 5baa1df
Show file tree
Hide file tree
Showing 119 changed files with 1,082 additions and 1,087 deletions.
2 changes: 2 additions & 0 deletions src/api/api.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ dotnet test ^
@del "..\..\build\artifacts\WixToolset.Data.*.nupkg" 2> nul
@del "..\..\build\artifacts\WixToolset.Extensibility.*.nupkg" 2> nul
@del "..\..\build\artifacts\WixToolset.BootstrapperApplicationApi.*.nupkg" 2> nul
@del "..\..\build\artifacts\WixToolset.BootstrapperExtensionApi.*.nupkg" 2> nul
@del "%_L%\TestResults\api.trx" 2> nul
@rd /s/q "%USERPROFILE%\.nuget\packages\wixtoolset.bextutil" 2> nul
@rd /s/q "%USERPROFILE%\.nuget\packages\wixtoolset.data" 2> nul
@rd /s/q "%USERPROFILE%\.nuget\packages\wixtoolset.extensibility" 2> nul
@rd /s/q "%USERPROFILE%\.nuget\packages\wixtoolset.bootstrapperapplicationapi" 2> nul
@rd /s/q "%USERPROFILE%\.nuget\packages\wixtoolset.bootstrapperextensionapi" 2> nul
@exit /b

:end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "precomp.h"


class CBextBundleExtensionEngine : public IBundleExtensionEngine
class CBextBootstrapperExtensionEngine : public IBootstrapperExtensionEngine
{
public: // IUnknown
virtual STDMETHODIMP QueryInterface(
Expand All @@ -18,9 +18,9 @@ class CBextBundleExtensionEngine : public IBundleExtensionEngine

*ppvObject = NULL;

if (::IsEqualIID(__uuidof(IBundleExtensionEngine), riid))
if (::IsEqualIID(__uuidof(IBootstrapperExtensionEngine), riid))
{
*ppvObject = static_cast<IBundleExtensionEngine*>(this);
*ppvObject = static_cast<IBootstrapperExtensionEngine*>(this);
}
else if (::IsEqualIID(IID_IUnknown, riid))
{
Expand Down Expand Up @@ -52,16 +52,16 @@ class CBextBundleExtensionEngine : public IBundleExtensionEngine
return 0;
}

public: // IBundleExtensionEngine
public: // IBootstrapperExtensionEngine
virtual STDMETHODIMP EscapeString(
__in_z LPCWSTR wzIn,
__out_ecount_opt(*pcchOut) LPWSTR wzOut,
__inout SIZE_T* pcchOut
)
{
HRESULT hr = S_OK;
BUNDLE_EXTENSION_ENGINE_ESCAPESTRING_ARGS args = { };
BUNDLE_EXTENSION_ENGINE_ESCAPESTRING_RESULTS results = { };
BOOTSTRAPPER_EXTENSION_ENGINE_ESCAPESTRING_ARGS args = { };
BOOTSTRAPPER_EXTENSION_ENGINE_ESCAPESTRING_RESULTS results = { };

ExitOnNull(pcchOut, hr, E_INVALIDARG, "pcchOut is required");

Expand All @@ -72,7 +72,7 @@ class CBextBundleExtensionEngine : public IBundleExtensionEngine
results.wzOut = wzOut;
results.cchOut = *pcchOut;

hr = m_pfnBundleExtensionEngineProc(BUNDLE_EXTENSION_ENGINE_MESSAGE_ESCAPESTRING, &args, &results, m_pvBundleExtensionEngineProcContext);
hr = m_pfnBootstrapperExtensionEngineProc(BOOTSTRAPPER_EXTENSION_ENGINE_MESSAGE_ESCAPESTRING, &args, &results, m_pvBootstrapperExtensionEngineProcContext);

*pcchOut = results.cchOut;

Expand All @@ -86,8 +86,8 @@ class CBextBundleExtensionEngine : public IBundleExtensionEngine
)
{
HRESULT hr = S_OK;
BUNDLE_EXTENSION_ENGINE_EVALUATECONDITION_ARGS args = { };
BUNDLE_EXTENSION_ENGINE_EVALUATECONDITION_RESULTS results = { };
BOOTSTRAPPER_EXTENSION_ENGINE_EVALUATECONDITION_ARGS args = { };
BOOTSTRAPPER_EXTENSION_ENGINE_EVALUATECONDITION_RESULTS results = { };

ExitOnNull(pf, hr, E_INVALIDARG, "pf is required");

Expand All @@ -96,7 +96,7 @@ class CBextBundleExtensionEngine : public IBundleExtensionEngine

results.cbSize = sizeof(results);

hr = m_pfnBundleExtensionEngineProc(BUNDLE_EXTENSION_ENGINE_MESSAGE_EVALUATECONDITION, &args, &results, m_pvBundleExtensionEngineProcContext);
hr = m_pfnBootstrapperExtensionEngineProc(BOOTSTRAPPER_EXTENSION_ENGINE_MESSAGE_EVALUATECONDITION, &args, &results, m_pvBootstrapperExtensionEngineProcContext);

*pf = results.f;

Expand All @@ -111,8 +111,8 @@ class CBextBundleExtensionEngine : public IBundleExtensionEngine
)
{
HRESULT hr = S_OK;
BUNDLE_EXTENSION_ENGINE_FORMATSTRING_ARGS args = { };
BUNDLE_EXTENSION_ENGINE_FORMATSTRING_RESULTS results = { };
BOOTSTRAPPER_EXTENSION_ENGINE_FORMATSTRING_ARGS args = { };
BOOTSTRAPPER_EXTENSION_ENGINE_FORMATSTRING_RESULTS results = { };

ExitOnNull(pcchOut, hr, E_INVALIDARG, "pcchOut is required");

Expand All @@ -123,7 +123,7 @@ class CBextBundleExtensionEngine : public IBundleExtensionEngine
results.wzOut = wzOut;
results.cchOut = *pcchOut;

hr = m_pfnBundleExtensionEngineProc(BUNDLE_EXTENSION_ENGINE_MESSAGE_FORMATSTRING, &args, &results, m_pvBundleExtensionEngineProcContext);
hr = m_pfnBootstrapperExtensionEngineProc(BOOTSTRAPPER_EXTENSION_ENGINE_MESSAGE_FORMATSTRING, &args, &results, m_pvBootstrapperExtensionEngineProcContext);

*pcchOut = results.cchOut;

Expand All @@ -137,8 +137,8 @@ class CBextBundleExtensionEngine : public IBundleExtensionEngine
)
{
HRESULT hr = S_OK;
BUNDLE_EXTENSION_ENGINE_GETVARIABLENUMERIC_ARGS args = { };
BUNDLE_EXTENSION_ENGINE_GETVARIABLENUMERIC_RESULTS results = { };
BOOTSTRAPPER_EXTENSION_ENGINE_GETVARIABLENUMERIC_ARGS args = { };
BOOTSTRAPPER_EXTENSION_ENGINE_GETVARIABLENUMERIC_RESULTS results = { };

ExitOnNull(pllValue, hr, E_INVALIDARG, "pllValue is required");

Expand All @@ -147,7 +147,7 @@ class CBextBundleExtensionEngine : public IBundleExtensionEngine

results.cbSize = sizeof(results);

hr = m_pfnBundleExtensionEngineProc(BUNDLE_EXTENSION_ENGINE_MESSAGE_GETVARIABLENUMERIC, &args, &results, m_pvBundleExtensionEngineProcContext);
hr = m_pfnBootstrapperExtensionEngineProc(BOOTSTRAPPER_EXTENSION_ENGINE_MESSAGE_GETVARIABLENUMERIC, &args, &results, m_pvBootstrapperExtensionEngineProcContext);

*pllValue = results.llValue;

Expand All @@ -163,8 +163,8 @@ class CBextBundleExtensionEngine : public IBundleExtensionEngine
)
{
HRESULT hr = S_OK;
BUNDLE_EXTENSION_ENGINE_GETVARIABLESTRING_ARGS args = { };
BUNDLE_EXTENSION_ENGINE_GETVARIABLESTRING_RESULTS results = { };
BOOTSTRAPPER_EXTENSION_ENGINE_GETVARIABLESTRING_ARGS args = { };
BOOTSTRAPPER_EXTENSION_ENGINE_GETVARIABLESTRING_RESULTS results = { };

ExitOnNull(pcchValue, hr, E_INVALIDARG, "pcchValue is required");

Expand All @@ -175,7 +175,7 @@ class CBextBundleExtensionEngine : public IBundleExtensionEngine
results.wzValue = wzValue;
results.cchValue = *pcchValue;

hr = m_pfnBundleExtensionEngineProc(BUNDLE_EXTENSION_ENGINE_MESSAGE_GETVARIABLESTRING, &args, &results, m_pvBundleExtensionEngineProcContext);
hr = m_pfnBootstrapperExtensionEngineProc(BOOTSTRAPPER_EXTENSION_ENGINE_MESSAGE_GETVARIABLESTRING, &args, &results, m_pvBootstrapperExtensionEngineProcContext);

*pcchValue = results.cchValue;

Expand All @@ -190,8 +190,8 @@ class CBextBundleExtensionEngine : public IBundleExtensionEngine
)
{
HRESULT hr = S_OK;
BUNDLE_EXTENSION_ENGINE_GETVARIABLEVERSION_ARGS args = { };
BUNDLE_EXTENSION_ENGINE_GETVARIABLEVERSION_RESULTS results = { };
BOOTSTRAPPER_EXTENSION_ENGINE_GETVARIABLEVERSION_ARGS args = { };
BOOTSTRAPPER_EXTENSION_ENGINE_GETVARIABLEVERSION_RESULTS results = { };

ExitOnNull(pcchValue, hr, E_INVALIDARG, "pcchValue is required");

Expand All @@ -202,7 +202,7 @@ class CBextBundleExtensionEngine : public IBundleExtensionEngine
results.wzValue = wzValue;
results.cchValue = *pcchValue;

hr = m_pfnBundleExtensionEngineProc(BUNDLE_EXTENSION_ENGINE_MESSAGE_GETVARIABLEVERSION, &args, &results, m_pvBundleExtensionEngineProcContext);
hr = m_pfnBootstrapperExtensionEngineProc(BOOTSTRAPPER_EXTENSION_ENGINE_MESSAGE_GETVARIABLEVERSION, &args, &results, m_pvBootstrapperExtensionEngineProcContext);

*pcchValue = results.cchValue;

Expand All @@ -211,37 +211,37 @@ class CBextBundleExtensionEngine : public IBundleExtensionEngine
}

virtual STDMETHODIMP Log(
__in BUNDLE_EXTENSION_LOG_LEVEL level,
__in BOOTSTRAPPER_EXTENSION_LOG_LEVEL level,
__in_z LPCWSTR wzMessage
)
{
BUNDLE_EXTENSION_ENGINE_LOG_ARGS args = { };
BUNDLE_EXTENSION_ENGINE_LOG_RESULTS results = { };
BOOTSTRAPPER_EXTENSION_ENGINE_LOG_ARGS args = { };
BOOTSTRAPPER_EXTENSION_ENGINE_LOG_RESULTS results = { };

args.cbSize = sizeof(args);
args.level = level;
args.wzMessage = wzMessage;

results.cbSize = sizeof(results);

return m_pfnBundleExtensionEngineProc(BUNDLE_EXTENSION_ENGINE_MESSAGE_LOG, &args, &results, m_pvBundleExtensionEngineProcContext);
return m_pfnBootstrapperExtensionEngineProc(BOOTSTRAPPER_EXTENSION_ENGINE_MESSAGE_LOG, &args, &results, m_pvBootstrapperExtensionEngineProcContext);
}

virtual STDMETHODIMP SetVariableNumeric(
__in_z LPCWSTR wzVariable,
__in LONGLONG llValue
)
{
BUNDLE_EXTENSION_ENGINE_SETVARIABLENUMERIC_ARGS args = { };
BUNDLE_EXTENSION_ENGINE_SETVARIABLENUMERIC_RESULTS results = { };
BOOTSTRAPPER_EXTENSION_ENGINE_SETVARIABLENUMERIC_ARGS args = { };
BOOTSTRAPPER_EXTENSION_ENGINE_SETVARIABLENUMERIC_RESULTS results = { };

args.cbSize = sizeof(args);
args.wzVariable = wzVariable;
args.llValue = llValue;

results.cbSize = sizeof(results);

return m_pfnBundleExtensionEngineProc(BUNDLE_EXTENSION_ENGINE_MESSAGE_SETVARIABLENUMERIC, &args, &results, m_pvBundleExtensionEngineProcContext);
return m_pfnBootstrapperExtensionEngineProc(BOOTSTRAPPER_EXTENSION_ENGINE_MESSAGE_SETVARIABLENUMERIC, &args, &results, m_pvBootstrapperExtensionEngineProcContext);
}

virtual STDMETHODIMP SetVariableString(
Expand All @@ -250,8 +250,8 @@ class CBextBundleExtensionEngine : public IBundleExtensionEngine
__in BOOL fFormatted
)
{
BUNDLE_EXTENSION_ENGINE_SETVARIABLESTRING_ARGS args = { };
BUNDLE_EXTENSION_ENGINE_SETVARIABLESTRING_RESULTS results = { };
BOOTSTRAPPER_EXTENSION_ENGINE_SETVARIABLESTRING_ARGS args = { };
BOOTSTRAPPER_EXTENSION_ENGINE_SETVARIABLESTRING_RESULTS results = { };

args.cbSize = sizeof(args);
args.wzVariable = wzVariable;
Expand All @@ -260,24 +260,24 @@ class CBextBundleExtensionEngine : public IBundleExtensionEngine

results.cbSize = sizeof(results);

return m_pfnBundleExtensionEngineProc(BUNDLE_EXTENSION_ENGINE_MESSAGE_SETVARIABLESTRING, &args, &results, m_pvBundleExtensionEngineProcContext);
return m_pfnBootstrapperExtensionEngineProc(BOOTSTRAPPER_EXTENSION_ENGINE_MESSAGE_SETVARIABLESTRING, &args, &results, m_pvBootstrapperExtensionEngineProcContext);
}

virtual STDMETHODIMP SetVariableVersion(
__in_z LPCWSTR wzVariable,
__in_z_opt LPCWSTR wzValue
)
{
BUNDLE_EXTENSION_ENGINE_SETVARIABLEVERSION_ARGS args = { };
BUNDLE_EXTENSION_ENGINE_SETVARIABLEVERSION_RESULTS results = { };
BOOTSTRAPPER_EXTENSION_ENGINE_SETVARIABLEVERSION_ARGS args = { };
BOOTSTRAPPER_EXTENSION_ENGINE_SETVARIABLEVERSION_RESULTS results = { };

args.cbSize = sizeof(args);
args.wzVariable = wzVariable;
args.wzValue = wzValue;

results.cbSize = sizeof(results);

return m_pfnBundleExtensionEngineProc(BUNDLE_EXTENSION_ENGINE_MESSAGE_SETVARIABLEVERSION, &args, &results, m_pvBundleExtensionEngineProcContext);
return m_pfnBootstrapperExtensionEngineProc(BOOTSTRAPPER_EXTENSION_ENGINE_MESSAGE_SETVARIABLEVERSION, &args, &results, m_pvBootstrapperExtensionEngineProcContext);
}

virtual STDMETHODIMP CompareVersions(
Expand All @@ -287,8 +287,8 @@ class CBextBundleExtensionEngine : public IBundleExtensionEngine
)
{
HRESULT hr = S_OK;
BUNDLE_EXTENSION_ENGINE_COMPAREVERSIONS_ARGS args = { };
BUNDLE_EXTENSION_ENGINE_COMPAREVERSIONS_RESULTS results = { };
BOOTSTRAPPER_EXTENSION_ENGINE_COMPAREVERSIONS_ARGS args = { };
BOOTSTRAPPER_EXTENSION_ENGINE_COMPAREVERSIONS_RESULTS results = { };

ExitOnNull(pnResult, hr, E_INVALIDARG, "pnResult is required");

Expand All @@ -298,7 +298,7 @@ class CBextBundleExtensionEngine : public IBundleExtensionEngine

results.cbSize = sizeof(results);

hr = m_pfnBundleExtensionEngineProc(BUNDLE_EXTENSION_ENGINE_MESSAGE_COMPAREVERSIONS, &args, &results, m_pvBundleExtensionEngineProcContext);
hr = m_pfnBootstrapperExtensionEngineProc(BOOTSTRAPPER_EXTENSION_ENGINE_MESSAGE_COMPAREVERSIONS, &args, &results, m_pvBootstrapperExtensionEngineProcContext);

*pnResult = results.nResult;

Expand All @@ -314,8 +314,8 @@ class CBextBundleExtensionEngine : public IBundleExtensionEngine
)
{
HRESULT hr = S_OK;
BUNDLE_EXTENSION_ENGINE_GETRELATEDBUNDLEVARIABLE_ARGS args = { };
BUNDLE_EXTENSION_ENGINE_GETRELATEDBUNDLEVARIABLE_RESULTS results = { };
BOOTSTRAPPER_EXTENSION_ENGINE_GETRELATEDBUNDLEVARIABLE_ARGS args = { };
BOOTSTRAPPER_EXTENSION_ENGINE_GETRELATEDBUNDLEVARIABLE_RESULTS results = { };

ExitOnNull(pcchValue, hr, E_INVALIDARG, "pcchValue is required");

Expand All @@ -327,7 +327,7 @@ class CBextBundleExtensionEngine : public IBundleExtensionEngine
results.wzValue = wzValue;
results.cchValue = *pcchValue;

hr = m_pfnBundleExtensionEngineProc(BUNDLE_EXTENSION_ENGINE_MESSAGE_GETRELATEDBUNDLEVARIABLE, &args, &results, m_pvBundleExtensionEngineProcContext);
hr = m_pfnBootstrapperExtensionEngineProc(BOOTSTRAPPER_EXTENSION_ENGINE_MESSAGE_GETRELATEDBUNDLEVARIABLE, &args, &results, m_pvBootstrapperExtensionEngineProcContext);

*pcchValue = results.cchValue;

Expand All @@ -336,38 +336,38 @@ class CBextBundleExtensionEngine : public IBundleExtensionEngine
}

public:
CBextBundleExtensionEngine(
__in PFN_BUNDLE_EXTENSION_ENGINE_PROC pfnBundleExtensionEngineProc,
__in_opt LPVOID pvBundleExtensionEngineProcContext
CBextBootstrapperExtensionEngine(
__in PFN_BOOTSTRAPPER_EXTENSION_ENGINE_PROC pfnBootstrapperExtensionEngineProc,
__in_opt LPVOID pvBootstrapperExtensionEngineProcContext
)
{
m_cReferences = 1;
m_pfnBundleExtensionEngineProc = pfnBundleExtensionEngineProc;
m_pvBundleExtensionEngineProcContext = pvBundleExtensionEngineProcContext;
m_pfnBootstrapperExtensionEngineProc = pfnBootstrapperExtensionEngineProc;
m_pvBootstrapperExtensionEngineProcContext = pvBootstrapperExtensionEngineProcContext;
}

private:
long m_cReferences;
PFN_BUNDLE_EXTENSION_ENGINE_PROC m_pfnBundleExtensionEngineProc;
LPVOID m_pvBundleExtensionEngineProcContext;
PFN_BOOTSTRAPPER_EXTENSION_ENGINE_PROC m_pfnBootstrapperExtensionEngineProc;
LPVOID m_pvBootstrapperExtensionEngineProcContext;
};

HRESULT BextBundleExtensionEngineCreate(
__in PFN_BUNDLE_EXTENSION_ENGINE_PROC pfnBundleExtensionEngineProc,
__in_opt LPVOID pvBundleExtensionEngineProcContext,
__out IBundleExtensionEngine** ppEngineForExtension
HRESULT BextBootstrapperExtensionEngineCreate(
__in PFN_BOOTSTRAPPER_EXTENSION_ENGINE_PROC pfnBootstrapperExtensionEngineProc,
__in_opt LPVOID pvBootstrapperExtensionEngineProcContext,
__out IBootstrapperExtensionEngine** ppEngineForExtension
)
{
HRESULT hr = S_OK;
CBextBundleExtensionEngine* pBundleExtensionEngine = NULL;
CBextBootstrapperExtensionEngine* pBootstrapperExtensionEngine = NULL;

pBundleExtensionEngine = new CBextBundleExtensionEngine(pfnBundleExtensionEngineProc, pvBundleExtensionEngineProcContext);
ExitOnNull(pBundleExtensionEngine, hr, E_OUTOFMEMORY, "Failed to allocate new BextBundleExtensionEngine object.");
pBootstrapperExtensionEngine = new CBextBootstrapperExtensionEngine(pfnBootstrapperExtensionEngineProc, pvBootstrapperExtensionEngineProcContext);
ExitOnNull(pBootstrapperExtensionEngine, hr, E_OUTOFMEMORY, "Failed to allocate new BextBootstrapperExtensionEngine object.");

hr = pBundleExtensionEngine->QueryInterface(IID_PPV_ARGS(ppEngineForExtension));
ExitOnFailure(hr, "Failed to QI for IBundleExtensionEngine from BextBundleExtensionEngine object.");
hr = pBootstrapperExtensionEngine->QueryInterface(IID_PPV_ARGS(ppEngineForExtension));
ExitOnFailure(hr, "Failed to QI for IBootstrapperExtensionEngine from BextBootstrapperExtensionEngine object.");

LExit:
ReleaseObject(pBundleExtensionEngine);
ReleaseObject(pBootstrapperExtensionEngine);
return hr;
}
Loading

0 comments on commit 5baa1df

Please sign in to comment.