Plan each dependency provider dependent individually.
Refactoring for #6510
Sean Hall committed
Jan 31, 2022 at 16:23 UTC
c95c41151d595f4630c4c2f4aeb4c7f9a97af5c7
9 files changed
+195
-109
src/burn/engine/apply.cpp
+14
-8
@@ -258,7 +258,8 @@ static HRESULT ExecutePackageProviderAction(
258
static HRESULT ExecuteDependencyAction(
259
__in BURN_ENGINE_STATE* pEngineState,
260
__in BURN_EXECUTE_ACTION* pAction,
261
- __in BURN_EXECUTE_CONTEXT* pContext
261
+ __in BURN_EXECUTE_CONTEXT* pContext,
262
+ __in BOOL fRollback
263
);
264
static HRESULT ExecuteMsiBeginTransaction(
265
__in BURN_ENGINE_STATE* pEngineState,
@@ -2357,7 +2358,7 @@ static HRESULT DoExecuteAction(
2358
break;
2359
2360
case BURN_EXECUTE_ACTION_TYPE_PACKAGE_DEPENDENCY:
2360
- hr = ExecuteDependencyAction(pEngineState, pExecuteAction, pContext);
2361
+ hr = ExecuteDependencyAction(pEngineState, pExecuteAction, pContext, FALSE);
2362
ExitOnFailure(hr, "Failed to execute dependency action.");
2363
break;
2364
@@ -2480,7 +2481,7 @@ static HRESULT DoRollbackActions(
2481
break;
2482
2483
case BURN_EXECUTE_ACTION_TYPE_PACKAGE_DEPENDENCY:
2483
- hr = ExecuteDependencyAction(pEngineState, pRollbackAction, pContext);
2484
+ hr = ExecuteDependencyAction(pEngineState, pRollbackAction, pContext, TRUE);
2485
IgnoreRollbackError(hr, "Failed to rollback dependency action.");
2486
break;
2487
@@ -2915,26 +2916,31 @@ LExit:
2916
static HRESULT ExecuteDependencyAction(
2917
__in BURN_ENGINE_STATE* pEngineState,
2918
__in BURN_EXECUTE_ACTION* pAction,
2918
- __in BURN_EXECUTE_CONTEXT* /*pContext*/
2919
+ __in BURN_EXECUTE_CONTEXT* pContext,
2920
+ __in BOOL fRollback
2921
)
2922
{
2923
HRESULT hr = S_OK;
2924
BURN_PACKAGE* pPackage = pAction->packageDependency.pPackage;
2925
2926
+ Assert(pContext->fRollback == fRollback);
2927
+ UNREFERENCED_PARAMETER(pContext);
2928
+
2929
if (pPackage->fPerMachine)
2930
{
2926
- hr = ElevationExecutePackageDependencyAction(pEngineState->companionConnection.hPipe, pAction);
2931
+ hr = ElevationExecutePackageDependencyAction(pEngineState->companionConnection.hPipe, pAction, fRollback);
2932
ExitOnFailure(hr, "Failed to register the dependency on per-machine package.");
2933
}
2934
else
2935
{
2931
- hr = DependencyExecutePackageDependencyAction(FALSE, pAction);
2936
+ hr = DependencyExecutePackageDependencyAction(FALSE, pAction, fRollback);
2937
ExitOnFailure(hr, "Failed to register the dependency on per-user package.");
2938
}
2939
2940
if (pPackage->fCanAffectRegistration)
2941
{
2937
- if (BURN_DEPENDENCY_ACTION_REGISTER == pAction->packageDependency.action)
2942
+ BURN_DEPENDENCY_ACTION dependencyAction = fRollback ? pPackage->dependencyRollback : pPackage->dependencyExecute;
2943
+ if (BURN_DEPENDENCY_ACTION_REGISTER == dependencyAction)
2944
{
2945
if (BURN_PACKAGE_REGISTRATION_STATE_IGNORED == pPackage->cacheRegistrationState)
2946
{
@@ -2958,7 +2964,7 @@ static HRESULT ExecuteDependencyAction(
2964
pPackage->installRegistrationState = BURN_PACKAGE_REGISTRATION_STATE_PRESENT;
2965
}
2966
}
2961
- else if (BURN_DEPENDENCY_ACTION_UNREGISTER == pAction->packageDependency.action)
2967
+ else if (BURN_DEPENDENCY_ACTION_UNREGISTER == dependencyAction)
2968
{
2969
if (BURN_PACKAGE_REGISTRATION_STATE_PRESENT == pPackage->cacheRegistrationState)
2970
{
src/burn/engine/dependency.cpp
+97
-53
@@ -72,9 +72,11 @@ static void UnregisterPackageProvider(
72
__in HKEY hkRoot
73
);
74
75
-static HRESULT RegisterPackageDependency(
76
- __in BOOL fPerMachine,
77
- __in const BURN_PACKAGE* pPackage,
75
+static HRESULT RegisterPackageProviderDependent(
76
+ __in const BURN_DEPENDENCY_PROVIDER* pProvider,
77
+ __in BOOL fVital,
78
+ __in HKEY hkRoot,
79
+ __in LPCWSTR wzPackageId,
80
__in_z LPCWSTR wzDependentProviderKey
81
);
82
@@ -83,6 +85,13 @@ static void UnregisterPackageDependency(
85
__in const BURN_PACKAGE* pPackage,
86
__in_z LPCWSTR wzDependentProviderKey
87
);
88
+
89
+static void UnregisterPackageProviderDependent(
90
+ __in const BURN_DEPENDENCY_PROVIDER* pProvider,
91
+ __in HKEY hkRoot,
92
+ __in LPCWSTR wzPackageId,
93
+ __in_z LPCWSTR wzDependentProviderKey
94
+ );
95
static void UnregisterOrphanPackageProviders(
96
__in const BURN_PACKAGE* pPackage
97
);
@@ -551,8 +560,24 @@ extern "C" HRESULT DependencyPlanPackageBegin(
560
}
561
}
562
554
- pPackage->dependencyExecute = dependencyExecuteAction;
555
- pPackage->dependencyRollback = dependencyRollbackAction;
563
+ for (DWORD i = 0; i < pPackage->cDependencyProviders; ++i)
564
+ {
565
+ BURN_DEPENDENCY_PROVIDER* pProvider = &pPackage->rgDependencyProviders[i];
566
+
567
+ pProvider->dependentExecute = dependencyExecuteAction;
568
+ pProvider->dependentRollback = dependencyRollbackAction;
569
+
570
+ // The highest aggregate action state found will be returned.
571
+ if (pPackage->dependencyExecute < pProvider->dependentExecute)
572
+ {
573
+ pPackage->dependencyExecute = pProvider->dependentExecute;
574
+ }
575
+
576
+ if (pPackage->dependencyRollback < pProvider->dependentRollback)
577
+ {
578
+ pPackage->dependencyRollback = pProvider->dependentRollback;
579
+ }
580
+ }
581
582
LExit:
583
ReleaseDict(sdIgnoredDependents);
@@ -690,23 +715,43 @@ extern "C" HRESULT DependencyExecutePackageProviderAction(
715
716
extern "C" HRESULT DependencyExecutePackageDependencyAction(
717
__in BOOL fPerMachine,
693
- __in const BURN_EXECUTE_ACTION* pAction
718
+ __in const BURN_EXECUTE_ACTION* pAction,
719
+ __in BOOL fRollback
720
)
721
{
722
AssertSz(BURN_EXECUTE_ACTION_TYPE_PACKAGE_DEPENDENCY == pAction->type, "Execute action type not supported by this function.");
723
724
HRESULT hr = S_OK;
725
const BURN_PACKAGE* pPackage = pAction->packageDependency.pPackage;
726
+ HKEY hkRoot = pPackage->fPerMachine ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
727
701
- // Register or unregister the bundle as a dependent of each package dependency provider.
702
- if (BURN_DEPENDENCY_ACTION_REGISTER == pAction->packageDependency.action)
728
+ // Do not register a dependency on a package in a different install context.
729
+ if (fPerMachine != pPackage->fPerMachine)
730
{
704
- hr = RegisterPackageDependency(fPerMachine, pPackage, pAction->packageDependency.sczBundleProviderKey);
705
- ExitOnFailure(hr, "Failed to register the dependency on the package provider.");
731
+ LogId(REPORT_STANDARD, MSG_DEPENDENCY_PACKAGE_SKIP_WRONGSCOPE, pPackage->sczId, LoggingPerMachineToString(fPerMachine), LoggingPerMachineToString(pPackage->fPerMachine));
732
+ ExitFunction1(hr = S_OK);
733
}
707
- else if (BURN_DEPENDENCY_ACTION_UNREGISTER == pAction->packageDependency.action)
734
+
735
+ for (DWORD i = 0; i < pPackage->cDependencyProviders; ++i)
736
{
709
- UnregisterPackageDependency(fPerMachine, pPackage, pAction->packageDependency.sczBundleProviderKey);
737
+ const BURN_DEPENDENCY_PROVIDER* pProvider = pPackage->rgDependencyProviders + i;
738
+ BURN_DEPENDENCY_ACTION action = fRollback ? pProvider->dependentRollback : pProvider->dependentExecute;
739
+ HRESULT hrProvider = S_OK;
740
+
741
+ // Register or unregister the bundle as a dependent of the package dependency provider.
742
+ switch (action)
743
+ {
744
+ case BURN_DEPENDENCY_ACTION_REGISTER:
745
+ hrProvider = RegisterPackageProviderDependent(pProvider, pPackage->fVital, hkRoot, pPackage->sczId, pAction->packageDependency.sczBundleProviderKey);
746
+ if (SUCCEEDED(hr) && FAILED(hrProvider))
747
+ {
748
+ hr = hrProvider;
749
+ }
750
+ break;
751
+ case BURN_DEPENDENCY_ACTION_UNREGISTER:
752
+ UnregisterPackageProviderDependent(pProvider, hkRoot, pPackage->sczId, pAction->packageDependency.sczBundleProviderKey);
753
+ break;
754
+ }
755
}
756
757
LExit:
@@ -1262,7 +1307,6 @@ static HRESULT AddPackageDependencyActions(
1307
1308
pAction->type = BURN_EXECUTE_ACTION_TYPE_PACKAGE_DEPENDENCY;
1309
pAction->packageDependency.pPackage = const_cast<BURN_PACKAGE*>(pPackage);
1265
- pAction->packageDependency.action = dependencyRollbackAction;
1310
1311
hr = StrAllocString(&pAction->packageDependency.sczBundleProviderKey, pPlan->wzBundleProviderKey, 0);
1312
ExitOnFailure(hr, "Failed to copy the bundle dependency provider.");
@@ -1294,7 +1338,6 @@ static HRESULT AddPackageDependencyActions(
1338
1339
pAction->type = BURN_EXECUTE_ACTION_TYPE_PACKAGE_DEPENDENCY;
1340
pAction->packageDependency.pPackage = const_cast<BURN_PACKAGE*>(pPackage);
1297
- pAction->packageDependency.action = dependencyExecuteAction;
1341
1342
hr = StrAllocString(&pAction->packageDependency.sczBundleProviderKey, pPlan->wzBundleProviderKey, 0);
1343
ExitOnFailure(hr, "Failed to copy the bundle dependency provider.");
@@ -1378,48 +1421,38 @@ static void UnregisterPackageProvider(
1421
}
1422
1423
/********************************************************************
1381
- RegisterPackageDependency - Registers the provider key
1382
- as a dependent of a package.
1424
+ RegisterPackageProviderDependent - Registers the provider key
1425
+ as a dependent of a package provider.
1426
1427
*********************************************************************/
1385
-static HRESULT RegisterPackageDependency(
1386
- __in BOOL fPerMachine,
1387
- __in const BURN_PACKAGE* pPackage,
1428
+static HRESULT RegisterPackageProviderDependent(
1429
+ __in const BURN_DEPENDENCY_PROVIDER* pProvider,
1430
+ __in BOOL fVital,
1431
+ __in HKEY hkRoot,
1432
+ __in LPCWSTR wzPackageId,
1433
__in_z LPCWSTR wzDependentProviderKey
1434
)
1435
{
1436
HRESULT hr = S_OK;
1392
- HKEY hkRoot = fPerMachine ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
1437
1394
- // Do not register a dependency on a package in a different install context.
1395
- if (fPerMachine != pPackage->fPerMachine)
1438
+ LogId(REPORT_VERBOSE, MSG_DEPENDENCY_PACKAGE_REGISTER_DEPENDENCY, wzDependentProviderKey, pProvider->sczKey, wzPackageId);
1439
+
1440
+ hr = DepRegisterDependent(hkRoot, pProvider->sczKey, wzDependentProviderKey, NULL, NULL, 0);
1441
+ if (E_FILENOTFOUND != hr)
1442
{
1397
- LogId(REPORT_STANDARD, MSG_DEPENDENCY_PACKAGE_SKIP_WRONGSCOPE, pPackage->sczId, LoggingPerMachineToString(fPerMachine), LoggingPerMachineToString(pPackage->fPerMachine));
1398
- ExitFunction1(hr = S_OK);
1443
+ ExitOnFailure(hr, "Failed to register the dependency on package dependency provider: %ls", pProvider->sczKey);
1444
}
1400
-
1401
- if (pPackage->rgDependencyProviders)
1445
+ else
1446
{
1403
- for (DWORD i = 0; i < pPackage->cDependencyProviders; ++i)
1404
- {
1405
- const BURN_DEPENDENCY_PROVIDER* pProvider = &pPackage->rgDependencyProviders[i];
1406
-
1407
- LogId(REPORT_VERBOSE, MSG_DEPENDENCY_PACKAGE_REGISTER_DEPENDENCY, wzDependentProviderKey, pProvider->sczKey, pPackage->sczId);
1408
-
1409
- hr = DepRegisterDependent(hkRoot, pProvider->sczKey, wzDependentProviderKey, NULL, NULL, 0);
1410
- if (E_FILENOTFOUND != hr || pPackage->fVital)
1411
- {
1412
- ExitOnFailure(hr, "Failed to register the dependency on package dependency provider: %ls", pProvider->sczKey);
1413
- }
1414
- else
1415
- {
1416
- LogId(REPORT_VERBOSE, MSG_DEPENDENCY_PACKAGE_SKIP_MISSING, pProvider->sczKey, pPackage->sczId);
1417
- hr = S_OK;
1418
- }
1419
- }
1447
+ LogId(REPORT_VERBOSE, MSG_DEPENDENCY_PACKAGE_SKIP_MISSING, pProvider->sczKey, wzPackageId);
1448
}
1449
1450
LExit:
1451
+ if (!fVital)
1452
+ {
1453
+ hr = S_OK;
1454
+ }
1455
+
1456
return hr;
1457
}
1458
@@ -1434,7 +1467,6 @@ static void UnregisterPackageDependency(
1467
__in_z LPCWSTR wzDependentProviderKey
1468
)
1469
{
1437
- HRESULT hr = S_OK;
1470
HKEY hkRoot = fPerMachine ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
1471
1472
// Should be no registration to remove since we don't write keys across contexts.
@@ -1451,19 +1483,31 @@ static void UnregisterPackageDependency(
1483
{
1484
const BURN_DEPENDENCY_PROVIDER* pProvider = &pPackage->rgDependencyProviders[i];
1485
1454
- hr = DepUnregisterDependent(hkRoot, pProvider->sczKey, wzDependentProviderKey);
1455
- if (SUCCEEDED(hr))
1456
- {
1457
- LogId(REPORT_VERBOSE, MSG_DEPENDENCY_PACKAGE_UNREGISTERED_DEPENDENCY, wzDependentProviderKey, pProvider->sczKey, pPackage->sczId);
1458
- }
1459
- else if (FAILED(hr) && E_FILENOTFOUND != hr)
1460
- {
1461
- LogId(REPORT_VERBOSE, MSG_DEPENDENCY_PACKAGE_UNREGISTERED_DEPENDENCY_FAILED, wzDependentProviderKey, pProvider->sczKey, pPackage->sczId, hr);
1462
- }
1486
+ UnregisterPackageProviderDependent(pProvider, hkRoot, pPackage->sczId, wzDependentProviderKey);
1487
}
1488
}
1489
}
1490
1491
+static void UnregisterPackageProviderDependent(
1492
+ __in const BURN_DEPENDENCY_PROVIDER* pProvider,
1493
+ __in HKEY hkRoot,
1494
+ __in LPCWSTR wzPackageId,
1495
+ __in_z LPCWSTR wzDependentProviderKey
1496
+ )
1497
+{
1498
+ HRESULT hr = S_OK;
1499
+
1500
+ hr = DepUnregisterDependent(hkRoot, pProvider->sczKey, wzDependentProviderKey);
1501
+ if (SUCCEEDED(hr))
1502
+ {
1503
+ LogId(REPORT_VERBOSE, MSG_DEPENDENCY_PACKAGE_UNREGISTERED_DEPENDENCY, wzDependentProviderKey, pProvider->sczKey, wzPackageId);
1504
+ }
1505
+ else if (FAILED(hr) && E_FILENOTFOUND != hr)
1506
+ {
1507
+ LogId(REPORT_VERBOSE, MSG_DEPENDENCY_PACKAGE_UNREGISTERED_DEPENDENCY_FAILED, wzDependentProviderKey, pProvider->sczKey, wzPackageId, hr);
1508
+ }
1509
+}
1510
+
1511
static void UnregisterOrphanPackageProviders(
1512
__in const BURN_PACKAGE* pPackage
1513
)
src/burn/engine/dependency.h
+2
-1
@@ -161,7 +161,8 @@ HRESULT DependencyExecutePackageProviderAction(
161
*********************************************************************/
162
HRESULT DependencyExecutePackageDependencyAction(
163
__in BOOL fPerMachine,
164
- __in const BURN_EXECUTE_ACTION* pAction
164
+ __in const BURN_EXECUTE_ACTION* pAction,
165
+ __in BOOL fRollback
166
);
167
168
/********************************************************************
src/burn/engine/elevation.cpp
+30
-10
@@ -1346,7 +1346,8 @@ LExit:
1346
1347
extern "C" HRESULT ElevationExecutePackageDependencyAction(
1348
__in HANDLE hPipe,
1349
- __in BURN_EXECUTE_ACTION* pExecuteAction
1349
+ __in BURN_EXECUTE_ACTION* pExecuteAction,
1350
+ __in BOOL fRollback
1351
)
1352
{
1353
HRESULT hr = S_OK;
@@ -1359,11 +1360,20 @@ extern "C" HRESULT ElevationExecutePackageDependencyAction(
1360
hr = BuffWriteString(&pbData, &cbData, pExecuteAction->packageDependency.pPackage->sczId);
1361
ExitOnFailure(hr, "Failed to write package id to message buffer.");
1362
1363
+ hr = BuffWriteNumber(&pbData, &cbData, (DWORD)fRollback);
1364
+ ExitOnFailure(hr, "Failed to write rollback flag to message buffer.");
1365
+
1366
hr = BuffWriteString(&pbData, &cbData, pExecuteAction->packageDependency.sczBundleProviderKey);
1367
ExitOnFailure(hr, "Failed to write bundle dependency key to message buffer.");
1368
1365
- hr = BuffWriteNumber(&pbData, &cbData, pExecuteAction->packageDependency.action);
1366
- ExitOnFailure(hr, "Failed to write action to message buffer.");
1369
+ // Dependent actions.
1370
+ for (DWORD i = 0; i < pExecuteAction->packageProvider.pPackage->cDependencyProviders; ++i)
1371
+ {
1372
+ BURN_DEPENDENCY_PROVIDER* pProvider = pExecuteAction->packageProvider.pPackage->rgDependencyProviders + i;
1373
+ BURN_DEPENDENCY_ACTION* pAction = fRollback ? &pProvider->dependentRollback : &pProvider->dependentExecute;
1374
+ hr = BuffWriteNumber(&pbData, &cbData, (DWORD)*pAction);
1375
+ ExitOnFailure(hr, "Failed to write dependent action to message buffer.");
1376
+ }
1377
1378
// Send the message.
1379
hr = PipeSendMessage(hPipe, BURN_ELEVATION_MESSAGE_TYPE_EXECUTE_PACKAGE_DEPENDENCY, pbData, cbData, NULL, NULL, &dwResult);
@@ -3260,6 +3270,7 @@ static HRESULT OnExecutePackageDependencyAction(
3270
HRESULT hr = S_OK;
3271
SIZE_T iData = 0;
3272
LPWSTR sczPackage = NULL;
3273
+ BOOL fRollback = FALSE;
3274
BURN_EXECUTE_ACTION executeAction = { };
3275
3276
executeAction.type = BURN_EXECUTE_ACTION_TYPE_PACKAGE_DEPENDENCY;
@@ -3268,12 +3279,6 @@ static HRESULT OnExecutePackageDependencyAction(
3279
hr = BuffReadString(pbData, cbData, &iData, &sczPackage);
3280
ExitOnFailure(hr, "Failed to read package id from message buffer.");
3281
3271
- hr = BuffReadString(pbData, cbData, &iData, &executeAction.packageDependency.sczBundleProviderKey);
3272
- ExitOnFailure(hr, "Failed to read bundle dependency key from message buffer.");
3273
-
3274
- hr = BuffReadNumber(pbData, cbData, &iData, reinterpret_cast<DWORD*>(&executeAction.packageDependency.action));
3275
- ExitOnFailure(hr, "Failed to read action.");
3276
-
3282
// Find the package again.
3283
hr = PackageFindById(pPackages, sczPackage, &executeAction.packageDependency.pPackage);
3284
if (E_NOTFOUND == hr)
@@ -3282,8 +3287,23 @@ static HRESULT OnExecutePackageDependencyAction(
3287
}
3288
ExitOnFailure(hr, "Failed to find package: %ls", sczPackage);
3289
3290
+ hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&fRollback);
3291
+ ExitOnFailure(hr, "Failed to read rollback flag.");
3292
+
3293
+ hr = BuffReadString(pbData, cbData, &iData, &executeAction.packageDependency.sczBundleProviderKey);
3294
+ ExitOnFailure(hr, "Failed to read bundle dependency key from message buffer.");
3295
+
3296
+ // Read dependent actions.
3297
+ for (DWORD i = 0; i < executeAction.packageProvider.pPackage->cDependencyProviders; ++i)
3298
+ {
3299
+ BURN_DEPENDENCY_PROVIDER* pProvider = executeAction.packageProvider.pPackage->rgDependencyProviders + i;
3300
+ BURN_DEPENDENCY_ACTION* pAction = fRollback ? &pProvider->dependentRollback : &pProvider->dependentExecute;
3301
+ hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)pAction);
3302
+ ExitOnFailure(hr, "Failed to read dependent action.");
3303
+ }
3304
+
3305
// Execute the package dependency action.
3286
- hr = DependencyExecutePackageDependencyAction(TRUE, &executeAction);
3306
+ hr = DependencyExecutePackageDependencyAction(TRUE, &executeAction, fRollback);
3307
ExitOnFailure(hr, "Failed to execute package dependency action.");
3308
3309
LExit:
src/burn/engine/elevation.h
+2
-1
@@ -144,7 +144,8 @@ HRESULT ElevationExecutePackageProviderAction(
144
);
145
HRESULT ElevationExecutePackageDependencyAction(
146
__in HANDLE hPipe,
147
- __in BURN_EXECUTE_ACTION* pExecuteAction
147
+ __in BURN_EXECUTE_ACTION* pExecuteAction,
148
+ __in BOOL fRollback
149
);
150
HRESULT ElevationCleanCompatiblePackage(
151
__in HANDLE hPipe,
src/burn/engine/package.h
+3
-1
@@ -45,8 +45,8 @@ enum BURN_PACKAGE_TYPE
45
enum BURN_DEPENDENCY_ACTION
46
{
47
BURN_DEPENDENCY_ACTION_NONE,
48
- BURN_DEPENDENCY_ACTION_REGISTER,
48
BURN_DEPENDENCY_ACTION_UNREGISTER,
49
+ BURN_DEPENDENCY_ACTION_REGISTER,
50
};
51
52
enum BURN_PATCH_TARGETCODE_TYPE
@@ -196,6 +196,8 @@ typedef struct _BURN_DEPENDENCY_PROVIDER
196
DEPENDENCY* rgDependents; // only valid after Detect.
197
UINT cDependents; // only valid after Detect.
198
199
+ BURN_DEPENDENCY_ACTION dependentExecute; // only valid during Plan.
200
+ BURN_DEPENDENCY_ACTION dependentRollback; // only valid during Plan.
201
BURN_DEPENDENCY_ACTION providerExecute; // only valid during Plan.
202
BURN_DEPENDENCY_ACTION providerRollback; // only valid during Plan.
203
} BURN_DEPENDENCY_PROVIDER;
src/burn/engine/plan.cpp
+8
-1
@@ -1973,6 +1973,8 @@ static void ResetPlannedPackageState(
1973
{
1974
BURN_DEPENDENCY_PROVIDER* pProvider = &pPackage->rgDependencyProviders[i];
1975
1976
+ pProvider->dependentExecute = BURN_DEPENDENCY_ACTION_NONE;
1977
+ pProvider->dependentRollback = BURN_DEPENDENCY_ACTION_NONE;
1978
pProvider->providerExecute = BURN_DEPENDENCY_ACTION_NONE;
1979
pProvider->providerRollback = BURN_DEPENDENCY_ACTION_NONE;
1980
}
@@ -2654,7 +2656,12 @@ static void ExecuteActionLog(
2656
break;
2657
2658
case BURN_EXECUTE_ACTION_TYPE_PACKAGE_DEPENDENCY:
2657
- LogStringLine(PlanDumpLevel, "%ls action[%u]: PACKAGE_DEPENDENCY package id: %ls, bundle provider key: %ls, action: %hs", wzBase, iAction, pAction->packageDependency.pPackage->sczId, pAction->packageDependency.sczBundleProviderKey, LoggingDependencyActionToString(pAction->packageDependency.action));
2659
+ LogStringLine(PlanDumpLevel, "%ls action[%u]: PACKAGE_DEPENDENCY package id: %ls, bundle provider key: %ls", wzBase, iAction, pAction->packageDependency.pPackage->sczId, pAction->packageDependency.sczBundleProviderKey);
2660
+ for (DWORD j = 0; j < pAction->packageProvider.pPackage->cDependencyProviders; ++j)
2661
+ {
2662
+ const BURN_DEPENDENCY_PROVIDER* pProvider = pAction->packageProvider.pPackage->rgDependencyProviders + j;
2663
+ LogStringLine(PlanDumpLevel, " Provider[%u]: key: %ls, action: %hs", j, pProvider->sczKey, LoggingDependencyActionToString(fRollback ? pProvider->dependentRollback : pProvider->dependentExecute));
2664
+ }
2665
break;
2666
2667
case BURN_EXECUTE_ACTION_TYPE_RELATED_BUNDLE:
src/burn/engine/plan.h
-1
@@ -213,7 +213,6 @@ typedef struct _BURN_EXECUTE_ACTION
213
{
214
BURN_PACKAGE* pPackage;
215
LPWSTR sczBundleProviderKey;
216
- BURN_DEPENDENCY_ACTION action;
216
} packageDependency;
217
struct
218
{
src/burn/test/BurnUnitTest/PlanTest.cpp
+39
-33
@@ -97,7 +97,7 @@ namespace Bootstrapper
97
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
98
ValidateExecuteMsiPackage(pPlan, fRollback, dwIndex++, L"PackageA", BOOTSTRAPPER_ACTION_STATE_INSTALL, BURN_MSI_PROPERTY_INSTALL, INSTALLUILEVEL_NONE, FALSE, BOOTSTRAPPER_MSI_FILE_VERSIONING_MISSING_OR_OLDER, 0);
99
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
100
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", BURN_DEPENDENCY_ACTION_REGISTER);
100
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", registerActions1, 1);
101
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
102
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
103
ValidateExecuteRollbackBoundaryEnd(pPlan, fRollback, dwIndex++);
@@ -111,7 +111,7 @@ namespace Bootstrapper
111
ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PackageB", registerActions1, 1);
112
ValidateExecuteMsiPackage(pPlan, fRollback, dwIndex++, L"PackageB", BOOTSTRAPPER_ACTION_STATE_INSTALL, BURN_MSI_PROPERTY_INSTALL, INSTALLUILEVEL_NONE, FALSE, BOOTSTRAPPER_MSI_FILE_VERSIONING_MISSING_OR_OLDER, 0);
113
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
114
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageB", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", BURN_DEPENDENCY_ACTION_REGISTER);
114
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageB", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", registerActions1, 1);
115
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
116
dwExecuteCheckpointId += 1; // cache checkpoints
117
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
@@ -120,7 +120,7 @@ namespace Bootstrapper
120
ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PackageC", registerActions1, 1);
121
ValidateExecuteMsiPackage(pPlan, fRollback, dwIndex++, L"PackageC", BOOTSTRAPPER_ACTION_STATE_INSTALL, BURN_MSI_PROPERTY_INSTALL, INSTALLUILEVEL_NONE, FALSE, BOOTSTRAPPER_MSI_FILE_VERSIONING_MISSING_OR_OLDER, 0);
122
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
123
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageC", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", BURN_DEPENDENCY_ACTION_REGISTER);
123
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageC", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", registerActions1, 1);
124
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
125
ValidateExecuteCommitMsiTransaction(pPlan, fRollback, dwIndex++, L"rbaOCA08D8ky7uBOK71_6FWz1K3TuQ");
126
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
@@ -138,7 +138,7 @@ namespace Bootstrapper
138
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
139
ValidateExecuteMsiPackage(pPlan, fRollback, dwIndex++, L"PackageA", BOOTSTRAPPER_ACTION_STATE_UNINSTALL, BURN_MSI_PROPERTY_UNINSTALL, INSTALLUILEVEL_NONE, FALSE, BOOTSTRAPPER_MSI_FILE_VERSIONING_MISSING_OR_OLDER, 0);
140
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
141
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", BURN_DEPENDENCY_ACTION_UNREGISTER);
141
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", unregisterActions1, 1);
142
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
143
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
144
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
@@ -150,7 +150,7 @@ namespace Bootstrapper
150
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
151
ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PackageB", unregisterActions1, 1);
152
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
153
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageB", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", BURN_DEPENDENCY_ACTION_UNREGISTER);
153
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageB", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", unregisterActions1, 1);
154
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
155
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
156
ValidateExecuteUncachePackage(pPlan, fRollback, dwIndex++, L"PackageC");
@@ -158,7 +158,7 @@ namespace Bootstrapper
158
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
159
ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PackageC", unregisterActions1, 1);
160
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
161
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageC", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", BURN_DEPENDENCY_ACTION_UNREGISTER);
161
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageC", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", unregisterActions1, 1);
162
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
163
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
164
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
@@ -218,13 +218,13 @@ namespace Bootstrapper
218
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
219
ValidateExecuteBeginMsiTransaction(pPlan, fRollback, dwIndex++, L"rbaOCA08D8ky7uBOK71_6FWz1K3TuQ");
220
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
221
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageC", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", BURN_DEPENDENCY_ACTION_UNREGISTER);
221
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageC", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", unregisterActions1, 1);
222
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
223
ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PackageC", unregisterActions1, 1);
224
ValidateExecuteMsiPackage(pPlan, fRollback, dwIndex++, L"PackageC", BOOTSTRAPPER_ACTION_STATE_UNINSTALL, BURN_MSI_PROPERTY_UNINSTALL, INSTALLUILEVEL_NONE, FALSE, BOOTSTRAPPER_MSI_FILE_VERSIONING_MISSING_OR_OLDER, 0);
225
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
226
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
227
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageB", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", BURN_DEPENDENCY_ACTION_UNREGISTER);
227
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageB", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", unregisterActions1, 1);
228
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
229
ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PackageB", unregisterActions1, 1);
230
ValidateExecuteMsiPackage(pPlan, fRollback, dwIndex++, L"PackageB", BOOTSTRAPPER_ACTION_STATE_UNINSTALL, BURN_MSI_PROPERTY_UNINSTALL, INSTALLUILEVEL_NONE, FALSE, BOOTSTRAPPER_MSI_FILE_VERSIONING_MISSING_OR_OLDER, 0);
@@ -234,7 +234,7 @@ namespace Bootstrapper
234
ValidateExecuteRollbackBoundaryEnd(pPlan, fRollback, dwIndex++);
235
ValidateExecuteRollbackBoundaryStart(pPlan, fRollback, dwIndex++, L"WixDefaultBoundary", TRUE, FALSE);
236
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
237
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", BURN_DEPENDENCY_ACTION_UNREGISTER);
237
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", unregisterActions1, 1);
238
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
239
ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PackageA", unregisterActions1, 1);
240
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
@@ -249,12 +249,12 @@ namespace Bootstrapper
249
dwExecuteCheckpointId = 1;
250
ValidateExecuteRollbackBoundaryStart(pPlan, fRollback, dwIndex++, L"rbaOCA08D8ky7uBOK71_6FWz1K3TuQ", TRUE, TRUE);
251
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
252
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageC", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", BURN_DEPENDENCY_ACTION_REGISTER);
252
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageC", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", registerActions1, 1);
253
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
254
ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PackageC", registerActions1, 1);
255
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
256
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
257
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageB", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", BURN_DEPENDENCY_ACTION_REGISTER);
257
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageB", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", registerActions1, 1);
258
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
259
ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PackageB", registerActions1, 1);
260
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
@@ -262,7 +262,7 @@ namespace Bootstrapper
262
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
263
ValidateExecuteRollbackBoundaryEnd(pPlan, fRollback, dwIndex++);
264
ValidateExecuteRollbackBoundaryStart(pPlan, fRollback, dwIndex++, L"WixDefaultBoundary", TRUE, FALSE);
265
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", BURN_DEPENDENCY_ACTION_REGISTER);
265
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", registerActions1, 1);
266
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
267
ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PackageA", registerActions1, 1);
268
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
@@ -329,7 +329,7 @@ namespace Bootstrapper
329
dwIndex = 0;
330
DWORD dwExecuteCheckpointId = 1;
331
ValidateExecuteRollbackBoundaryStart(pPlan, fRollback, dwIndex++, L"WixDefaultBoundary", TRUE, FALSE);
332
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", BURN_DEPENDENCY_ACTION_UNREGISTER);
332
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", unregisterActions1, 1);
333
ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PackageA", unregisterActions1, 1);
334
ValidateUninstallMsiCompatiblePackage(pPlan, fRollback, dwIndex++, L"PackageA", 0);
335
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
@@ -411,7 +411,7 @@ namespace Bootstrapper
411
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
412
ValidateExecuteMsiPackage(pPlan, fRollback, dwIndex++, L"PackageA", BOOTSTRAPPER_ACTION_STATE_INSTALL, BURN_MSI_PROPERTY_INSTALL, INSTALLUILEVEL_NONE, FALSE, BOOTSTRAPPER_MSI_FILE_VERSIONING_MISSING_OR_OLDER, 0);
413
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
414
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", BURN_DEPENDENCY_ACTION_REGISTER);
414
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", registerActions1, 1);
415
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
416
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
417
ValidateExecuteRollbackBoundaryEnd(pPlan, fRollback, dwIndex++);
@@ -427,7 +427,7 @@ namespace Bootstrapper
427
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
428
ValidateExecuteMsiPackage(pPlan, fRollback, dwIndex++, L"PackageA", BOOTSTRAPPER_ACTION_STATE_UNINSTALL, BURN_MSI_PROPERTY_UNINSTALL, INSTALLUILEVEL_NONE, FALSE, BOOTSTRAPPER_MSI_FILE_VERSIONING_MISSING_OR_OLDER, 0);
429
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
430
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", BURN_DEPENDENCY_ACTION_UNREGISTER);
430
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", unregisterActions1, 1);
431
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
432
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
433
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
@@ -561,7 +561,7 @@ namespace Bootstrapper
561
dwIndex = 0;
562
DWORD dwExecuteCheckpointId = 1;
563
ValidateExecuteRollbackBoundaryStart(pPlan, fRollback, dwIndex++, L"WixDefaultBoundary", TRUE, FALSE);
564
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", BURN_DEPENDENCY_ACTION_UNREGISTER);
564
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", unregisterActions1, 1);
565
ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PackageA", unregisterActions1, 1);
566
ValidateExecuteMsiPackage(pPlan, fRollback, dwIndex++, L"PackageA", BOOTSTRAPPER_ACTION_STATE_UNINSTALL, BURN_MSI_PROPERTY_UNINSTALL, INSTALLUILEVEL_NONE, FALSE, BOOTSTRAPPER_MSI_FILE_VERSIONING_MISSING_OR_OLDER, 0);
567
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
@@ -642,7 +642,7 @@ namespace Bootstrapper
642
ValidateExecuteWaitCachePackage(pPlan, fRollback, dwIndex++, L"PackageA");
643
ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PackageA", registerActions1, 1);
644
ValidateExecuteMsiPackage(pPlan, fRollback, dwIndex++, L"PackageA", BOOTSTRAPPER_ACTION_STATE_INSTALL, BURN_MSI_PROPERTY_INSTALL, INSTALLUILEVEL_NONE, FALSE, BOOTSTRAPPER_MSI_FILE_VERSIONING_MISSING_OR_OLDER, 0);
645
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", BURN_DEPENDENCY_ACTION_REGISTER);
645
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", registerActions1, 1);
646
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
647
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
648
ValidateExecuteRollbackBoundaryEnd(pPlan, fRollback, dwIndex++);
@@ -720,7 +720,7 @@ namespace Bootstrapper
720
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
721
ValidateExecuteMsiPackage(pPlan, fRollback, dwIndex++, L"PackageA", BOOTSTRAPPER_ACTION_STATE_INSTALL, BURN_MSI_PROPERTY_INSTALL, INSTALLUILEVEL_NONE, FALSE, BOOTSTRAPPER_MSI_FILE_VERSIONING_MISSING_OR_OLDER, 0);
722
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
723
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", BURN_DEPENDENCY_ACTION_REGISTER);
723
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", registerActions1, 1);
724
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
725
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
726
ValidateExecuteRollbackBoundaryEnd(pPlan, fRollback, dwIndex++);
@@ -737,7 +737,7 @@ namespace Bootstrapper
737
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
738
ValidateExecuteMsiPackage(pPlan, fRollback, dwIndex++, L"PackageA", BOOTSTRAPPER_ACTION_STATE_UNINSTALL, BURN_MSI_PROPERTY_UNINSTALL, INSTALLUILEVEL_NONE, FALSE, BOOTSTRAPPER_MSI_FILE_VERSIONING_MISSING_OR_OLDER, 0);
739
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
740
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", BURN_DEPENDENCY_ACTION_UNREGISTER);
740
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", unregisterActions1, 1);
741
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
742
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
743
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
@@ -855,7 +855,7 @@ namespace Bootstrapper
855
DWORD dwExecuteCheckpointId = 1;
856
ValidateExecuteRollbackBoundaryStart(pPlan, fRollback, dwIndex++, L"WixDefaultBoundary", TRUE, FALSE);
857
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
858
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", BURN_DEPENDENCY_ACTION_UNREGISTER);
858
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", unregisterActions1, 1);
859
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
860
ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PackageA", unregisterActions1, 1);
861
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
@@ -869,7 +869,7 @@ namespace Bootstrapper
869
dwIndex = 0;
870
dwExecuteCheckpointId = 1;
871
ValidateExecuteRollbackBoundaryStart(pPlan, fRollback, dwIndex++, L"WixDefaultBoundary", TRUE, FALSE);
872
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", BURN_DEPENDENCY_ACTION_REGISTER);
872
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", registerActions1, 1);
873
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
874
ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PackageA", registerActions1, 1);
875
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
@@ -930,7 +930,7 @@ namespace Bootstrapper
930
DWORD dwExecuteCheckpointId = 1;
931
ValidateExecuteRollbackBoundaryStart(pPlan, fRollback, dwIndex++, L"WixDefaultBoundary", TRUE, FALSE);
932
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
933
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", BURN_DEPENDENCY_ACTION_UNREGISTER);
933
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", unregisterActions1, 1);
934
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
935
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
936
ValidateExecuteRollbackBoundaryEnd(pPlan, fRollback, dwIndex++);
@@ -940,7 +940,7 @@ namespace Bootstrapper
940
dwIndex = 0;
941
dwExecuteCheckpointId = 1;
942
ValidateExecuteRollbackBoundaryStart(pPlan, fRollback, dwIndex++, L"WixDefaultBoundary", TRUE, FALSE);
943
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", BURN_DEPENDENCY_ACTION_REGISTER);
943
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{A6F0CBF7-1578-450C-B9D7-9CF2EEC40002}", registerActions1, 1);
944
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
945
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
946
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
@@ -1018,14 +1018,14 @@ namespace Bootstrapper
1018
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
1019
ValidateExecuteMsiPackage(pPlan, fRollback, dwIndex++, L"PackageA", BOOTSTRAPPER_ACTION_STATE_INSTALL, BURN_MSI_PROPERTY_INSTALL, INSTALLUILEVEL_NONE, FALSE, BOOTSTRAPPER_MSI_FILE_VERSIONING_MISSING_OR_OLDER, 0);
1020
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
1021
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", BURN_DEPENDENCY_ACTION_REGISTER);
1021
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", registerActions1, 1);
1022
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
1023
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
1024
ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PatchA", registerActions1, 1);
1025
pExecuteAction = ValidateDeletedExecuteMspTarget(pPlan, fRollback, dwIndex++, L"PatchA", BOOTSTRAPPER_ACTION_STATE_INSTALL, L"{5FF7F534-3FFC-41E0-80CD-E6361E5E7B7B}", TRUE, BURN_MSI_PROPERTY_INSTALL, INSTALLUILEVEL_NONE, FALSE, BOOTSTRAPPER_MSI_FILE_VERSIONING_MISSING_OR_OLDER, TRUE);
1026
ValidateExecuteMspTargetPatch(pExecuteAction, 0, L"PatchA");
1027
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
1028
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PatchA", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", BURN_DEPENDENCY_ACTION_REGISTER);
1028
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PatchA", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", registerActions1, 1);
1029
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
1030
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
1031
ValidateExecuteRollbackBoundaryEnd(pPlan, fRollback, dwIndex++);
@@ -1044,14 +1044,14 @@ namespace Bootstrapper
1044
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
1045
ValidateExecuteMsiPackage(pPlan, fRollback, dwIndex++, L"PackageA", BOOTSTRAPPER_ACTION_STATE_UNINSTALL, BURN_MSI_PROPERTY_UNINSTALL, INSTALLUILEVEL_NONE, FALSE, BOOTSTRAPPER_MSI_FILE_VERSIONING_MISSING_OR_OLDER, 0);
1046
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
1047
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", BURN_DEPENDENCY_ACTION_UNREGISTER);
1047
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", unregisterActions1, 1);
1048
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
1049
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
1050
ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PatchA", unregisterActions1, 1);
1051
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
1052
pExecuteAction = ValidateDeletedExecuteMspTarget(pPlan, fRollback, dwIndex++, L"PatchA", BOOTSTRAPPER_ACTION_STATE_UNINSTALL, L"{5FF7F534-3FFC-41E0-80CD-E6361E5E7B7B}", TRUE, BURN_MSI_PROPERTY_UNINSTALL, INSTALLUILEVEL_NONE, FALSE, BOOTSTRAPPER_MSI_FILE_VERSIONING_MISSING_OR_OLDER, TRUE);
1053
ValidateExecuteMspTargetPatch(pExecuteAction, 0, L"PatchA");
1054
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PatchA", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", BURN_DEPENDENCY_ACTION_UNREGISTER);
1054
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PatchA", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", unregisterActions1, 1);
1055
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
1056
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
1057
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
@@ -1109,14 +1109,14 @@ namespace Bootstrapper
1109
BURN_EXECUTE_ACTION* pExecuteAction = NULL;
1110
ValidateExecuteRollbackBoundaryStart(pPlan, fRollback, dwIndex++, L"WixDefaultBoundary", TRUE, FALSE);
1111
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
1112
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PatchA", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", BURN_DEPENDENCY_ACTION_UNREGISTER);
1112
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PatchA", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", unregisterActions1, 1);
1113
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
1114
ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PatchA", unregisterActions1, 1);
1115
pExecuteAction = ValidateDeletedExecuteMspTarget(pPlan, fRollback, dwIndex++, L"PatchA", BOOTSTRAPPER_ACTION_STATE_UNINSTALL, L"{5FF7F534-3FFC-41E0-80CD-E6361E5E7B7B}", TRUE, BURN_MSI_PROPERTY_UNINSTALL, INSTALLUILEVEL_NONE, FALSE, BOOTSTRAPPER_MSI_FILE_VERSIONING_MISSING_OR_OLDER, TRUE);
1116
ValidateExecuteMspTargetPatch(pExecuteAction, 0, L"PatchA");
1117
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
1118
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
1119
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", BURN_DEPENDENCY_ACTION_UNREGISTER);
1119
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", unregisterActions1, 1);
1120
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
1121
ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PackageA", unregisterActions1, 1);
1122
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
@@ -1130,14 +1130,14 @@ namespace Bootstrapper
1130
dwIndex = 0;
1131
dwExecuteCheckpointId = 1;
1132
ValidateExecuteRollbackBoundaryStart(pPlan, fRollback, dwIndex++, L"WixDefaultBoundary", TRUE, FALSE);
1133
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PatchA", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", BURN_DEPENDENCY_ACTION_REGISTER);
1133
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PatchA", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", registerActions1, 1);
1134
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
1135
ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PatchA", registerActions1, 1);
1136
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
1137
pExecuteAction = ValidateDeletedExecuteMspTarget(pPlan, fRollback, dwIndex++, L"PatchA", BOOTSTRAPPER_ACTION_STATE_INSTALL, L"{5FF7F534-3FFC-41E0-80CD-E6361E5E7B7B}", TRUE, BURN_MSI_PROPERTY_INSTALL, INSTALLUILEVEL_NONE, FALSE, BOOTSTRAPPER_MSI_FILE_VERSIONING_MISSING_OR_OLDER, TRUE);
1138
ValidateExecuteMspTargetPatch(pExecuteAction, 0, L"PatchA");
1139
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
1140
- ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", BURN_DEPENDENCY_ACTION_REGISTER);
1140
+ ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", registerActions1, 1);
1141
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
1142
ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PackageA", registerActions1, 1);
1143
ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++);
@@ -1698,14 +1698,20 @@ namespace Bootstrapper
1698
__in DWORD dwIndex,
1699
__in LPCWSTR wzPackageId,
1700
__in LPCWSTR wzBundleProviderKey,
1701
- __in BURN_DEPENDENCY_ACTION action
1701
+ __in BURN_DEPENDENCY_ACTION* rgActions,
1702
+ __in DWORD cActions
1703
)
1704
{
1705
BURN_EXECUTE_ACTION* pAction = ValidateExecuteActionExists(pPlan, fRollback, dwIndex);
1706
Assert::Equal<DWORD>(BURN_EXECUTE_ACTION_TYPE_PACKAGE_DEPENDENCY, pAction->type);
1707
NativeAssert::StringEqual(wzPackageId, pAction->packageDependency.pPackage->sczId);
1708
NativeAssert::StringEqual(wzBundleProviderKey, pAction->packageDependency.sczBundleProviderKey);
1708
- Assert::Equal<DWORD>(action, pAction->packageDependency.action);
1709
+ Assert::Equal<DWORD>(cActions, pAction->packageProvider.pPackage->cDependencyProviders);
1710
+ for (DWORD i = 0; i < cActions; ++i)
1711
+ {
1712
+ const BURN_DEPENDENCY_PROVIDER* pProvider = pAction->packageProvider.pPackage->rgDependencyProviders + i;
1713
+ Assert::Equal<DWORD>(rgActions[i], fRollback ? pProvider->dependentRollback : pProvider->dependentExecute);
1714
+ }
1715
Assert::Equal<BOOL>(FALSE, pAction->fDeleted);
1716
}
1717