diff options
Diffstat (limited to 'src/burn')
-rw-r--r-- | src/burn/engine/bundlepackageengine.cpp | 10 | ||||
-rw-r--r-- | src/burn/engine/core.cpp | 29 | ||||
-rw-r--r-- | src/burn/engine/core.h | 2 | ||||
-rw-r--r-- | src/burn/engine/logging.cpp | 8 | ||||
-rw-r--r-- | src/burn/engine/package.h | 1 | ||||
-rw-r--r-- | src/burn/engine/plan.cpp | 5 | ||||
-rw-r--r-- | src/burn/engine/plan.h | 1 | ||||
-rw-r--r-- | src/burn/engine/registration.cpp | 2 | ||||
-rw-r--r-- | src/burn/test/BurnUnitTest/PlanTest.cpp | 4 |
9 files changed, 60 insertions, 2 deletions
diff --git a/src/burn/engine/bundlepackageengine.cpp b/src/burn/engine/bundlepackageengine.cpp index cb34878f..00cf9454 100644 --- a/src/burn/engine/bundlepackageengine.cpp +++ b/src/burn/engine/bundlepackageengine.cpp | |||
@@ -72,6 +72,10 @@ extern "C" HRESULT BundlePackageEngineParsePackageFromXml( | |||
72 | hr = XmlGetAttributeEx(pixnBundlePackage, L"RepairArguments", &pPackage->Bundle.sczRepairArguments); | 72 | hr = XmlGetAttributeEx(pixnBundlePackage, L"RepairArguments", &pPackage->Bundle.sczRepairArguments); |
73 | ExitOnOptionalXmlQueryFailure(hr, fFoundXml, "Failed to get @RepairArguments."); | 73 | ExitOnOptionalXmlQueryFailure(hr, fFoundXml, "Failed to get @RepairArguments."); |
74 | 74 | ||
75 | // @HideARP | ||
76 | hr = XmlGetYesNoAttribute(pixnBundlePackage, L"HideARP", &pPackage->Bundle.fHideARP); | ||
77 | ExitOnOptionalXmlQueryFailure(hr, fFoundXml, "Failed to get @HideARP."); | ||
78 | |||
75 | // @SupportsBurnProtocol | 79 | // @SupportsBurnProtocol |
76 | hr = XmlGetYesNoAttribute(pixnBundlePackage, L"SupportsBurnProtocol", &pPackage->Bundle.fSupportsBurnProtocol); | 80 | hr = XmlGetYesNoAttribute(pixnBundlePackage, L"SupportsBurnProtocol", &pPackage->Bundle.fSupportsBurnProtocol); |
77 | ExitOnOptionalXmlQueryFailure(hr, fFoundXml, "Failed to get @SupportsBurnProtocol."); | 81 | ExitOnOptionalXmlQueryFailure(hr, fFoundXml, "Failed to get @SupportsBurnProtocol."); |
@@ -870,6 +874,12 @@ static HRESULT ExecuteBundle( | |||
870 | ExitOnFailure(hr, "Failed to append the parent to the command line."); | 874 | ExitOnFailure(hr, "Failed to append the parent to the command line."); |
871 | } | 875 | } |
872 | 876 | ||
877 | if (pPackage->Bundle.fHideARP) | ||
878 | { | ||
879 | hr = StrAllocConcatFormatted(&sczBaseCommand, L" -%ls", BURN_COMMANDLINE_SWITCH_SYSTEM_COMPONENT); | ||
880 | ExitOnFailure(hr, "Failed to append %ls", BURN_COMMANDLINE_SWITCH_SYSTEM_COMPONENT); | ||
881 | } | ||
882 | |||
873 | // Add the list of dependencies to ignore, if any, to the burn command line. | 883 | // Add the list of dependencies to ignore, if any, to the burn command line. |
874 | if (BOOTSTRAPPER_RELATION_CHAIN_PACKAGE == relationType) | 884 | if (BOOTSTRAPPER_RELATION_CHAIN_PACKAGE == relationType) |
875 | { | 885 | { |
diff --git a/src/burn/engine/core.cpp b/src/burn/engine/core.cpp index 0bbf7039..be8c011f 100644 --- a/src/burn/engine/core.cpp +++ b/src/burn/engine/core.cpp | |||
@@ -1044,6 +1044,12 @@ static HRESULT CoreRecreateCommandLine( | |||
1044 | ExitOnFailure(hr, "Failed to append relation type to command-line."); | 1044 | ExitOnFailure(hr, "Failed to append relation type to command-line."); |
1045 | } | 1045 | } |
1046 | 1046 | ||
1047 | if (pInternalCommand->fArpSystemComponent) | ||
1048 | { | ||
1049 | hr = StrAllocConcatFormatted(psczCommandLine, L" /%ls", BURN_COMMANDLINE_SWITCH_SYSTEM_COMPONENT); | ||
1050 | ExitOnFailure(hr, "Failed to append system component to command-line."); | ||
1051 | } | ||
1052 | |||
1047 | if (fPassthrough) | 1053 | if (fPassthrough) |
1048 | { | 1054 | { |
1049 | hr = StrAllocConcatFormatted(psczCommandLine, L" /%ls", BURN_COMMANDLINE_SWITCH_PASSTHROUGH); | 1055 | hr = StrAllocConcatFormatted(psczCommandLine, L" /%ls", BURN_COMMANDLINE_SWITCH_PASSTHROUGH); |
@@ -1633,6 +1639,29 @@ extern "C" HRESULT CoreParseCommandLine( | |||
1633 | } | 1639 | } |
1634 | } | 1640 | } |
1635 | } | 1641 | } |
1642 | else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], lstrlenW(BURN_COMMANDLINE_SWITCH_SYSTEM_COMPONENT), BURN_COMMANDLINE_SWITCH_SYSTEM_COMPONENT, lstrlenW(BURN_COMMANDLINE_SWITCH_SYSTEM_COMPONENT))) | ||
1643 | { | ||
1644 | // Get a pointer to the next character after the switch. | ||
1645 | LPCWSTR wzParam = &argv[i][1 + lstrlenW(BURN_COMMANDLINE_SWITCH_SYSTEM_COMPONENT)]; | ||
1646 | |||
1647 | // Switch without an argument is allowed. An empty string means FALSE, everything else means TRUE. | ||
1648 | if (L'\0' != wzParam[0]) | ||
1649 | { | ||
1650 | if (L'=' != wzParam[0]) | ||
1651 | { | ||
1652 | fInvalidCommandLine = TRUE; | ||
1653 | TraceLog(E_INVALIDARG, "Invalid switch: %ls", argv[i]); | ||
1654 | } | ||
1655 | else | ||
1656 | { | ||
1657 | pInternalCommand->fArpSystemComponent = L'\0' != wzParam[1]; | ||
1658 | } | ||
1659 | } | ||
1660 | else | ||
1661 | { | ||
1662 | pInternalCommand->fArpSystemComponent = TRUE; | ||
1663 | } | ||
1664 | } | ||
1636 | else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, BURN_COMMANDLINE_SWITCH_EMBEDDED, -1)) | 1665 | else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, BURN_COMMANDLINE_SWITCH_EMBEDDED, -1)) |
1637 | { | 1666 | { |
1638 | if (i + 3 >= argc) | 1667 | if (i + 3 >= argc) |
diff --git a/src/burn/engine/core.h b/src/burn/engine/core.h index 556124d6..c04de20a 100644 --- a/src/burn/engine/core.h +++ b/src/burn/engine/core.h | |||
@@ -35,6 +35,7 @@ const LPCWSTR BURN_COMMANDLINE_SWITCH_ANCESTORS = L"burn.ancestors"; | |||
35 | const LPCWSTR BURN_COMMANDLINE_SWITCH_FILEHANDLE_ATTACHED = L"burn.filehandle.attached"; | 35 | const LPCWSTR BURN_COMMANDLINE_SWITCH_FILEHANDLE_ATTACHED = L"burn.filehandle.attached"; |
36 | const LPCWSTR BURN_COMMANDLINE_SWITCH_FILEHANDLE_SELF = L"burn.filehandle.self"; | 36 | const LPCWSTR BURN_COMMANDLINE_SWITCH_FILEHANDLE_SELF = L"burn.filehandle.self"; |
37 | const LPCWSTR BURN_COMMANDLINE_SWITCH_SPLASH_SCREEN = L"burn.splash.screen"; | 37 | const LPCWSTR BURN_COMMANDLINE_SWITCH_SPLASH_SCREEN = L"burn.splash.screen"; |
38 | const LPCWSTR BURN_COMMANDLINE_SWITCH_SYSTEM_COMPONENT = L"burn.system.component"; | ||
38 | const LPCWSTR BURN_COMMANDLINE_SWITCH_PREFIX = L"burn."; | 39 | const LPCWSTR BURN_COMMANDLINE_SWITCH_PREFIX = L"burn."; |
39 | 40 | ||
40 | const LPCWSTR BURN_BUNDLE_LAYOUT_DIRECTORY = L"WixBundleLayoutDirectory"; | 41 | const LPCWSTR BURN_BUNDLE_LAYOUT_DIRECTORY = L"WixBundleLayoutDirectory"; |
@@ -95,6 +96,7 @@ typedef struct _BURN_ENGINE_COMMAND | |||
95 | 96 | ||
96 | BURN_MODE mode; | 97 | BURN_MODE mode; |
97 | BURN_AU_PAUSE_ACTION automaticUpdates; | 98 | BURN_AU_PAUSE_ACTION automaticUpdates; |
99 | BOOL fArpSystemComponent; | ||
98 | BOOL fDisableSystemRestore; | 100 | BOOL fDisableSystemRestore; |
99 | BOOL fInitiallyElevated; | 101 | BOOL fInitiallyElevated; |
100 | 102 | ||
diff --git a/src/burn/engine/logging.cpp b/src/burn/engine/logging.cpp index a766b896..0b510f3d 100644 --- a/src/burn/engine/logging.cpp +++ b/src/burn/engine/logging.cpp | |||
@@ -752,8 +752,16 @@ extern "C" LPCSTR LoggingRegistrationOptionsToString( | |||
752 | return "CacheBundle"; | 752 | return "CacheBundle"; |
753 | case BURN_REGISTRATION_ACTION_OPERATIONS_WRITE_PROVIDER_KEY: | 753 | case BURN_REGISTRATION_ACTION_OPERATIONS_WRITE_PROVIDER_KEY: |
754 | return "WriteProviderKey"; | 754 | return "WriteProviderKey"; |
755 | case BURN_REGISTRATION_ACTION_OPERATIONS_ARP_SYSTEM_COMPONENT: | ||
756 | return "ArpSystemComponent"; | ||
755 | case BURN_REGISTRATION_ACTION_OPERATIONS_CACHE_BUNDLE + BURN_REGISTRATION_ACTION_OPERATIONS_WRITE_PROVIDER_KEY: | 757 | case BURN_REGISTRATION_ACTION_OPERATIONS_CACHE_BUNDLE + BURN_REGISTRATION_ACTION_OPERATIONS_WRITE_PROVIDER_KEY: |
756 | return "CacheBundle, WriteProviderKey"; | 758 | return "CacheBundle, WriteProviderKey"; |
759 | case BURN_REGISTRATION_ACTION_OPERATIONS_CACHE_BUNDLE + BURN_REGISTRATION_ACTION_OPERATIONS_ARP_SYSTEM_COMPONENT: | ||
760 | return "CacheBundle, ArpSystemComponent"; | ||
761 | case BURN_REGISTRATION_ACTION_OPERATIONS_WRITE_PROVIDER_KEY + BURN_REGISTRATION_ACTION_OPERATIONS_ARP_SYSTEM_COMPONENT: | ||
762 | return "WriteProviderKey, ArpSystemComponent"; | ||
763 | case BURN_REGISTRATION_ACTION_OPERATIONS_CACHE_BUNDLE + BURN_REGISTRATION_ACTION_OPERATIONS_WRITE_PROVIDER_KEY + BURN_REGISTRATION_ACTION_OPERATIONS_ARP_SYSTEM_COMPONENT: | ||
764 | return "CacheBundle, WriteProviderKey, ArpSystemComponent"; | ||
757 | default: | 765 | default: |
758 | return "Invalid"; | 766 | return "Invalid"; |
759 | } | 767 | } |
diff --git a/src/burn/engine/package.h b/src/burn/engine/package.h index 4021031f..eb8e7543 100644 --- a/src/burn/engine/package.h +++ b/src/burn/engine/package.h | |||
@@ -321,6 +321,7 @@ typedef struct _BURN_PACKAGE | |||
321 | LPWSTR* rgsczPatchCodes; | 321 | LPWSTR* rgsczPatchCodes; |
322 | DWORD cPatchCodes; | 322 | DWORD cPatchCodes; |
323 | 323 | ||
324 | BOOL fHideARP; | ||
324 | BOOL fWin64; | 325 | BOOL fWin64; |
325 | BOOL fSupportsBurnProtocol; | 326 | BOOL fSupportsBurnProtocol; |
326 | 327 | ||
diff --git a/src/burn/engine/plan.cpp b/src/burn/engine/plan.cpp index 183ac62a..2c267415 100644 --- a/src/burn/engine/plan.cpp +++ b/src/burn/engine/plan.cpp | |||
@@ -581,6 +581,11 @@ extern "C" HRESULT PlanRegistration( | |||
581 | pPlan->dwRegistrationOperations |= BURN_REGISTRATION_ACTION_OPERATIONS_CACHE_BUNDLE; | 581 | pPlan->dwRegistrationOperations |= BURN_REGISTRATION_ACTION_OPERATIONS_CACHE_BUNDLE; |
582 | } | 582 | } |
583 | 583 | ||
584 | if (pPlan->pInternalCommand->fArpSystemComponent) | ||
585 | { | ||
586 | pPlan->dwRegistrationOperations |= BURN_REGISTRATION_ACTION_OPERATIONS_ARP_SYSTEM_COMPONENT; | ||
587 | } | ||
588 | |||
584 | if (BOOTSTRAPPER_ACTION_UNINSTALL == pPlan->action || BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL == pPlan->action) | 589 | if (BOOTSTRAPPER_ACTION_UNINSTALL == pPlan->action || BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL == pPlan->action) |
585 | { | 590 | { |
586 | // If our provider key was not owned by a different bundle, | 591 | // If our provider key was not owned by a different bundle, |
diff --git a/src/burn/engine/plan.h b/src/burn/engine/plan.h index a8b16705..87214cc8 100644 --- a/src/burn/engine/plan.h +++ b/src/burn/engine/plan.h | |||
@@ -16,6 +16,7 @@ enum BURN_REGISTRATION_ACTION_OPERATIONS | |||
16 | BURN_REGISTRATION_ACTION_OPERATIONS_NONE = 0x0, | 16 | BURN_REGISTRATION_ACTION_OPERATIONS_NONE = 0x0, |
17 | BURN_REGISTRATION_ACTION_OPERATIONS_CACHE_BUNDLE = 0x1, | 17 | BURN_REGISTRATION_ACTION_OPERATIONS_CACHE_BUNDLE = 0x1, |
18 | BURN_REGISTRATION_ACTION_OPERATIONS_WRITE_PROVIDER_KEY = 0x2, | 18 | BURN_REGISTRATION_ACTION_OPERATIONS_WRITE_PROVIDER_KEY = 0x2, |
19 | BURN_REGISTRATION_ACTION_OPERATIONS_ARP_SYSTEM_COMPONENT = 0x4, | ||
19 | }; | 20 | }; |
20 | 21 | ||
21 | enum BURN_DEPENDENT_REGISTRATION_ACTION_TYPE | 22 | enum BURN_DEPENDENT_REGISTRATION_ACTION_TYPE |
diff --git a/src/burn/engine/registration.cpp b/src/burn/engine/registration.cpp index 961e86bc..0ffbc89e 100644 --- a/src/burn/engine/registration.cpp +++ b/src/burn/engine/registration.cpp | |||
@@ -767,7 +767,7 @@ extern "C" HRESULT RegistrationSessionBegin( | |||
767 | } | 767 | } |
768 | 768 | ||
769 | // Conditionally hide the ARP entry. | 769 | // Conditionally hide the ARP entry. |
770 | if (pRegistration->fForceSystemComponent) | 770 | if (pRegistration->fForceSystemComponent || (dwRegistrationOptions & BURN_REGISTRATION_ACTION_OPERATIONS_ARP_SYSTEM_COMPONENT)) |
771 | { | 771 | { |
772 | hr = RegWriteNumber(hkRegistration, REGISTRY_BUNDLE_SYSTEM_COMPONENT, 1); | 772 | hr = RegWriteNumber(hkRegistration, REGISTRY_BUNDLE_SYSTEM_COMPONENT, 1); |
773 | ExitOnFailure(hr, "Failed to write %ls value.", REGISTRY_BUNDLE_SYSTEM_COMPONENT); | 773 | ExitOnFailure(hr, "Failed to write %ls value.", REGISTRY_BUNDLE_SYSTEM_COMPONENT); |
diff --git a/src/burn/test/BurnUnitTest/PlanTest.cpp b/src/burn/test/BurnUnitTest/PlanTest.cpp index 26e7dfd2..87bbbffd 100644 --- a/src/burn/test/BurnUnitTest/PlanTest.cpp +++ b/src/burn/test/BurnUnitTest/PlanTest.cpp | |||
@@ -1232,6 +1232,8 @@ namespace Bootstrapper | |||
1232 | BURN_ENGINE_STATE* pEngineState = &engineState; | 1232 | BURN_ENGINE_STATE* pEngineState = &engineState; |
1233 | BURN_PLAN* pPlan = &engineState.plan; | 1233 | BURN_PLAN* pPlan = &engineState.plan; |
1234 | 1234 | ||
1235 | pEngineState->internalCommand.fArpSystemComponent = TRUE; | ||
1236 | |||
1235 | InitializeEngineStateForCorePlan(wzSingleMsiManifestFileName, pEngineState); | 1237 | InitializeEngineStateForCorePlan(wzSingleMsiManifestFileName, pEngineState); |
1236 | DetectAttachedContainerAsAttached(pEngineState); | 1238 | DetectAttachedContainerAsAttached(pEngineState); |
1237 | DetectPackagesAsAbsent(pEngineState); | 1239 | DetectPackagesAsAbsent(pEngineState); |
@@ -1249,7 +1251,7 @@ namespace Bootstrapper | |||
1249 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); | 1251 | Assert::Equal<BOOL>(FALSE, pPlan->fDisableRollback); |
1250 | Assert::Equal<BOOL>(FALSE, pPlan->fDisallowRemoval); | 1252 | Assert::Equal<BOOL>(FALSE, pPlan->fDisallowRemoval); |
1251 | Assert::Equal<BOOL>(FALSE, pPlan->fDowngrade); | 1253 | Assert::Equal<BOOL>(FALSE, pPlan->fDowngrade); |
1252 | Assert::Equal<DWORD>(BURN_REGISTRATION_ACTION_OPERATIONS_CACHE_BUNDLE | BURN_REGISTRATION_ACTION_OPERATIONS_WRITE_PROVIDER_KEY, pPlan->dwRegistrationOperations); | 1254 | Assert::Equal<DWORD>(BURN_REGISTRATION_ACTION_OPERATIONS_CACHE_BUNDLE | BURN_REGISTRATION_ACTION_OPERATIONS_WRITE_PROVIDER_KEY | BURN_REGISTRATION_ACTION_OPERATIONS_ARP_SYSTEM_COMPONENT, pPlan->dwRegistrationOperations); |
1253 | 1255 | ||
1254 | BOOL fRollback = FALSE; | 1256 | BOOL fRollback = FALSE; |
1255 | DWORD dwIndex = 0; | 1257 | DWORD dwIndex = 0; |