-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use ExePayloadRef for PrimaryPayloadId and SecondaryPayloadId #532
base: main
Are you sure you want to change the base?
Conversation
@robmen Please, tell if more stuff has to be done, like unit tests, etc. |
Yeah, need the following:
|
@robmen Ready. Created the issue and added the test. |
@robmen Anything else missing in the PR? |
Nothing missing but time. I'm currently focused on customer work. This PR, in particular, I need time to dig into and make sure I understand the root cause. So, it takes more than a cursory look. The added test case is very much appreciated as it will highlight the broken code path. |
@robmen To facilitate your root cause analysis a little bit. This issue was introduced in #496. Prior to that, the application was loaded in burn/engine/userexperience.cpp, in LPCWSTR wzPath = pUserExperience->payloads.rgPayloads[0].sczLocalFilePath;
...
// Load BA DLL.
pUserExperience->hUXModule = ::LoadLibraryExW(wzPath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); So it was the first With #496 the // @PrimaryPayloadId
hr = XmlGetAttributeEx(pixnUserExperienceNode, L"PrimaryPayloadId", &sczPrimaryId);
ExitOnRequiredXmlQueryFailure(hr, "Failed to get @PrimaryPayloadId.");
// @SecondaryPayloadId
hr = XmlGetAttributeEx(pixnUserExperienceNode, L"SecondaryPayloadId", &sczSecondaryId);
ExitOnOptionalXmlQueryFailure(hr, fFoundSecondary, "Failed to get @SecondaryPayloadId.");
...
// Find the primary and secondary bootstrapper application payloads.
for (DWORD i = 0; i < pUserExperience->payloads.cPayloads; ++i)
{
BURN_PAYLOAD* pPayload = pUserExperience->payloads.rgPayloads + i;
if (!pUserExperience->pPrimaryExePayload && CSTR_EQUAL == ::CompareStringOrdinal(pPayload->sczKey, -1, sczPrimaryId, -1, FALSE))
{
pUserExperience->pPrimaryExePayload = pPayload;
}
else if (fFoundSecondary && !pUserExperience->pSecondaryExePayload && CSTR_EQUAL == ::CompareStringOrdinal(pPayload->sczKey, -1, sczSecondaryId, -1, FALSE))
{
pUserExperience->pSecondaryExePayload = pPayload;
}
} So currently if one sets a custom |
This is a fix for the issue wixtoolset/issues#8673 with the custom BootstrapperApplication Id. This property can be anything, for example, "MyBootstrapper", but it's later assigned to
PrimaryPayloadId
, which is matched against Payload Id here:While ExePayloadRef is exactly the reference to the exe payload.