summaryrefslogtreecommitdiff
path: root/src/ext/Bal/dnchost/dnchost.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ext/Bal/dnchost/dnchost.cpp')
-rw-r--r--src/ext/Bal/dnchost/dnchost.cpp27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/ext/Bal/dnchost/dnchost.cpp b/src/ext/Bal/dnchost/dnchost.cpp
index dcc9fa56..644ba30e 100644
--- a/src/ext/Bal/dnchost/dnchost.cpp
+++ b/src/ext/Bal/dnchost/dnchost.cpp
@@ -168,21 +168,16 @@ static HRESULT LoadDncConfiguration(
168 IXMLDOMNode* pixnHost = NULL; 168 IXMLDOMNode* pixnHost = NULL;
169 LPWSTR sczPayloadName = NULL; 169 LPWSTR sczPayloadName = NULL;
170 DWORD dwBool = 0; 170 DWORD dwBool = 0;
171 BOOL fXmlFound = FALSE;
171 172
172 hr = XmlLoadDocumentFromFile(pArgs->pCommand->wzBootstrapperApplicationDataPath, &pixdManifest); 173 hr = XmlLoadDocumentFromFile(pArgs->pCommand->wzBootstrapperApplicationDataPath, &pixdManifest);
173 BalExitOnFailure(hr, "Failed to load BalManifest '%ls'", pArgs->pCommand->wzBootstrapperApplicationDataPath); 174 BalExitOnFailure(hr, "Failed to load BalManifest '%ls'", pArgs->pCommand->wzBootstrapperApplicationDataPath);
174 175
175 hr = XmlSelectSingleNode(pixdManifest, L"/BootstrapperApplicationData/WixBalBAFactoryAssembly", &pixnHost); 176 hr = XmlSelectSingleNode(pixdManifest, L"/BootstrapperApplicationData/WixBalBAFactoryAssembly", &pixnHost);
176 BalExitOnFailure(hr, "Failed to get WixBalBAFactoryAssembly element."); 177 BalExitOnRequiredXmlQueryFailure(hr, "Failed to get WixBalBAFactoryAssembly element.");
177
178 if (S_FALSE == hr)
179 {
180 hr = E_NOTFOUND;
181 BalExitOnRootFailure(hr, "Failed to find WixBalBAFactoryAssembly element in bootstrapper application config.");
182 }
183 178
184 hr = XmlGetAttributeEx(pixnHost, L"FilePath", &sczPayloadName); 179 hr = XmlGetAttributeEx(pixnHost, L"FilePath", &sczPayloadName);
185 BalExitOnFailure(hr, "Failed to get WixBalBAFactoryAssembly/@FilePath."); 180 BalExitOnRequiredXmlQueryFailure(hr, "Failed to get WixBalBAFactoryAssembly/@FilePath.");
186 181
187 hr = PathConcat(pArgs->pCommand->wzBootstrapperWorkingFolder, sczPayloadName, &pState->sczBaFactoryAssemblyPath); 182 hr = PathConcat(pArgs->pCommand->wzBootstrapperWorkingFolder, sczPayloadName, &pState->sczBaFactoryAssemblyPath);
188 BalExitOnFailure(hr, "Failed to create BaFactoryAssemblyPath."); 183 BalExitOnFailure(hr, "Failed to create BaFactoryAssemblyPath.");
@@ -212,22 +207,20 @@ static HRESULT LoadDncConfiguration(
212 pState->type = DNCHOSTTYPE_FDD; 207 pState->type = DNCHOSTTYPE_FDD;
213 208
214 hr = XmlSelectSingleNode(pixdManifest, L"/BootstrapperApplicationData/WixDncOptions", &pixnHost); 209 hr = XmlSelectSingleNode(pixdManifest, L"/BootstrapperApplicationData/WixDncOptions", &pixnHost);
215 if (S_FALSE == hr) 210 BalExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to find WixDncOptions element in bootstrapper application config.");
211
212 if (!fXmlFound)
216 { 213 {
217 ExitFunction1(hr = S_OK); 214 ExitFunction();
218 } 215 }
219 BalExitOnFailure(hr, "Failed to find WixDncOptions element in bootstrapper application config.");
220 216
221 hr = XmlGetAttributeNumber(pixnHost, L"SelfContainedDeployment", &dwBool); 217 hr = XmlGetAttributeNumber(pixnHost, L"SelfContainedDeployment", &dwBool);
222 if (S_FALSE == hr) 218 BalExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to get SelfContainedDeployment value.");
223 { 219
224 hr = S_OK; 220 if (fXmlFound && dwBool)
225 }
226 else if (SUCCEEDED(hr) && dwBool)
227 { 221 {
228 pState->type = DNCHOSTTYPE_SCD; 222 pState->type = DNCHOSTTYPE_SCD;
229 } 223 }
230 BalExitOnFailure(hr, "Failed to get SelfContainedDeployment value.");
231 224
232LExit: 225LExit:
233 ReleaseStr(sczPayloadName); 226 ReleaseStr(sczPayloadName);