diff options
Diffstat (limited to 'src/burn/test/BurnUnitTest/PlanTest.cpp')
| -rw-r--r-- | src/burn/test/BurnUnitTest/PlanTest.cpp | 393 |
1 files changed, 353 insertions, 40 deletions
diff --git a/src/burn/test/BurnUnitTest/PlanTest.cpp b/src/burn/test/BurnUnitTest/PlanTest.cpp index e2850a62..7e7d84cc 100644 --- a/src/burn/test/BurnUnitTest/PlanTest.cpp +++ b/src/burn/test/BurnUnitTest/PlanTest.cpp | |||
| @@ -2,12 +2,20 @@ | |||
| 2 | 2 | ||
| 3 | #include "precomp.h" | 3 | #include "precomp.h" |
| 4 | 4 | ||
| 5 | #if TODO_REIMPLEMENT | ||
| 5 | static HRESULT WINAPI PlanTestBAProc( | 6 | static HRESULT WINAPI PlanTestBAProc( |
| 6 | __in BOOTSTRAPPER_APPLICATION_MESSAGE message, | 7 | __in BOOTSTRAPPER_APPLICATION_MESSAGE message, |
| 7 | __in const LPVOID pvArgs, | 8 | __in const LPVOID pvArgs, |
| 8 | __inout LPVOID pvResults, | 9 | __inout LPVOID pvResults, |
| 9 | __in_opt LPVOID pvContext | 10 | __in_opt LPVOID pvContext |
| 10 | ); | 11 | ); |
| 12 | #endif | ||
| 13 | |||
| 14 | struct REDIRECTED_LOGGING_CONTEXT | ||
| 15 | { | ||
| 16 | LPSTR pszBuffer; | ||
| 17 | }; | ||
| 18 | |||
| 11 | 19 | ||
| 12 | static LPCWSTR wzArpEntryExeManifestFileName = L"ExePackage_PerUserArpEntry_manifest.xml"; | 20 | static LPCWSTR wzArpEntryExeManifestFileName = L"ExePackage_PerUserArpEntry_manifest.xml"; |
| 13 | static LPCWSTR wzMsiTransactionManifestFileName = L"MsiTransaction_BundleAv1_manifest.xml"; | 21 | static LPCWSTR wzMsiTransactionManifestFileName = L"MsiTransaction_BundleAv1_manifest.xml"; |
| @@ -28,11 +36,7 @@ static BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE vRelatedBundlePlanType = BOOTSTRAPP | |||
| 28 | static BURN_DEPENDENCY_ACTION registerActions1[] = { BURN_DEPENDENCY_ACTION_REGISTER }; | 36 | static BURN_DEPENDENCY_ACTION registerActions1[] = { BURN_DEPENDENCY_ACTION_REGISTER }; |
| 29 | static BURN_DEPENDENCY_ACTION unregisterActions1[] = { BURN_DEPENDENCY_ACTION_UNREGISTER }; | 37 | static BURN_DEPENDENCY_ACTION unregisterActions1[] = { BURN_DEPENDENCY_ACTION_UNREGISTER }; |
| 30 | 38 | ||
| 31 | namespace Microsoft | 39 | namespace WixToolset |
| 32 | { | ||
| 33 | namespace Tools | ||
| 34 | { | ||
| 35 | namespace WindowsInstallerXml | ||
| 36 | { | 40 | { |
| 37 | namespace Test | 41 | namespace Test |
| 38 | { | 42 | { |
| @@ -43,12 +47,314 @@ namespace Bootstrapper | |||
| 43 | 47 | ||
| 44 | public ref class PlanTest : BurnUnitTest | 48 | public ref class PlanTest : BurnUnitTest |
| 45 | { | 49 | { |
| 50 | private: | ||
| 51 | void ScopeTest( | ||
| 52 | LPCWSTR wzManifestFileName, | ||
| 53 | BOOL fDefaultPlanPerMachine, | ||
| 54 | BOOL fDefaultRegistrationPerMachine, | ||
| 55 | BOOL fPerUserPlanPerMachine, | ||
| 56 | BOOL fPerUserRegistrationPerMachine, | ||
| 57 | BOOL fPerMachinePlanPerMachine, | ||
| 58 | BOOL fPerMachineRegistrationPerMachine | ||
| 59 | ) | ||
| 60 | { | ||
| 61 | HRESULT hr = S_OK; | ||
| 62 | BURN_ENGINE_STATE engineState = { }; | ||
| 63 | BURN_ENGINE_STATE* pEngineState = &engineState; | ||
| 64 | BURN_PLAN* pPlan = &engineState.plan; | ||
| 65 | |||
| 66 | InitializeEngineStateForCorePlan(wzManifestFileName, pEngineState); | ||
| 67 | DetectAttachedContainerAsAttached(pEngineState); | ||
| 68 | DetectPermanentPackagesAsPresentAndCached(pEngineState); | ||
| 69 | |||
| 70 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); | ||
| 71 | NativeAssert::Succeeded(hr, "CorePlan default failed"); | ||
| 72 | |||
| 73 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | ||
| 74 | Assert::Equal<DWORD>(BOOTSTRAPPER_SCOPE_DEFAULT, pPlan->plannedScope); | ||
| 75 | Assert::Equal<DWORD>(fDefaultPlanPerMachine, pPlan->fPerMachine); | ||
| 76 | Assert::Equal<DWORD>(fDefaultRegistrationPerMachine, engineState.registration.fPerMachine); | ||
| 77 | |||
| 78 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL, BOOTSTRAPPER_SCOPE_PER_USER); | ||
| 79 | NativeAssert::Succeeded(hr, "CorePlan per-user failed"); | ||
| 80 | |||
| 81 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | ||
| 82 | Assert::Equal<DWORD>(BOOTSTRAPPER_SCOPE_PER_USER, pPlan->plannedScope); | ||
| 83 | Assert::Equal<DWORD>(fPerUserPlanPerMachine, pPlan->fPerMachine); | ||
| 84 | Assert::Equal<DWORD>(fPerUserRegistrationPerMachine, engineState.registration.fPerMachine); | ||
| 85 | |||
| 86 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL, BOOTSTRAPPER_SCOPE_PER_MACHINE); | ||
| 87 | NativeAssert::Succeeded(hr, "CorePlan per-machine failed"); | ||
| 88 | |||
| 89 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | ||
| 90 | Assert::Equal<DWORD>(BOOTSTRAPPER_SCOPE_PER_MACHINE, pPlan->plannedScope); | ||
| 91 | Assert::Equal<DWORD>(fPerMachinePlanPerMachine, pPlan->fPerMachine); | ||
| 92 | Assert::Equal<DWORD>(fPerMachineRegistrationPerMachine, engineState.registration.fPerMachine); | ||
| 93 | } | ||
| 94 | |||
| 46 | public: | 95 | public: |
| 47 | PlanTest(BurnTestFixture^ fixture) : BurnUnitTest(fixture) | 96 | PlanTest(BurnTestFixture^ fixture) : BurnUnitTest(fixture) |
| 48 | { | 97 | { |
| 49 | } | 98 | } |
| 50 | 99 | ||
| 51 | [Fact] | 100 | [Fact] |
| 101 | void CommandLineScopeTestNoop() | ||
| 102 | { | ||
| 103 | HRESULT hr = S_OK; | ||
| 104 | BURN_ENGINE_STATE engineState = { }; | ||
| 105 | BURN_ENGINE_STATE* pEngineState = &engineState; | ||
| 106 | BURN_PLAN* pPlan = &engineState.plan; | ||
| 107 | |||
| 108 | engineState.command.commandLineScope = BOOTSTRAPPER_SCOPE_PER_MACHINE; | ||
| 109 | |||
| 110 | InitializeEngineStateForCorePlan(L"AllPmouBundle_manifest.xml", pEngineState); | ||
| 111 | DetectAttachedContainerAsAttached(pEngineState); | ||
| 112 | DetectPermanentPackagesAsPresentAndCached(pEngineState); | ||
| 113 | |||
| 114 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL, BOOTSTRAPPER_SCOPE_PER_USER); | ||
| 115 | NativeAssert::Succeeded(hr, "CorePlan default failed"); | ||
| 116 | |||
| 117 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | ||
| 118 | Assert::Equal<DWORD>(BOOTSTRAPPER_SCOPE_PER_USER, pPlan->plannedScope); | ||
| 119 | Assert::Equal<DWORD>(FALSE, pPlan->fPerMachine); | ||
| 120 | Assert::Equal<DWORD>(FALSE, engineState.registration.fPerMachine); | ||
| 121 | } | ||
| 122 | |||
| 123 | [Fact] | ||
| 124 | void CommandLineScopePerUserTest() | ||
| 125 | { | ||
| 126 | HRESULT hr = S_OK; | ||
| 127 | BURN_ENGINE_STATE engineState = { }; | ||
| 128 | BURN_ENGINE_STATE* pEngineState = &engineState; | ||
| 129 | BURN_PLAN* pPlan = &engineState.plan; | ||
| 130 | |||
| 131 | engineState.command.commandLineScope = BOOTSTRAPPER_SCOPE_PER_USER; | ||
| 132 | |||
| 133 | InitializeEngineStateForCorePlan(L"AllPmouBundle_manifest.xml", pEngineState); | ||
| 134 | DetectAttachedContainerAsAttached(pEngineState); | ||
| 135 | DetectPermanentPackagesAsPresentAndCached(pEngineState); | ||
| 136 | |||
| 137 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); | ||
| 138 | NativeAssert::Succeeded(hr, "CorePlan default failed"); | ||
| 139 | |||
| 140 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | ||
| 141 | Assert::Equal<DWORD>(BOOTSTRAPPER_SCOPE_PER_USER, pPlan->plannedScope); | ||
| 142 | Assert::Equal<DWORD>(FALSE, pPlan->fPerMachine); | ||
| 143 | Assert::Equal<DWORD>(FALSE, engineState.registration.fPerMachine); | ||
| 144 | } | ||
| 145 | |||
| 146 | [Fact] | ||
| 147 | void CommandLineScopePerMachineTest() | ||
| 148 | { | ||
| 149 | HRESULT hr = S_OK; | ||
| 150 | BURN_ENGINE_STATE engineState = { }; | ||
| 151 | BURN_ENGINE_STATE* pEngineState = &engineState; | ||
| 152 | BURN_PLAN* pPlan = &engineState.plan; | ||
| 153 | |||
| 154 | engineState.command.commandLineScope = BOOTSTRAPPER_SCOPE_PER_MACHINE; | ||
| 155 | |||
| 156 | InitializeEngineStateForCorePlan(L"AllPmouBundle_manifest.xml", pEngineState); | ||
| 157 | DetectAttachedContainerAsAttached(pEngineState); | ||
| 158 | DetectPermanentPackagesAsPresentAndCached(pEngineState); | ||
| 159 | |||
| 160 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); | ||
| 161 | NativeAssert::Succeeded(hr, "CorePlan default failed"); | ||
| 162 | |||
| 163 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | ||
| 164 | Assert::Equal<DWORD>(BOOTSTRAPPER_SCOPE_PER_MACHINE, pPlan->plannedScope); | ||
| 165 | Assert::Equal<DWORD>(TRUE, pPlan->fPerMachine); | ||
| 166 | Assert::Equal<DWORD>(TRUE, engineState.registration.fPerMachine); | ||
| 167 | } | ||
| 168 | |||
| 169 | [Fact] | ||
| 170 | void BundlePackageScopeTestNoop() | ||
| 171 | { | ||
| 172 | HRESULT hr = S_OK; | ||
| 173 | BURN_ENGINE_STATE engineState = { }; | ||
| 174 | BURN_ENGINE_STATE* pEngineState = &engineState; | ||
| 175 | BURN_PLAN* pPlan = &engineState.plan; | ||
| 176 | |||
| 177 | engineState.command.commandLineScope = BOOTSTRAPPER_SCOPE_PER_MACHINE; | ||
| 178 | |||
| 179 | InitializeEngineStateForCorePlan(L"PuomBundlePackage_manifest.xml", pEngineState); | ||
| 180 | DetectAttachedContainerAsAttached(pEngineState); | ||
| 181 | DetectPermanentPackagesAsPresentAndCached(pEngineState); | ||
| 182 | |||
| 183 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL, BOOTSTRAPPER_SCOPE_PER_USER); | ||
| 184 | NativeAssert::Succeeded(hr, "CorePlan default failed"); | ||
| 185 | |||
| 186 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | ||
| 187 | Assert::Equal<DWORD>(BOOTSTRAPPER_SCOPE_PER_USER, pPlan->plannedScope); | ||
| 188 | Assert::Equal<DWORD>(BOOTSTRAPPER_SCOPE_DEFAULT, engineState.packages.rgPackages[0].fPerMachine); | ||
| 189 | Assert::Equal<DWORD>(FALSE, pPlan->fPerMachine); | ||
| 190 | Assert::Equal<DWORD>(FALSE, engineState.registration.fPerMachine); | ||
| 191 | } | ||
| 192 | |||
| 193 | [Fact] | ||
| 194 | void BundlePackageScopeTestSucceeds() | ||
| 195 | { | ||
| 196 | HRESULT hr = S_OK; | ||
| 197 | BURN_ENGINE_STATE engineState = { }; | ||
| 198 | BURN_ENGINE_STATE* pEngineState = &engineState; | ||
| 199 | BURN_PLAN* pPlan = &engineState.plan; | ||
| 200 | |||
| 201 | engineState.command.commandLineScope = BOOTSTRAPPER_SCOPE_PER_MACHINE; | ||
| 202 | |||
| 203 | InitializeEngineStateForCorePlan(L"PuomBundlePackage_manifest.xml", pEngineState); | ||
| 204 | DetectAttachedContainerAsAttached(pEngineState); | ||
| 205 | DetectPermanentPackagesAsPresentAndCached(pEngineState); | ||
| 206 | |||
| 207 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); | ||
| 208 | NativeAssert::Succeeded(hr, "CorePlan default failed"); | ||
| 209 | |||
| 210 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | ||
| 211 | Assert::Equal<DWORD>(BOOTSTRAPPER_SCOPE_PER_MACHINE, pPlan->plannedScope); | ||
| 212 | Assert::Equal<DWORD>(BOOTSTRAPPER_SCOPE_PER_MACHINE, engineState.packages.rgPackages[0].fPerMachine); | ||
| 213 | Assert::Equal<DWORD>(TRUE, pPlan->fPerMachine); | ||
| 214 | Assert::Equal<DWORD>(TRUE, engineState.registration.fPerMachine); | ||
| 215 | } | ||
| 216 | |||
| 217 | [Fact] | ||
| 218 | void AllPerUserScopeTest() | ||
| 219 | { | ||
| 220 | ScopeTest( | ||
| 221 | L"PerUserBundle_manifest.xml", | ||
| 222 | FALSE /*fDefaultPlanPerMachine*/, | ||
| 223 | FALSE /*fDefaultRegistrationPerMachine*/, | ||
| 224 | FALSE /*fPerUserPlanPerMachine*/, | ||
| 225 | FALSE /*fPerUserRegistrationPerMachine*/, | ||
| 226 | FALSE /*fPerMachinePlanPerMachine*/, | ||
| 227 | FALSE /*fPerMachineRegistrationPerMachine*/ | ||
| 228 | ); | ||
| 229 | } | ||
| 230 | |||
| 231 | [Fact] | ||
| 232 | void AllPerMachineScopeTest() | ||
| 233 | { | ||
| 234 | ScopeTest( | ||
| 235 | L"PerMachineBundle_manifest.xml", | ||
| 236 | TRUE /*fDefaultPlanPerMachine*/, | ||
| 237 | TRUE /*fDefaultRegistrationPerMachine*/, | ||
| 238 | TRUE /*fPerUserPlanPerMachine*/, | ||
| 239 | TRUE /*fPerUserRegistrationPerMachine*/, | ||
| 240 | TRUE /*fPerMachinePlanPerMachine*/, | ||
| 241 | TRUE /*fPerMachineRegistrationPerMachine*/ | ||
| 242 | ); | ||
| 243 | } | ||
| 244 | |||
| 245 | [Fact] | ||
| 246 | void AllPerMachineOrUserPackagesScopeTest() | ||
| 247 | { | ||
| 248 | ScopeTest( | ||
| 249 | L"AllPmouBundle_manifest.xml", | ||
| 250 | TRUE /*fDefaultPlanPerMachine*/, | ||
| 251 | TRUE /*fDefaultRegistrationPerMachine*/, | ||
| 252 | FALSE /*fPerUserPlanPerMachine*/, | ||
| 253 | FALSE /*fPerUserRegistrationPerMachine*/, | ||
| 254 | TRUE /*fPerMachinePlanPerMachine*/, | ||
| 255 | TRUE /*fPerMachineRegistrationPerMachine*/ | ||
| 256 | ); | ||
| 257 | } | ||
| 258 | |||
| 259 | [Fact] | ||
| 260 | void AllPerUserOrMachinePackagesScopeTest() | ||
| 261 | { | ||
| 262 | ScopeTest( | ||
| 263 | L"AllPuomBundle_manifest.xml", | ||
| 264 | FALSE /*fDefaultPlanPerMachine*/, | ||
| 265 | FALSE /*fDefaultRegistrationPerMachine*/, | ||
| 266 | FALSE /*fPerUserPlanPerMachine*/, | ||
| 267 | FALSE /*fPerUserRegistrationPerMachine*/, | ||
| 268 | TRUE /*fPerMachinePlanPerMachine*/, | ||
| 269 | TRUE /*fPerMachineRegistrationPerMachine*/ | ||
| 270 | ); | ||
| 271 | } | ||
| 272 | |||
| 273 | [Fact] | ||
| 274 | void PerMachineAndPerMachineOrUserScopeTest() | ||
| 275 | { | ||
| 276 | ScopeTest( | ||
| 277 | L"PmPmouBundle_manifest.xml", | ||
| 278 | TRUE /*fDefaultPlanPerMachine*/, | ||
| 279 | TRUE /*fDefaultRegistrationPerMachine*/, | ||
| 280 | TRUE /*fPerUserPlanPerMachine*/, | ||
| 281 | FALSE /*fPerUserRegistrationPerMachine*/, | ||
| 282 | TRUE /*fPerMachinePlanPerMachine*/, | ||
| 283 | TRUE /*fPerMachineRegistrationPerMachine*/ | ||
| 284 | ); | ||
| 285 | } | ||
| 286 | |||
| 287 | [Fact] | ||
| 288 | void PerMachineAndPerUserOrMachineScopeTest() | ||
| 289 | { | ||
| 290 | ScopeTest( | ||
| 291 | L"PmPuomBundle_manifest.xml", | ||
| 292 | TRUE /*fDefaultPlanPerMachine*/, | ||
| 293 | FALSE /*fDefaultRegistrationPerMachine*/, | ||
| 294 | TRUE /*fPerUserPlanPerMachine*/, | ||
| 295 | FALSE /*fPerUserRegistrationPerMachine*/, | ||
| 296 | TRUE /*fPerMachinePlanPerMachine*/, | ||
| 297 | TRUE /*fPerMachineRegistrationPerMachine*/ | ||
| 298 | ); | ||
| 299 | } | ||
| 300 | |||
| 301 | [Fact] | ||
| 302 | void PerMachineAndPerUserAndPerMachineOrUserScopeTest() | ||
| 303 | { | ||
| 304 | ScopeTest( | ||
| 305 | L"PmPuPmouBundle_manifest.xml", | ||
| 306 | TRUE /*fDefaultPlanPerMachine*/, | ||
| 307 | FALSE /*fDefaultRegistrationPerMachine*/, | ||
| 308 | TRUE /*fPerUserPlanPerMachine*/, | ||
| 309 | FALSE /*fPerUserRegistrationPerMachine*/, | ||
| 310 | TRUE /*fPerMachinePlanPerMachine*/, | ||
| 311 | FALSE /*fPerMachineRegistrationPerMachine*/ | ||
| 312 | ); | ||
| 313 | } | ||
| 314 | |||
| 315 | [Fact] | ||
| 316 | void PerMachineAndPerUserAndPerUserOrMachineScopeTest() | ||
| 317 | { | ||
| 318 | ScopeTest( | ||
| 319 | L"PmPuPuomBundle_manifest.xml", | ||
| 320 | TRUE /*fDefaultPlanPerMachine*/, | ||
| 321 | FALSE /*fDefaultRegistrationPerMachine*/, | ||
| 322 | TRUE /*fPerUserPlanPerMachine*/, | ||
| 323 | FALSE /*fPerUserRegistrationPerMachine*/, | ||
| 324 | TRUE /*fPerMachinePlanPerMachine*/, | ||
| 325 | FALSE /*fPerMachineRegistrationPerMachine*/ | ||
| 326 | ); | ||
| 327 | } | ||
| 328 | |||
| 329 | [Fact] | ||
| 330 | void PerUserAndPerMachineOrUserScopeTest() | ||
| 331 | { | ||
| 332 | ScopeTest( | ||
| 333 | L"PuPmouBundle_manifest.xml", | ||
| 334 | TRUE /*fDefaultPlanPerMachine*/, | ||
| 335 | FALSE /*fDefaultRegistrationPerMachine*/, | ||
| 336 | FALSE /*fPerUserPlanPerMachine*/, | ||
| 337 | FALSE /*fPerUserRegistrationPerMachine*/, | ||
| 338 | TRUE /*fPerMachinePlanPerMachine*/, | ||
| 339 | FALSE /*fPerMachineRegistrationPerMachine*/ | ||
| 340 | ); | ||
| 341 | } | ||
| 342 | |||
| 343 | [Fact] | ||
| 344 | void PerUserAndPerUserOrMachineScopeTest() | ||
| 345 | { | ||
| 346 | ScopeTest( | ||
| 347 | L"PuPuomBundle_manifest.xml", | ||
| 348 | FALSE /*fDefaultPlanPerMachine*/, | ||
| 349 | FALSE /*fDefaultRegistrationPerMachine*/, | ||
| 350 | FALSE /*fPerUserPlanPerMachine*/, | ||
| 351 | FALSE /*fPerUserRegistrationPerMachine*/, | ||
| 352 | TRUE /*fPerMachinePlanPerMachine*/, | ||
| 353 | FALSE /*fPerMachineRegistrationPerMachine*/ | ||
| 354 | ); | ||
| 355 | } | ||
| 356 | |||
| 357 | [Fact] | ||
| 52 | void ArpEntryExeInstallTest() | 358 | void ArpEntryExeInstallTest() |
| 53 | { | 359 | { |
| 54 | HRESULT hr = S_OK; | 360 | HRESULT hr = S_OK; |
| @@ -60,7 +366,7 @@ namespace Bootstrapper | |||
| 60 | DetectAttachedContainerAsAttached(pEngineState); | 366 | DetectAttachedContainerAsAttached(pEngineState); |
| 61 | DetectPermanentPackagesAsPresentAndCached(pEngineState); | 367 | DetectPermanentPackagesAsPresentAndCached(pEngineState); |
| 62 | 368 | ||
| 63 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL); | 369 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 64 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 370 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 65 | 371 | ||
| 66 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | 372 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); |
| @@ -154,12 +460,13 @@ namespace Bootstrapper | |||
| 154 | 460 | ||
| 155 | pEngineState->packages.rgPackages[1].currentState = BOOTSTRAPPER_PACKAGE_STATE_OBSOLETE; | 461 | pEngineState->packages.rgPackages[1].currentState = BOOTSTRAPPER_PACKAGE_STATE_OBSOLETE; |
| 156 | 462 | ||
| 157 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL); | 463 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 158 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 464 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 159 | 465 | ||
| 160 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | 466 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); |
| 161 | NativeAssert::StringEqual(L"{9C459DAD-0E64-40C8-8C9F-4F68E46AB223}", pPlan->wzBundleCode); | 467 | NativeAssert::StringEqual(L"{9C459DAD-0E64-40C8-8C9F-4F68E46AB223}", pPlan->wzBundleCode); |
| 162 | NativeAssert::StringEqual(L"{9C459DAD-0E64-40C8-8C9F-4F68E46AB223}", pPlan->wzBundleProviderKey); | 468 | NativeAssert::StringEqual(L"{9C459DAD-0E64-40C8-8C9F-4F68E46AB223}", pPlan->wzBundleProviderKey); |
| 469 | |||
| 163 | Assert::Equal<BOOL>(FALSE, pPlan->fEnabledForwardCompatibleBundle); | 470 | Assert::Equal<BOOL>(FALSE, pPlan->fEnabledForwardCompatibleBundle); |
| 164 | Assert::Equal<BOOL>(FALSE, pPlan->fPerMachine); | 471 | Assert::Equal<BOOL>(FALSE, pPlan->fPerMachine); |
| 165 | Assert::Equal<BOOL>(TRUE, pPlan->fCanAffectMachineState); | 472 | Assert::Equal<BOOL>(TRUE, pPlan->fCanAffectMachineState); |
| @@ -233,7 +540,7 @@ namespace Bootstrapper | |||
| 233 | InitializeEngineStateForCorePlan(wzArpEntryExeManifestFileName, pEngineState); | 540 | InitializeEngineStateForCorePlan(wzArpEntryExeManifestFileName, pEngineState); |
| 234 | DetectPackagesAsPresentAndCached(pEngineState); | 541 | DetectPackagesAsPresentAndCached(pEngineState); |
| 235 | 542 | ||
| 236 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNINSTALL); | 543 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNINSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 237 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 544 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 238 | 545 | ||
| 239 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); | 546 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); |
| @@ -326,9 +633,11 @@ namespace Bootstrapper | |||
| 326 | DetectPackagesAsAbsent(pEngineState); | 633 | DetectPackagesAsAbsent(pEngineState); |
| 327 | DetectRelatedBundle(pEngineState, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", L"1.0.0.0", BOOTSTRAPPER_RELATION_UPGRADE); | 634 | DetectRelatedBundle(pEngineState, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", L"1.0.0.0", BOOTSTRAPPER_RELATION_UPGRADE); |
| 328 | 635 | ||
| 329 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL); | 636 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 330 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 637 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 331 | 638 | ||
| 639 | PlanDump(pPlan); | ||
| 640 | |||
| 332 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | 641 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); |
| 333 | NativeAssert::StringEqual(L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", pPlan->wzBundleCode); | 642 | NativeAssert::StringEqual(L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", pPlan->wzBundleCode); |
| 334 | NativeAssert::StringEqual(L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", pPlan->wzBundleProviderKey); | 643 | NativeAssert::StringEqual(L"{E6469F05-BDC8-4EB8-B218-67412543EFAA}", pPlan->wzBundleProviderKey); |
| @@ -486,7 +795,7 @@ namespace Bootstrapper | |||
| 486 | InitializeEngineStateForCorePlan(wzMsiTransactionManifestFileName, pEngineState); | 795 | InitializeEngineStateForCorePlan(wzMsiTransactionManifestFileName, pEngineState); |
| 487 | DetectPackagesAsPresentAndCached(pEngineState); | 796 | DetectPackagesAsPresentAndCached(pEngineState); |
| 488 | 797 | ||
| 489 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNINSTALL); | 798 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNINSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 490 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 799 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 491 | 800 | ||
| 492 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); | 801 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); |
| @@ -627,7 +936,7 @@ namespace Bootstrapper | |||
| 627 | DetectAttachedContainerAsAttached(pEngineState); | 936 | DetectAttachedContainerAsAttached(pEngineState); |
| 628 | DetectPermanentPackagesAsPresentAndCached(pEngineState); | 937 | DetectPermanentPackagesAsPresentAndCached(pEngineState); |
| 629 | 938 | ||
| 630 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL); | 939 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 631 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 940 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 632 | 941 | ||
| 633 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | 942 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); |
| @@ -742,7 +1051,7 @@ namespace Bootstrapper | |||
| 742 | DetectAttachedContainerAsAttached(pEngineState); | 1051 | DetectAttachedContainerAsAttached(pEngineState); |
| 743 | DetectPackagesAsPresentAndCached(pEngineState); | 1052 | DetectPackagesAsPresentAndCached(pEngineState); |
| 744 | 1053 | ||
| 745 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_REPAIR); | 1054 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_REPAIR, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 746 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 1055 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 747 | 1056 | ||
| 748 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_REPAIR, pPlan->action); | 1057 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_REPAIR, pPlan->action); |
| @@ -836,7 +1145,7 @@ namespace Bootstrapper | |||
| 836 | DetectAttachedContainerAsAttached(pEngineState); | 1145 | DetectAttachedContainerAsAttached(pEngineState); |
| 837 | DetectPackagesAsPresentAndCached(pEngineState); | 1146 | DetectPackagesAsPresentAndCached(pEngineState); |
| 838 | 1147 | ||
| 839 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNINSTALL); | 1148 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNINSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 840 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 1149 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 841 | 1150 | ||
| 842 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); | 1151 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); |
| @@ -955,7 +1264,7 @@ namespace Bootstrapper | |||
| 955 | DetectPackagesAsAbsent(pEngineState); | 1264 | DetectPackagesAsAbsent(pEngineState); |
| 956 | DetectCompatibleMsiPackage(pEngineState, pEngineState->packages.rgPackages, L"{C24F3903-38E7-4D44-8037-D9856B3C5046}", L"2.0.0.0"); | 1265 | DetectCompatibleMsiPackage(pEngineState, pEngineState->packages.rgPackages, L"{C24F3903-38E7-4D44-8037-D9856B3C5046}", L"2.0.0.0"); |
| 957 | 1266 | ||
| 958 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNINSTALL); | 1267 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNINSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 959 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 1268 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 960 | 1269 | ||
| 961 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); | 1270 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); |
| @@ -1055,7 +1364,7 @@ namespace Bootstrapper | |||
| 1055 | vfUseRelatedBundlePlanType = TRUE; | 1364 | vfUseRelatedBundlePlanType = TRUE; |
| 1056 | vRelatedBundlePlanType = BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE_UPGRADE; | 1365 | vRelatedBundlePlanType = BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE_UPGRADE; |
| 1057 | 1366 | ||
| 1058 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL); | 1367 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 1059 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 1368 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 1060 | 1369 | ||
| 1061 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | 1370 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); |
| @@ -1174,7 +1483,7 @@ namespace Bootstrapper | |||
| 1174 | BURN_RELATED_BUNDLE* pRelatedBundle = DetectRelatedBundle(pEngineState, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", L"0.9.0.0", BOOTSTRAPPER_RELATION_UPGRADE); | 1483 | BURN_RELATED_BUNDLE* pRelatedBundle = DetectRelatedBundle(pEngineState, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", L"0.9.0.0", BOOTSTRAPPER_RELATION_UPGRADE); |
| 1175 | pRelatedBundle->fPlannable = FALSE; | 1484 | pRelatedBundle->fPlannable = FALSE; |
| 1176 | 1485 | ||
| 1177 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL); | 1486 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 1178 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 1487 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 1179 | 1488 | ||
| 1180 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | 1489 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); |
| @@ -1276,7 +1585,7 @@ namespace Bootstrapper | |||
| 1276 | DetectAttachedContainerAsAttached(pEngineState); | 1585 | DetectAttachedContainerAsAttached(pEngineState); |
| 1277 | DetectPermanentPackagesAsPresentAndCached(pEngineState); | 1586 | DetectPermanentPackagesAsPresentAndCached(pEngineState); |
| 1278 | 1587 | ||
| 1279 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL); | 1588 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 1280 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 1589 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 1281 | 1590 | ||
| 1282 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | 1591 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); |
| @@ -1369,7 +1678,7 @@ namespace Bootstrapper | |||
| 1369 | DetectAttachedContainerAsAttached(pEngineState); | 1678 | DetectAttachedContainerAsAttached(pEngineState); |
| 1370 | DetectPermanentPackagesAsPresentAndCached(pEngineState); | 1679 | DetectPermanentPackagesAsPresentAndCached(pEngineState); |
| 1371 | 1680 | ||
| 1372 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_LAYOUT); | 1681 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_LAYOUT, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 1373 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 1682 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 1374 | 1683 | ||
| 1375 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_LAYOUT, pPlan->action); | 1684 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_LAYOUT, pPlan->action); |
| @@ -1452,7 +1761,7 @@ namespace Bootstrapper | |||
| 1452 | DetectPackagesAsAbsent(pEngineState); | 1761 | DetectPackagesAsAbsent(pEngineState); |
| 1453 | DetectRelatedBundle(pEngineState, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", L"0.9.0.0", BOOTSTRAPPER_RELATION_UPGRADE); | 1762 | DetectRelatedBundle(pEngineState, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", L"0.9.0.0", BOOTSTRAPPER_RELATION_UPGRADE); |
| 1454 | 1763 | ||
| 1455 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_CACHE); | 1764 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_CACHE, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 1456 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 1765 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 1457 | 1766 | ||
| 1458 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_CACHE, pPlan->action); | 1767 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_CACHE, pPlan->action); |
| @@ -1541,7 +1850,7 @@ namespace Bootstrapper | |||
| 1541 | DetectPackagesAsAbsent(pEngineState); | 1850 | DetectPackagesAsAbsent(pEngineState); |
| 1542 | DetectRelatedBundle(pEngineState, L"{AF8355C9-CCDD-4D61-BF5F-EA5F948D8F01}", L"1.1.0.0", BOOTSTRAPPER_RELATION_UPGRADE); | 1851 | DetectRelatedBundle(pEngineState, L"{AF8355C9-CCDD-4D61-BF5F-EA5F948D8F01}", L"1.1.0.0", BOOTSTRAPPER_RELATION_UPGRADE); |
| 1543 | 1852 | ||
| 1544 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL); | 1853 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 1545 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 1854 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 1546 | 1855 | ||
| 1547 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | 1856 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); |
| @@ -1616,7 +1925,7 @@ namespace Bootstrapper | |||
| 1616 | vfUseRelatedBundleRequestState = TRUE; | 1925 | vfUseRelatedBundleRequestState = TRUE; |
| 1617 | vRelatedBundleRequestState = BOOTSTRAPPER_REQUEST_STATE_FORCE_ABSENT; | 1926 | vRelatedBundleRequestState = BOOTSTRAPPER_REQUEST_STATE_FORCE_ABSENT; |
| 1618 | 1927 | ||
| 1619 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNINSTALL); | 1928 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNINSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 1620 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 1929 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 1621 | 1930 | ||
| 1622 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); | 1931 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); |
| @@ -1705,7 +2014,7 @@ namespace Bootstrapper | |||
| 1705 | vfUseRelatedBundleRequestState = TRUE; | 2014 | vfUseRelatedBundleRequestState = TRUE; |
| 1706 | vRelatedBundleRequestState = BOOTSTRAPPER_REQUEST_STATE_FORCE_PRESENT; | 2015 | vRelatedBundleRequestState = BOOTSTRAPPER_REQUEST_STATE_FORCE_PRESENT; |
| 1707 | 2016 | ||
| 1708 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL); | 2017 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 1709 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 2018 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 1710 | 2019 | ||
| 1711 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | 2020 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); |
| @@ -1798,7 +2107,7 @@ namespace Bootstrapper | |||
| 1798 | DetectPackagesAsAbsent(pEngineState); | 2107 | DetectPackagesAsAbsent(pEngineState); |
| 1799 | DetectRelatedBundle(pEngineState, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", L"0.9.0.0", BOOTSTRAPPER_RELATION_UPGRADE); | 2108 | DetectRelatedBundle(pEngineState, L"{FD9920AD-DBCA-4C6C-8CD5-B47431CE8D21}", L"0.9.0.0", BOOTSTRAPPER_RELATION_UPGRADE); |
| 1800 | 2109 | ||
| 1801 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL); | 2110 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 1802 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 2111 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 1803 | 2112 | ||
| 1804 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | 2113 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); |
| @@ -1904,7 +2213,7 @@ namespace Bootstrapper | |||
| 1904 | 2213 | ||
| 1905 | pEngineState->registration.detectedRegistrationType = BOOTSTRAPPER_REGISTRATION_TYPE_FULL; | 2214 | pEngineState->registration.detectedRegistrationType = BOOTSTRAPPER_REGISTRATION_TYPE_FULL; |
| 1906 | 2215 | ||
| 1907 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_MODIFY); | 2216 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_MODIFY, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 1908 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 2217 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 1909 | 2218 | ||
| 1910 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_MODIFY, pPlan->action); | 2219 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_MODIFY, pPlan->action); |
| @@ -1983,7 +2292,7 @@ namespace Bootstrapper | |||
| 1983 | InitializeEngineStateForCorePlan(wzSingleMsiManifestFileName, pEngineState); | 2292 | InitializeEngineStateForCorePlan(wzSingleMsiManifestFileName, pEngineState); |
| 1984 | DetectPackagesAsPresentAndCached(pEngineState); | 2293 | DetectPackagesAsPresentAndCached(pEngineState); |
| 1985 | 2294 | ||
| 1986 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNINSTALL); | 2295 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNINSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 1987 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 2296 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 1988 | 2297 | ||
| 1989 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); | 2298 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); |
| @@ -2084,7 +2393,7 @@ namespace Bootstrapper | |||
| 2084 | DetectPackagesAsPresentAndCached(pEngineState); | 2393 | DetectPackagesAsPresentAndCached(pEngineState); |
| 2085 | DetectBundleDependent(pEngineState, L"{29855EB1-724D-4285-A89C-5D37D8549DCD}"); | 2394 | DetectBundleDependent(pEngineState, L"{29855EB1-724D-4285-A89C-5D37D8549DCD}"); |
| 2086 | 2395 | ||
| 2087 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNINSTALL); | 2396 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNINSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 2088 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 2397 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 2089 | 2398 | ||
| 2090 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); | 2399 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); |
| @@ -2154,7 +2463,7 @@ namespace Bootstrapper | |||
| 2154 | InitializeEngineStateForCorePlan(wzSingleMsiManifestFileName, pEngineState); | 2463 | InitializeEngineStateForCorePlan(wzSingleMsiManifestFileName, pEngineState); |
| 2155 | DetectAsRelatedUpgradeBundle(&engineState, L"{02940F3E-C83E-452D-BFCF-C943777ACEAE}", L"2.0.0.0"); | 2464 | DetectAsRelatedUpgradeBundle(&engineState, L"{02940F3E-C83E-452D-BFCF-C943777ACEAE}", L"2.0.0.0"); |
| 2156 | 2465 | ||
| 2157 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNINSTALL); | 2466 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNINSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 2158 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 2467 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 2159 | 2468 | ||
| 2160 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); | 2469 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); |
| @@ -2240,7 +2549,7 @@ namespace Bootstrapper | |||
| 2240 | pEngineState->packages.rgPackages[0].currentState = BOOTSTRAPPER_PACKAGE_STATE_SUPERSEDED; | 2549 | pEngineState->packages.rgPackages[0].currentState = BOOTSTRAPPER_PACKAGE_STATE_SUPERSEDED; |
| 2241 | pEngineState->packages.rgPackages[0].Msi.operation = BOOTSTRAPPER_RELATED_OPERATION_DOWNGRADE; | 2550 | pEngineState->packages.rgPackages[0].Msi.operation = BOOTSTRAPPER_RELATED_OPERATION_DOWNGRADE; |
| 2242 | 2551 | ||
| 2243 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNINSTALL); | 2552 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNINSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 2244 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 2553 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 2245 | 2554 | ||
| 2246 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); | 2555 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); |
| @@ -2328,7 +2637,7 @@ namespace Bootstrapper | |||
| 2328 | InitializeEngineStateForCorePlan(wzSingleMsiManifestFileName, pEngineState); | 2637 | InitializeEngineStateForCorePlan(wzSingleMsiManifestFileName, pEngineState); |
| 2329 | DetectPackagesAsPresentAndCached(pEngineState); | 2638 | DetectPackagesAsPresentAndCached(pEngineState); |
| 2330 | 2639 | ||
| 2331 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL); | 2640 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 2332 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 2641 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 2333 | 2642 | ||
| 2334 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL, pPlan->action); | 2643 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL, pPlan->action); |
| @@ -2430,7 +2739,7 @@ namespace Bootstrapper | |||
| 2430 | DetectAttachedContainerAsAttached(pEngineState); | 2739 | DetectAttachedContainerAsAttached(pEngineState); |
| 2431 | DetectPackagesAsAbsent(pEngineState); | 2740 | DetectPackagesAsAbsent(pEngineState); |
| 2432 | 2741 | ||
| 2433 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL); | 2742 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 2434 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 2743 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 2435 | 2744 | ||
| 2436 | llPlannedAction = VariableGetNumericHelper(&engineState.variables, BURN_BUNDLE_ACTION); | 2745 | llPlannedAction = VariableGetNumericHelper(&engineState.variables, BURN_BUNDLE_ACTION); |
| @@ -2523,7 +2832,7 @@ namespace Bootstrapper | |||
| 2523 | DetectPermanentPackagesAsPresentAndCached(pEngineState); | 2832 | DetectPermanentPackagesAsPresentAndCached(pEngineState); |
| 2524 | PlanTestDetectPatchInitialize(pEngineState); | 2833 | PlanTestDetectPatchInitialize(pEngineState); |
| 2525 | 2834 | ||
| 2526 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL); | 2835 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 2527 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 2836 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 2528 | 2837 | ||
| 2529 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | 2838 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); |
| @@ -2587,8 +2896,14 @@ namespace Bootstrapper | |||
| 2587 | ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", registerActions1, 1); | 2896 | ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PackageA", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", registerActions1, 1); |
| 2588 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 2897 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
| 2589 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 2898 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
| 2899 | |||
| 2900 | |||
| 2590 | ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PatchA", registerActions1, 1); | 2901 | ValidateExecutePackageProvider(pPlan, fRollback, dwIndex++, L"PatchA", registerActions1, 1); |
| 2902 | |||
| 2903 | |||
| 2591 | 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); | 2904 | 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); |
| 2905 | |||
| 2906 | |||
| 2592 | ValidateExecuteMspTargetPatch(pExecuteAction, 0, L"PatchA"); | 2907 | ValidateExecuteMspTargetPatch(pExecuteAction, 0, L"PatchA"); |
| 2593 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); | 2908 | ValidateExecuteCheckpoint(pPlan, fRollback, dwIndex++, dwExecuteCheckpointId++); |
| 2594 | ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PatchA", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", registerActions1, 1); | 2909 | ValidateExecutePackageDependency(pPlan, fRollback, dwIndex++, L"PatchA", L"{22D1DDBA-284D-40A7-BD14-95EA07906F21}", registerActions1, 1); |
| @@ -2654,7 +2969,7 @@ namespace Bootstrapper | |||
| 2654 | InitializeEngineStateForCorePlan(wzSlipstreamManifestFileName, pEngineState); | 2969 | InitializeEngineStateForCorePlan(wzSlipstreamManifestFileName, pEngineState); |
| 2655 | DetectPackagesAsPresentAndCached(pEngineState); | 2970 | DetectPackagesAsPresentAndCached(pEngineState); |
| 2656 | 2971 | ||
| 2657 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNINSTALL); | 2972 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNINSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 2658 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 2973 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 2659 | 2974 | ||
| 2660 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); | 2975 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); |
| @@ -2784,7 +3099,7 @@ namespace Bootstrapper | |||
| 2784 | vfUsePackageRequestState = TRUE; | 3099 | vfUsePackageRequestState = TRUE; |
| 2785 | vPackageRequestState = BOOTSTRAPPER_REQUEST_STATE_FORCE_ABSENT; | 3100 | vPackageRequestState = BOOTSTRAPPER_REQUEST_STATE_FORCE_ABSENT; |
| 2786 | 3101 | ||
| 2787 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNINSTALL); | 3102 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_UNINSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 2788 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 3103 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 2789 | 3104 | ||
| 2790 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); | 3105 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_UNINSTALL, pPlan->action); |
| @@ -2885,7 +3200,7 @@ namespace Bootstrapper | |||
| 2885 | InitializeEngineStateForCorePlan(wzSlipstreamModifiedManifestFileName, pEngineState); | 3200 | InitializeEngineStateForCorePlan(wzSlipstreamModifiedManifestFileName, pEngineState); |
| 2886 | DetectPackagesAsAbsent(pEngineState); | 3201 | DetectPackagesAsAbsent(pEngineState); |
| 2887 | 3202 | ||
| 2888 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL); | 3203 | hr = CorePlan(pEngineState, BOOTSTRAPPER_ACTION_INSTALL, BOOTSTRAPPER_SCOPE_DEFAULT); |
| 2889 | NativeAssert::Succeeded(hr, "CorePlan failed"); | 3204 | NativeAssert::Succeeded(hr, "CorePlan failed"); |
| 2890 | 3205 | ||
| 2891 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); | 3206 | Assert::Equal<DWORD>(BOOTSTRAPPER_ACTION_INSTALL, pPlan->action); |
| @@ -3031,7 +3346,7 @@ namespace Bootstrapper | |||
| 3031 | Assert::True(FileExistsEx(sczFilePath, NULL), "Test file does not exist."); | 3346 | Assert::True(FileExistsEx(sczFilePath, NULL), "Test file does not exist."); |
| 3032 | 3347 | ||
| 3033 | hr = ManifestLoadXmlFromFile(sczFilePath, pEngineState); | 3348 | hr = ManifestLoadXmlFromFile(sczFilePath, pEngineState); |
| 3034 | NativeAssert::Succeeded(hr, "Failed to load manifest."); | 3349 | NativeAssert::Succeeded(hr, "Failed to load test manifest."); |
| 3035 | } | 3350 | } |
| 3036 | finally | 3351 | finally |
| 3037 | { | 3352 | { |
| @@ -3222,7 +3537,7 @@ namespace Bootstrapper | |||
| 3222 | for (DWORD j = 0; j < pPackage->Msi.cSlipstreamMspPackages; ++j) | 3537 | for (DWORD j = 0; j < pPackage->Msi.cSlipstreamMspPackages; ++j) |
| 3223 | { | 3538 | { |
| 3224 | BURN_PACKAGE* pMspPackage = pPackage->Msi.rgSlipstreamMsps[j].pMspPackage; | 3539 | BURN_PACKAGE* pMspPackage = pPackage->Msi.rgSlipstreamMsps[j].pMspPackage; |
| 3225 | MspEngineAddDetectedTargetProduct(&pEngineState->packages, pMspPackage, j, pPackage->Msi.sczProductCode, pPackage->fPerMachine ? MSIINSTALLCONTEXT_MACHINE : MSIINSTALLCONTEXT_USERUNMANAGED); | 3540 | MspEngineAddDetectedTargetProduct(&pEngineState->packages, pMspPackage, j, pPackage->Msi.sczProductCode, pPackage->scope == BOOTSTRAPPER_PACKAGE_SCOPE_PER_MACHINE ? MSIINSTALLCONTEXT_MACHINE : MSIINSTALLCONTEXT_USERUNMANAGED); |
| 3226 | 3541 | ||
| 3227 | BURN_MSPTARGETPRODUCT* pTargetProduct = pMspPackage->Msp.rgTargetProducts + (pMspPackage->Msp.cTargetProductCodes - 1); | 3542 | BURN_MSPTARGETPRODUCT* pTargetProduct = pMspPackage->Msp.rgTargetProducts + (pMspPackage->Msp.cTargetProductCodes - 1); |
| 3228 | pTargetProduct->patchPackageState = BOOTSTRAPPER_PACKAGE_STATE_PRESENT; | 3543 | pTargetProduct->patchPackageState = BOOTSTRAPPER_PACKAGE_STATE_PRESENT; |
| @@ -3759,8 +4074,8 @@ namespace Bootstrapper | |||
| 3759 | void ValidatePlannedProvider( | 4074 | void ValidatePlannedProvider( |
| 3760 | __in BURN_PLAN* pPlan, | 4075 | __in BURN_PLAN* pPlan, |
| 3761 | __in UINT uIndex, | 4076 | __in UINT uIndex, |
| 3762 | __in LPCWSTR wzKey, | 4077 | __in_z LPCWSTR wzKey, |
| 3763 | __in LPCWSTR wzName | 4078 | __in_z_opt LPCWSTR wzName |
| 3764 | ) | 4079 | ) |
| 3765 | { | 4080 | { |
| 3766 | Assert::InRange(uIndex + 1u, 1u, pPlan->cPlannedProviders); | 4081 | Assert::InRange(uIndex + 1u, 1u, pPlan->cPlannedProviders); |
| @@ -3811,8 +4126,6 @@ namespace Bootstrapper | |||
| 3811 | } | 4126 | } |
| 3812 | } | 4127 | } |
| 3813 | } | 4128 | } |
| 3814 | } | ||
| 3815 | } | ||
| 3816 | 4129 | ||
| 3817 | #if TODO_REIMPLEMENT | 4130 | #if TODO_REIMPLEMENT |
| 3818 | 4131 | ||
