diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2022-03-21 23:22:23 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2022-03-22 12:26:48 -0500 |
commit | fc3e4722307c86b5d06918f0721b98323735bb40 (patch) | |
tree | 1a8c6fa25274cce22f0e274a6b3b1c5c06614745 /src/burn | |
parent | 9bb420a19538321789b8300051cd595d6c00c710 (diff) | |
download | wix-fc3e4722307c86b5d06918f0721b98323735bb40.tar.gz wix-fc3e4722307c86b5d06918f0721b98323735bb40.tar.bz2 wix-fc3e4722307c86b5d06918f0721b98323735bb40.zip |
Add `ExePackage/@Bundle` to opt-in to v3 behavior.
Automatically add '-norestart' for bundle ExePackages.
Fixes 6252
Diffstat (limited to 'src/burn')
-rw-r--r-- | src/burn/engine/core.cpp | 5 | ||||
-rw-r--r-- | src/burn/engine/elevation.cpp | 44 | ||||
-rw-r--r-- | src/burn/engine/exeengine.cpp | 91 | ||||
-rw-r--r-- | src/burn/engine/package.h | 4 | ||||
-rw-r--r-- | src/burn/engine/plan.cpp | 33 | ||||
-rw-r--r-- | src/burn/engine/plan.h | 3 | ||||
-rw-r--r-- | src/burn/test/BurnUnitTest/PlanTest.cpp | 10 |
7 files changed, 163 insertions, 27 deletions
diff --git a/src/burn/engine/core.cpp b/src/burn/engine/core.cpp index e077d224..551843f2 100644 --- a/src/burn/engine/core.cpp +++ b/src/burn/engine/core.cpp | |||
@@ -234,6 +234,11 @@ extern "C" HRESULT CoreInitializeConstants( | |||
234 | pPackage->Bundle.wzAncestors = pRegistration->sczBundlePackageAncestors; | 234 | pPackage->Bundle.wzAncestors = pRegistration->sczBundlePackageAncestors; |
235 | pPackage->Bundle.wzEngineWorkingDirectory = pInternalCommand->sczEngineWorkingDirectory; | 235 | pPackage->Bundle.wzEngineWorkingDirectory = pInternalCommand->sczEngineWorkingDirectory; |
236 | } | 236 | } |
237 | else if (BURN_PACKAGE_TYPE_EXE == pPackage->type && pPackage->Exe.fBundle) | ||
238 | { | ||
239 | pPackage->Exe.wzAncestors = pRegistration->sczBundlePackageAncestors; | ||
240 | pPackage->Exe.wzEngineWorkingDirectory = pInternalCommand->sczEngineWorkingDirectory; | ||
241 | } | ||
237 | } | 242 | } |
238 | 243 | ||
239 | LExit: | 244 | LExit: |
diff --git a/src/burn/engine/elevation.cpp b/src/burn/engine/elevation.cpp index ea56e242..8488b649 100644 --- a/src/burn/engine/elevation.cpp +++ b/src/burn/engine/elevation.cpp | |||
@@ -940,6 +940,15 @@ extern "C" HRESULT ElevationExecuteExePackage( | |||
940 | hr = BuffWriteNumber(&pbData, &cbData, fRollback); | 940 | hr = BuffWriteNumber(&pbData, &cbData, fRollback); |
941 | ExitOnFailure(hr, "Failed to write rollback."); | 941 | ExitOnFailure(hr, "Failed to write rollback."); |
942 | 942 | ||
943 | hr = BuffWriteString(&pbData, &cbData, pExecuteAction->exePackage.sczIgnoreDependencies); | ||
944 | ExitOnFailure(hr, "Failed to write the list of dependencies to ignore to the message buffer."); | ||
945 | |||
946 | hr = BuffWriteString(&pbData, &cbData, pExecuteAction->exePackage.sczAncestors); | ||
947 | ExitOnFailure(hr, "Failed to write the list of ancestors to the message buffer."); | ||
948 | |||
949 | hr = BuffWriteString(&pbData, &cbData, pExecuteAction->exePackage.sczEngineWorkingDirectory); | ||
950 | ExitOnFailure(hr, "Failed to write the custom working directory to the message buffer."); | ||
951 | |||
943 | hr = VariableSerialize(pVariables, FALSE, &pbData, &cbData); | 952 | hr = VariableSerialize(pVariables, FALSE, &pbData, &cbData); |
944 | ExitOnFailure(hr, "Failed to write variables."); | 953 | ExitOnFailure(hr, "Failed to write variables."); |
945 | 954 | ||
@@ -2844,6 +2853,9 @@ static HRESULT OnExecuteExePackage( | |||
2844 | LPWSTR sczPackage = NULL; | 2853 | LPWSTR sczPackage = NULL; |
2845 | DWORD dwRollback = 0; | 2854 | DWORD dwRollback = 0; |
2846 | BURN_EXECUTE_ACTION executeAction = { }; | 2855 | BURN_EXECUTE_ACTION executeAction = { }; |
2856 | LPWSTR sczIgnoreDependencies = NULL; | ||
2857 | LPWSTR sczAncestors = NULL; | ||
2858 | LPWSTR sczEngineWorkingDirectory = NULL; | ||
2847 | BOOTSTRAPPER_APPLY_RESTART exeRestart = BOOTSTRAPPER_APPLY_RESTART_NONE; | 2859 | BOOTSTRAPPER_APPLY_RESTART exeRestart = BOOTSTRAPPER_APPLY_RESTART_NONE; |
2848 | 2860 | ||
2849 | executeAction.type = BURN_EXECUTE_ACTION_TYPE_EXE_PACKAGE; | 2861 | executeAction.type = BURN_EXECUTE_ACTION_TYPE_EXE_PACKAGE; |
@@ -2858,6 +2870,15 @@ static HRESULT OnExecuteExePackage( | |||
2858 | hr = BuffReadNumber(pbData, cbData, &iData, &dwRollback); | 2870 | hr = BuffReadNumber(pbData, cbData, &iData, &dwRollback); |
2859 | ExitOnFailure(hr, "Failed to read rollback."); | 2871 | ExitOnFailure(hr, "Failed to read rollback."); |
2860 | 2872 | ||
2873 | hr = BuffReadString(pbData, cbData, &iData, &sczIgnoreDependencies); | ||
2874 | ExitOnFailure(hr, "Failed to read the list of dependencies to ignore."); | ||
2875 | |||
2876 | hr = BuffReadString(pbData, cbData, &iData, &sczAncestors); | ||
2877 | ExitOnFailure(hr, "Failed to read the list of ancestors."); | ||
2878 | |||
2879 | hr = BuffReadString(pbData, cbData, &iData, &sczEngineWorkingDirectory); | ||
2880 | ExitOnFailure(hr, "Failed to read the custom working directory."); | ||
2881 | |||
2861 | hr = VariableDeserialize(pVariables, FALSE, pbData, cbData, &iData); | 2882 | hr = VariableDeserialize(pVariables, FALSE, pbData, cbData, &iData); |
2862 | ExitOnFailure(hr, "Failed to read variables."); | 2883 | ExitOnFailure(hr, "Failed to read variables."); |
2863 | 2884 | ||
@@ -2869,11 +2890,34 @@ static HRESULT OnExecuteExePackage( | |||
2869 | ExitWithRootFailure(hr, E_INVALIDARG, "Package is not an EXE package: %ls", sczPackage); | 2890 | ExitWithRootFailure(hr, E_INVALIDARG, "Package is not an EXE package: %ls", sczPackage); |
2870 | } | 2891 | } |
2871 | 2892 | ||
2893 | // Pass the list of dependencies to ignore, if any, to the related bundle. | ||
2894 | if (sczIgnoreDependencies && *sczIgnoreDependencies) | ||
2895 | { | ||
2896 | hr = StrAllocString(&executeAction.exePackage.sczIgnoreDependencies, sczIgnoreDependencies, 0); | ||
2897 | ExitOnFailure(hr, "Failed to allocate the list of dependencies to ignore."); | ||
2898 | } | ||
2899 | |||
2900 | // Pass the list of ancestors, if any, to the related bundle. | ||
2901 | if (sczAncestors && *sczAncestors) | ||
2902 | { | ||
2903 | hr = StrAllocString(&executeAction.exePackage.sczAncestors, sczAncestors, 0); | ||
2904 | ExitOnFailure(hr, "Failed to allocate the list of ancestors."); | ||
2905 | } | ||
2906 | |||
2907 | if (sczEngineWorkingDirectory && *sczEngineWorkingDirectory) | ||
2908 | { | ||
2909 | hr = StrAllocString(&executeAction.exePackage.sczEngineWorkingDirectory, sczEngineWorkingDirectory, 0); | ||
2910 | ExitOnFailure(hr, "Failed to allocate the custom working directory."); | ||
2911 | } | ||
2912 | |||
2872 | // Execute EXE package. | 2913 | // Execute EXE package. |
2873 | hr = ExeEngineExecutePackage(&executeAction, pCache, pVariables, static_cast<BOOL>(dwRollback), GenericExecuteMessageHandler, hPipe, &exeRestart); | 2914 | hr = ExeEngineExecutePackage(&executeAction, pCache, pVariables, static_cast<BOOL>(dwRollback), GenericExecuteMessageHandler, hPipe, &exeRestart); |
2874 | ExitOnFailure(hr, "Failed to execute EXE package."); | 2915 | ExitOnFailure(hr, "Failed to execute EXE package."); |
2875 | 2916 | ||
2876 | LExit: | 2917 | LExit: |
2918 | ReleaseStr(sczEngineWorkingDirectory); | ||
2919 | ReleaseStr(sczAncestors); | ||
2920 | ReleaseStr(sczIgnoreDependencies); | ||
2877 | ReleaseStr(sczPackage); | 2921 | ReleaseStr(sczPackage); |
2878 | PlanUninitializeExecuteAction(&executeAction); | 2922 | PlanUninitializeExecuteAction(&executeAction); |
2879 | 2923 | ||
diff --git a/src/burn/engine/exeengine.cpp b/src/burn/engine/exeengine.cpp index a1049006..9754002f 100644 --- a/src/burn/engine/exeengine.cpp +++ b/src/burn/engine/exeengine.cpp | |||
@@ -40,6 +40,10 @@ extern "C" HRESULT ExeEngineParsePackageFromXml( | |||
40 | hr = XmlGetYesNoAttribute(pixnExePackage, L"Uninstallable", &pPackage->Exe.fUninstallable); | 40 | hr = XmlGetYesNoAttribute(pixnExePackage, L"Uninstallable", &pPackage->Exe.fUninstallable); |
41 | ExitOnOptionalXmlQueryFailure(hr, fFoundXml, "Failed to get @Uninstallable."); | 41 | ExitOnOptionalXmlQueryFailure(hr, fFoundXml, "Failed to get @Uninstallable."); |
42 | 42 | ||
43 | // @Bundle | ||
44 | hr = XmlGetYesNoAttribute(pixnExePackage, L"Bundle", &pPackage->Exe.fBundle); | ||
45 | ExitOnOptionalXmlQueryFailure(hr, fFoundXml, "Failed to get @Bundle."); | ||
46 | |||
43 | // @Protocol | 47 | // @Protocol |
44 | hr = XmlGetAttributeEx(pixnExePackage, L"Protocol", &scz); | 48 | hr = XmlGetAttributeEx(pixnExePackage, L"Protocol", &scz); |
45 | ExitOnOptionalXmlQueryFailure(hr, fFoundXml, "Failed to get @Protocol."); | 49 | ExitOnOptionalXmlQueryFailure(hr, fFoundXml, "Failed to get @Protocol."); |
@@ -87,6 +91,7 @@ extern "C" void ExeEnginePackageUninitialize( | |||
87 | ReleaseStr(pPackage->Exe.sczInstallArguments); | 91 | ReleaseStr(pPackage->Exe.sczInstallArguments); |
88 | ReleaseStr(pPackage->Exe.sczRepairArguments); | 92 | ReleaseStr(pPackage->Exe.sczRepairArguments); |
89 | ReleaseStr(pPackage->Exe.sczUninstallArguments); | 93 | ReleaseStr(pPackage->Exe.sczUninstallArguments); |
94 | ReleaseStr(pPackage->Exe.sczIgnoreDependencies); | ||
90 | ReleaseMem(pPackage->Exe.rgExitCodes); | 95 | ReleaseMem(pPackage->Exe.rgExitCodes); |
91 | 96 | ||
92 | // free command-line arguments | 97 | // free command-line arguments |
@@ -286,6 +291,24 @@ extern "C" HRESULT ExeEnginePlanAddPackage( | |||
286 | pAction->exePackage.pPackage = pPackage; | 291 | pAction->exePackage.pPackage = pPackage; |
287 | pAction->exePackage.action = pPackage->rollback; | 292 | pAction->exePackage.action = pPackage->rollback; |
288 | 293 | ||
294 | if (pPackage->Exe.sczIgnoreDependencies) | ||
295 | { | ||
296 | hr = StrAllocString(&pAction->exePackage.sczIgnoreDependencies, pPackage->Exe.sczIgnoreDependencies, 0); | ||
297 | ExitOnFailure(hr, "Failed to allocate the list of dependencies to ignore."); | ||
298 | } | ||
299 | |||
300 | if (pPackage->Exe.wzAncestors) | ||
301 | { | ||
302 | hr = StrAllocString(&pAction->exePackage.sczAncestors, pPackage->Exe.wzAncestors, 0); | ||
303 | ExitOnFailure(hr, "Failed to allocate the list of ancestors."); | ||
304 | } | ||
305 | |||
306 | if (pPackage->Exe.wzEngineWorkingDirectory) | ||
307 | { | ||
308 | hr = StrAllocString(&pAction->exePackage.sczEngineWorkingDirectory, pPackage->Exe.wzEngineWorkingDirectory, 0); | ||
309 | ExitOnFailure(hr, "Failed to allocate the custom working directory."); | ||
310 | } | ||
311 | |||
289 | LoggingSetPackageVariable(pPackage, NULL, TRUE, pLog, pVariables, NULL); // ignore errors. | 312 | LoggingSetPackageVariable(pPackage, NULL, TRUE, pLog, pVariables, NULL); // ignore errors. |
290 | 313 | ||
291 | hr = PlanExecuteCheckpoint(pPlan); | 314 | hr = PlanExecuteCheckpoint(pPlan); |
@@ -302,6 +325,24 @@ extern "C" HRESULT ExeEnginePlanAddPackage( | |||
302 | pAction->exePackage.pPackage = pPackage; | 325 | pAction->exePackage.pPackage = pPackage; |
303 | pAction->exePackage.action = pPackage->execute; | 326 | pAction->exePackage.action = pPackage->execute; |
304 | 327 | ||
328 | if (pPackage->Exe.sczIgnoreDependencies) | ||
329 | { | ||
330 | hr = StrAllocString(&pAction->exePackage.sczIgnoreDependencies, pPackage->Exe.sczIgnoreDependencies, 0); | ||
331 | ExitOnFailure(hr, "Failed to allocate the list of dependencies to ignore."); | ||
332 | } | ||
333 | |||
334 | if (pPackage->Exe.wzAncestors) | ||
335 | { | ||
336 | hr = StrAllocString(&pAction->exePackage.sczAncestors, pPackage->Exe.wzAncestors, 0); | ||
337 | ExitOnFailure(hr, "Failed to allocate the list of ancestors."); | ||
338 | } | ||
339 | |||
340 | if (pPackage->Exe.wzEngineWorkingDirectory) | ||
341 | { | ||
342 | hr = StrAllocString(&pAction->exePackage.sczEngineWorkingDirectory, pPackage->Exe.wzEngineWorkingDirectory, 0); | ||
343 | ExitOnFailure(hr, "Failed to allocate the custom working directory."); | ||
344 | } | ||
345 | |||
305 | LoggingSetPackageVariable(pPackage, NULL, FALSE, pLog, pVariables, NULL); // ignore errors. | 346 | LoggingSetPackageVariable(pPackage, NULL, FALSE, pLog, pVariables, NULL); // ignore errors. |
306 | } | 347 | } |
307 | 348 | ||
@@ -406,27 +447,53 @@ extern "C" HRESULT ExeEngineExecutePackage( | |||
406 | } | 447 | } |
407 | 448 | ||
408 | // build command | 449 | // build command |
409 | if (*sczArguments) | 450 | AppAppendCommandLineArgument(&sczCommand, sczExecutablePath); |
451 | ExitOnFailure(hr, "Failed to create executable command."); | ||
452 | |||
453 | if (pPackage->Exe.fBundle) | ||
454 | { | ||
455 | hr = StrAllocConcat(&sczCommand, L" -norestart", 0); | ||
456 | ExitOnFailure(hr, "Failed to append quiet argument."); | ||
457 | |||
458 | // Add the list of dependencies to ignore, if any, to the burn command line. | ||
459 | if (pExecuteAction->exePackage.sczIgnoreDependencies) | ||
460 | { | ||
461 | hr = StrAllocConcatFormatted(&sczCommand, L" -%ls=%ls", BURN_COMMANDLINE_SWITCH_IGNOREDEPENDENCIES, pExecuteAction->exePackage.sczIgnoreDependencies); | ||
462 | ExitOnFailure(hr, "Failed to append the list of dependencies to ignore to the command line."); | ||
463 | } | ||
464 | |||
465 | // Add the list of ancestors, if any, to the burn command line. | ||
466 | if (pExecuteAction->exePackage.sczAncestors) | ||
467 | { | ||
468 | hr = StrAllocConcatFormatted(&sczCommand, L" -%ls=%ls", sczCommand, BURN_COMMANDLINE_SWITCH_ANCESTORS, pExecuteAction->exePackage.sczAncestors); | ||
469 | ExitOnFailure(hr, "Failed to append the list of ancestors to the command line."); | ||
470 | } | ||
471 | |||
472 | if (pExecuteAction->exePackage.sczEngineWorkingDirectory) | ||
473 | { | ||
474 | hr = CoreAppendEngineWorkingDirectoryToCommandLine(pExecuteAction->exePackage.sczEngineWorkingDirectory, &sczCommand, NULL); | ||
475 | ExitOnFailure(hr, "Failed to append the custom working directory to the exepackage command line."); | ||
476 | } | ||
477 | |||
478 | hr = CoreAppendFileHandleSelfToCommandLine(sczExecutablePath, &hExecutableFile, &sczCommand, NULL); | ||
479 | ExitOnFailure(hr, "Failed to append %ls", BURN_COMMANDLINE_SWITCH_FILEHANDLE_SELF); | ||
480 | } | ||
481 | |||
482 | // Always add user supplied arguments last. | ||
483 | if (sczArguments && *sczArguments) | ||
410 | { | 484 | { |
411 | hr = VariableFormatString(pVariables, sczArguments, &sczArgumentsFormatted, NULL); | 485 | hr = VariableFormatString(pVariables, sczArguments, &sczArgumentsFormatted, NULL); |
412 | ExitOnFailure(hr, "Failed to format argument string."); | 486 | ExitOnFailure(hr, "Failed to format argument string."); |
413 | 487 | ||
414 | hr = StrAllocFormattedSecure(&sczCommand, L"\"%ls\" %ls", sczExecutablePath, sczArgumentsFormatted); | ||
415 | ExitOnFailure(hr, "Failed to create executable command."); | ||
416 | |||
417 | hr = VariableFormatStringObfuscated(pVariables, sczArguments, &sczArgumentsObfuscated, NULL); | 488 | hr = VariableFormatStringObfuscated(pVariables, sczArguments, &sczArgumentsObfuscated, NULL); |
418 | ExitOnFailure(hr, "Failed to format obfuscated argument string."); | 489 | ExitOnFailure(hr, "Failed to format obfuscated argument string."); |
419 | 490 | ||
420 | hr = StrAllocFormatted(&sczCommandObfuscated, L"\"%ls\" %ls", sczExecutablePath, sczArgumentsObfuscated); | 491 | hr = StrAllocFormatted(&sczCommandObfuscated, L"%ls %ls", sczCommand, sczArgumentsObfuscated); |
421 | } | 492 | ExitOnFailure(hr, "Failed to copy obfuscated formatted arguments."); |
422 | else | ||
423 | { | ||
424 | hr = StrAllocFormatted(&sczCommand, L"\"%ls\"", sczExecutablePath); | ||
425 | ExitOnFailure(hr, "Failed to create executable command."); | ||
426 | 493 | ||
427 | hr = StrAllocFormatted(&sczCommandObfuscated, L"\"%ls\"", sczExecutablePath); | 494 | hr = StrAllocConcatFormattedSecure(&sczCommand, L" %ls", sczArgumentsFormatted); |
495 | ExitOnFailure(hr, "Failed to copy formatted arguments."); | ||
428 | } | 496 | } |
429 | ExitOnFailure(hr, "Failed to create obfuscated executable command."); | ||
430 | 497 | ||
431 | // Log before we add the secret pipe name and client token for embedded processes. | 498 | // Log before we add the secret pipe name and client token for embedded processes. |
432 | LogId(REPORT_STANDARD, MSG_APPLYING_PACKAGE, LoggingRollbackOrExecute(fRollback), pPackage->sczId, LoggingActionStateToString(pExecuteAction->exePackage.action), sczExecutablePath, sczCommandObfuscated); | 499 | LogId(REPORT_STANDARD, MSG_APPLYING_PACKAGE, LoggingRollbackOrExecute(fRollback), pPackage->sczId, LoggingActionStateToString(pExecuteAction->exePackage.action), sczExecutablePath, sczCommandObfuscated); |
diff --git a/src/burn/engine/package.h b/src/burn/engine/package.h index e3e39c51..deab47b7 100644 --- a/src/burn/engine/package.h +++ b/src/burn/engine/package.h | |||
@@ -324,7 +324,11 @@ typedef struct _BURN_PACKAGE | |||
324 | LPWSTR sczInstallArguments; | 324 | LPWSTR sczInstallArguments; |
325 | LPWSTR sczRepairArguments; | 325 | LPWSTR sczRepairArguments; |
326 | LPWSTR sczUninstallArguments; | 326 | LPWSTR sczUninstallArguments; |
327 | LPWSTR sczIgnoreDependencies; | ||
328 | LPCWSTR wzAncestors; // points directly into engine state. | ||
329 | LPCWSTR wzEngineWorkingDirectory; // points directly into engine state. | ||
327 | 330 | ||
331 | BOOL fBundle; | ||
328 | BOOL fPseudoPackage; | 332 | BOOL fPseudoPackage; |
329 | BOOL fFireAndForget; | 333 | BOOL fFireAndForget; |
330 | BOOL fRepairable; | 334 | BOOL fRepairable; |
diff --git a/src/burn/engine/plan.cpp b/src/burn/engine/plan.cpp index 5e1d2654..cb50b0c9 100644 --- a/src/burn/engine/plan.cpp +++ b/src/burn/engine/plan.cpp | |||
@@ -291,6 +291,12 @@ extern "C" void PlanUninitializeExecuteAction( | |||
291 | ReleaseStr(pExecuteAction->relatedBundle.sczEngineWorkingDirectory); | 291 | ReleaseStr(pExecuteAction->relatedBundle.sczEngineWorkingDirectory); |
292 | break; | 292 | break; |
293 | 293 | ||
294 | case BURN_EXECUTE_ACTION_TYPE_EXE_PACKAGE: | ||
295 | ReleaseStr(pExecuteAction->exePackage.sczIgnoreDependencies); | ||
296 | ReleaseStr(pExecuteAction->exePackage.sczAncestors); | ||
297 | ReleaseStr(pExecuteAction->exePackage.sczEngineWorkingDirectory); | ||
298 | break; | ||
299 | |||
294 | case BURN_EXECUTE_ACTION_TYPE_MSI_PACKAGE: | 300 | case BURN_EXECUTE_ACTION_TYPE_MSI_PACKAGE: |
295 | ReleaseStr(pExecuteAction->msiPackage.sczLogPath); | 301 | ReleaseStr(pExecuteAction->msiPackage.sczLogPath); |
296 | ReleaseMem(pExecuteAction->msiPackage.rgFeatures); | 302 | ReleaseMem(pExecuteAction->msiPackage.rgFeatures); |
@@ -1495,26 +1501,21 @@ extern "C" HRESULT PlanRelatedBundlesComplete( | |||
1495 | for (DWORD i = 0; i < pPlan->cExecuteActions; ++i) | 1501 | for (DWORD i = 0; i < pPlan->cExecuteActions; ++i) |
1496 | { | 1502 | { |
1497 | BOOTSTRAPPER_ACTION_STATE packageAction = BOOTSTRAPPER_ACTION_STATE_NONE; | 1503 | BOOTSTRAPPER_ACTION_STATE packageAction = BOOTSTRAPPER_ACTION_STATE_NONE; |
1504 | BURN_PACKAGE* pPackage = &pPlan->rgExecuteActions[i].relatedBundle.pRelatedBundle->package; | ||
1505 | BOOL fBundle = FALSE; | ||
1498 | 1506 | ||
1499 | switch (pPlan->rgExecuteActions[i].type) | 1507 | switch (pPlan->rgExecuteActions[i].type) |
1500 | { | 1508 | { |
1501 | case BURN_EXECUTE_ACTION_TYPE_RELATED_BUNDLE: | 1509 | case BURN_EXECUTE_ACTION_TYPE_RELATED_BUNDLE: |
1502 | packageAction = pPlan->rgExecuteActions[i].relatedBundle.action; | 1510 | packageAction = pPlan->rgExecuteActions[i].relatedBundle.action; |
1503 | 1511 | pPackage = &pPlan->rgExecuteActions[i].relatedBundle.pRelatedBundle->package; | |
1504 | if (BOOTSTRAPPER_ACTION_STATE_NONE != packageAction) | 1512 | fBundle = TRUE; |
1505 | { | ||
1506 | BURN_PACKAGE* pPackage = &pPlan->rgExecuteActions[i].relatedBundle.pRelatedBundle->package; | ||
1507 | if (pPackage->cDependencyProviders) | ||
1508 | { | ||
1509 | // Bundles only support a single provider key. | ||
1510 | const BURN_DEPENDENCY_PROVIDER* pProvider = pPackage->rgDependencyProviders; | ||
1511 | DictAddKey(sdProviderKeys, pProvider->sczKey); | ||
1512 | } | ||
1513 | } | ||
1514 | break; | 1513 | break; |
1515 | 1514 | ||
1516 | case BURN_EXECUTE_ACTION_TYPE_EXE_PACKAGE: | 1515 | case BURN_EXECUTE_ACTION_TYPE_EXE_PACKAGE: |
1517 | packageAction = pPlan->rgExecuteActions[i].exePackage.action; | 1516 | packageAction = pPlan->rgExecuteActions[i].exePackage.action; |
1517 | pPackage = pPlan->rgExecuteActions[i].exePackage.pPackage; | ||
1518 | fBundle = TRUE; | ||
1518 | break; | 1519 | break; |
1519 | 1520 | ||
1520 | case BURN_EXECUTE_ACTION_TYPE_MSI_PACKAGE: | 1521 | case BURN_EXECUTE_ACTION_TYPE_MSI_PACKAGE: |
@@ -1530,6 +1531,16 @@ extern "C" HRESULT PlanRelatedBundlesComplete( | |||
1530 | break; | 1531 | break; |
1531 | } | 1532 | } |
1532 | 1533 | ||
1534 | if (fBundle && BOOTSTRAPPER_ACTION_STATE_NONE != packageAction) | ||
1535 | { | ||
1536 | if (pPackage->cDependencyProviders) | ||
1537 | { | ||
1538 | // Bundles only support a single provider key. | ||
1539 | const BURN_DEPENDENCY_PROVIDER* pProvider = pPackage->rgDependencyProviders; | ||
1540 | DictAddKey(sdProviderKeys, pProvider->sczKey); | ||
1541 | } | ||
1542 | } | ||
1543 | |||
1533 | fExecutingAnyPackage |= BOOTSTRAPPER_ACTION_STATE_NONE != packageAction; | 1544 | fExecutingAnyPackage |= BOOTSTRAPPER_ACTION_STATE_NONE != packageAction; |
1534 | fInstallingAnyPackage |= BOOTSTRAPPER_ACTION_STATE_INSTALL == packageAction || BOOTSTRAPPER_ACTION_STATE_MINOR_UPGRADE == packageAction; | 1545 | fInstallingAnyPackage |= BOOTSTRAPPER_ACTION_STATE_INSTALL == packageAction || BOOTSTRAPPER_ACTION_STATE_MINOR_UPGRADE == packageAction; |
1535 | } | 1546 | } |
diff --git a/src/burn/engine/plan.h b/src/burn/engine/plan.h index 834d2567..6e9a1ff5 100644 --- a/src/burn/engine/plan.h +++ b/src/burn/engine/plan.h | |||
@@ -164,6 +164,9 @@ typedef struct _BURN_EXECUTE_ACTION | |||
164 | { | 164 | { |
165 | BURN_PACKAGE* pPackage; | 165 | BURN_PACKAGE* pPackage; |
166 | BOOTSTRAPPER_ACTION_STATE action; | 166 | BOOTSTRAPPER_ACTION_STATE action; |
167 | LPWSTR sczIgnoreDependencies; | ||
168 | LPWSTR sczAncestors; | ||
169 | LPWSTR sczEngineWorkingDirectory; | ||
167 | } exePackage; | 170 | } exePackage; |
168 | struct | 171 | struct |
169 | { | 172 | { |
diff --git a/src/burn/test/BurnUnitTest/PlanTest.cpp b/src/burn/test/BurnUnitTest/PlanTest.cpp index 2febe277..143ca7d7 100644 --- a/src/burn/test/BurnUnitTest/PlanTest.cpp +++ b/src/burn/test/BurnUnitTest/PlanTest.cpp | |||
@@ -716,7 +716,7 @@ namespace Bootstrapper | |||
716 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 716 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
717 | ValidateExecuteWaitCachePackage(pPlan, fRollback, dwIndex++, L"ExeA"); | 717 | ValidateExecuteWaitCachePackage(pPlan, fRollback, dwIndex++, L"ExeA"); |
718 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 718 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
719 | ValidateExecuteExePackage(pPlan, fRollback, dwIndex++, L"ExeA", BOOTSTRAPPER_ACTION_STATE_INSTALL); | 719 | ValidateExecuteExePackage(pPlan, fRollback, dwIndex++, L"ExeA", BOOTSTRAPPER_ACTION_STATE_INSTALL, NULL); |
720 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 720 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
721 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 721 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
722 | ValidateExecuteRollbackBoundaryEnd(pPlan, fRollback, dwIndex++); | 722 | ValidateExecuteRollbackBoundaryEnd(pPlan, fRollback, dwIndex++); |
@@ -727,7 +727,7 @@ namespace Bootstrapper | |||
727 | dwExecuteCheckpointId = 2; | 727 | dwExecuteCheckpointId = 2; |
728 | ValidateExecuteRollbackBoundaryStart(pPlan, fRollback, dwIndex++, L"WixDefaultBoundary", TRUE, FALSE); | 728 | ValidateExecuteRollbackBoundaryStart(pPlan, fRollback, dwIndex++, L"WixDefaultBoundary", TRUE, FALSE); |
729 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 729 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
730 | ValidateExecuteExePackage(pPlan, fRollback, dwIndex++, L"ExeA", BOOTSTRAPPER_ACTION_STATE_UNINSTALL); | 730 | ValidateExecuteExePackage(pPlan, fRollback, dwIndex++, L"ExeA", BOOTSTRAPPER_ACTION_STATE_UNINSTALL, NULL); |
731 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 731 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
732 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 732 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
733 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 733 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
@@ -2125,7 +2125,7 @@ namespace Bootstrapper | |||
2125 | ValidateExecuteRollbackBoundaryStart(pPlan, fRollback, dwIndex++, L"WixDefaultBoundary", TRUE, FALSE); | 2125 | ValidateExecuteRollbackBoundaryStart(pPlan, fRollback, dwIndex++, L"WixDefaultBoundary", TRUE, FALSE); |
2126 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 2126 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
2127 | ValidateExecuteWaitCachePackage(pPlan, fRollback, dwIndex++, L"NetFx48Web"); | 2127 | ValidateExecuteWaitCachePackage(pPlan, fRollback, dwIndex++, L"NetFx48Web"); |
2128 | ValidateExecuteExePackage(pPlan, fRollback, dwIndex++, L"NetFx48Web", BOOTSTRAPPER_ACTION_STATE_INSTALL); | 2128 | ValidateExecuteExePackage(pPlan, fRollback, dwIndex++, L"NetFx48Web", BOOTSTRAPPER_ACTION_STATE_INSTALL, NULL); |
2129 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 2129 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
2130 | dwExecuteCheckpointId += 1; // cache checkpoints | 2130 | dwExecuteCheckpointId += 1; // cache checkpoints |
2131 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 2131 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
@@ -2683,13 +2683,15 @@ namespace Bootstrapper | |||
2683 | __in BOOL fRollback, | 2683 | __in BOOL fRollback, |
2684 | __in DWORD dwIndex, | 2684 | __in DWORD dwIndex, |
2685 | __in LPCWSTR wzPackageId, | 2685 | __in LPCWSTR wzPackageId, |
2686 | __in BOOTSTRAPPER_ACTION_STATE action | 2686 | __in BOOTSTRAPPER_ACTION_STATE action, |
2687 | __in LPCWSTR wzIgnoreDependencies | ||
2687 | ) | 2688 | ) |
2688 | { | 2689 | { |
2689 | BURN_EXECUTE_ACTION* pAction = ValidateExecuteActionExists(pPlan, fRollback, dwIndex); | 2690 | BURN_EXECUTE_ACTION* pAction = ValidateExecuteActionExists(pPlan, fRollback, dwIndex); |
2690 | Assert::Equal<DWORD>(BURN_EXECUTE_ACTION_TYPE_EXE_PACKAGE, pAction->type); | 2691 | Assert::Equal<DWORD>(BURN_EXECUTE_ACTION_TYPE_EXE_PACKAGE, pAction->type); |
2691 | NativeAssert::StringEqual(wzPackageId, pAction->exePackage.pPackage->sczId); | 2692 | NativeAssert::StringEqual(wzPackageId, pAction->exePackage.pPackage->sczId); |
2692 | Assert::Equal<DWORD>(action, pAction->exePackage.action); | 2693 | Assert::Equal<DWORD>(action, pAction->exePackage.action); |
2694 | NativeAssert::StringEqual(wzIgnoreDependencies, pAction->exePackage.sczIgnoreDependencies); | ||
2693 | Assert::Equal<BOOL>(FALSE, pAction->fDeleted); | 2695 | Assert::Equal<BOOL>(FALSE, pAction->fDeleted); |
2694 | } | 2696 | } |
2695 | 2697 | ||