aboutsummaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
authorBob Arnson <bob@firegiant.com>2026-07-25 22:01:07 -0400
committerBob Arnson <github@bobs.org>2026-07-26 10:15:34 -0400
commitccfda4f4a158b19f61b018b944eb86272f427f55 (patch)
tree28460c23c443fff9811b3093243b1557ab4a35d8 /src/api
parent3b6428b593ff4b8e1ca5e9c2240d539751a96c9a (diff)
downloadwix-ccfda4f4a158b19f61b018b944eb86272f427f55.tar.gz
wix-ccfda4f4a158b19f61b018b944eb86272f427f55.tar.bz2
wix-ccfda4f4a158b19f61b018b944eb86272f427f55.zip
Add UAC shield for fixed-scope per-machine bundles
Fixes https://github.com/wixtoolset/issues/issues/9321
Diffstat (limited to 'src/api')
-rw-r--r--src/api/burn/balutil/balinfo.cpp23
-rw-r--r--src/api/burn/balutil/inc/balinfo.h2
2 files changed, 22 insertions, 3 deletions
diff --git a/src/api/burn/balutil/balinfo.cpp b/src/api/burn/balutil/balinfo.cpp
index ff0dfd9f..bff848c7 100644
--- a/src/api/burn/balutil/balinfo.cpp
+++ b/src/api/burn/balutil/balinfo.cpp
@@ -124,14 +124,32 @@ DAPI_(HRESULT) BalInfoParseFromXml(
124 HRESULT hr = S_OK; 124 HRESULT hr = S_OK;
125 IXMLDOMNode* pNode = NULL; 125 IXMLDOMNode* pNode = NULL;
126 BOOL fXmlFound = FALSE; 126 BOOL fXmlFound = FALSE;
127 LPWSTR scz = NULL;
127 128
128 hr = XmlSelectSingleNode(pixdManifest, L"/BootstrapperApplicationData/WixBundleProperties", &pNode); 129 hr = XmlSelectSingleNode(pixdManifest, L"/BootstrapperApplicationData/WixBundleProperties", &pNode);
129 BalExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to select bundle information."); 130 BalExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to select bundle information.");
130 131
131 if (fXmlFound) 132 if (fXmlFound)
132 { 133 {
133 hr = XmlGetYesNoAttribute(pNode, L"PerMachine", &pBundle->fPerMachine); 134 hr = XmlGetAttributeEx(pNode, L"Scope", &scz);
134 BalExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to read bundle information per-machine."); 135 BalExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to read bundle information scope.");
136
137 if (CSTR_EQUAL == ::CompareStringOrdinal(scz, -1, L"perMachine", -1, TRUE))
138 {
139 pBundle->scope = BOOTSTRAPPER_PACKAGE_SCOPE_PER_MACHINE;
140 }
141 else if (CSTR_EQUAL == ::CompareStringOrdinal(scz, -1, L"perUser", -1, TRUE))
142 {
143 pBundle->scope = BOOTSTRAPPER_PACKAGE_SCOPE_PER_USER;
144 }
145 else if (CSTR_EQUAL == ::CompareStringOrdinal(scz, -1, L"perUserOrMachine", -1, TRUE))
146 {
147 pBundle->scope = BOOTSTRAPPER_PACKAGE_SCOPE_PER_USER_OR_PER_MACHINE;
148 }
149 else if (CSTR_EQUAL == ::CompareStringOrdinal(scz, -1, L"perMachineOrUser", -1, TRUE))
150 {
151 pBundle->scope = BOOTSTRAPPER_PACKAGE_SCOPE_PER_MACHINE_OR_PER_USER;
152 }
135 153
136 hr = XmlGetAttributeEx(pNode, L"DisplayName", &pBundle->sczName); 154 hr = XmlGetAttributeEx(pNode, L"DisplayName", &pBundle->sczName);
137 BalExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to read bundle information display name."); 155 BalExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to read bundle information display name.");
@@ -150,6 +168,7 @@ DAPI_(HRESULT) BalInfoParseFromXml(
150 BalExitOnFailure(hr, "Failed to parse bal package information from bootstrapper application data."); 168 BalExitOnFailure(hr, "Failed to parse bal package information from bootstrapper application data.");
151 169
152LExit: 170LExit:
171 ReleaseStr(scz);
153 ReleaseObject(pNode); 172 ReleaseObject(pNode);
154 173
155 return hr; 174 return hr;
diff --git a/src/api/burn/balutil/inc/balinfo.h b/src/api/burn/balutil/inc/balinfo.h
index 8baee844..110fb688 100644
--- a/src/api/burn/balutil/inc/balinfo.h
+++ b/src/api/burn/balutil/inc/balinfo.h
@@ -93,7 +93,7 @@ typedef struct _BAL_INFO_OVERRIDABLE_VARIABLES
93 93
94typedef struct _BAL_INFO_BUNDLE 94typedef struct _BAL_INFO_BUNDLE
95{ 95{
96 BOOL fPerMachine; 96 BOOTSTRAPPER_PACKAGE_SCOPE scope;
97 LPWSTR sczName; 97 LPWSTR sczName;
98 LPWSTR sczLogVariable; 98 LPWSTR sczLogVariable;
99 BAL_INFO_PACKAGES packages; 99 BAL_INFO_PACKAGES packages;