aboutsummaryrefslogtreecommitdiff
path: root/src/burn/engine/package.cpp
diff options
context:
space:
mode:
authorNir Bar <nir.bar@panel-sw.co.il>2021-08-12 14:16:01 -0500
committerSean Hall <r.sean.hall@gmail.com>2021-08-12 14:50:55 -0500
commitbb18c9c4f0e6da640775b85ebda68b31f2b391ed (patch)
tree5ce6107321293f7af7a0504588e3d0c6642472ff /src/burn/engine/package.cpp
parent0042e3d4554a0d92e1da6141854b0f1aafa07d5b (diff)
downloadwix-bb18c9c4f0e6da640775b85ebda68b31f2b391ed.tar.gz
wix-bb18c9c4f0e6da640775b85ebda68b31f2b391ed.tar.bz2
wix-bb18c9c4f0e6da640775b85ebda68b31f2b391ed.zip
Set the log file path for MSI transactions.
Diffstat (limited to 'src/burn/engine/package.cpp')
-rw-r--r--src/burn/engine/package.cpp62
1 files changed, 30 insertions, 32 deletions
diff --git a/src/burn/engine/package.cpp b/src/burn/engine/package.cpp
index cd871bc5..bea48cb5 100644
--- a/src/burn/engine/package.cpp
+++ b/src/burn/engine/package.cpp
@@ -36,6 +36,7 @@ extern "C" HRESULT PackagesParseFromXml(
36 BSTR bstrNodeName = NULL; 36 BSTR bstrNodeName = NULL;
37 DWORD cMspPackages = 0; 37 DWORD cMspPackages = 0;
38 LPWSTR scz = NULL; 38 LPWSTR scz = NULL;
39 BOOL fFoundXml = FALSE;
39 40
40 // select rollback boundary nodes 41 // select rollback boundary nodes
41 hr = XmlSelectNodes(pixnBundle, L"RollbackBoundary", &pixnNodes); 42 hr = XmlSelectNodes(pixnBundle, L"RollbackBoundary", &pixnNodes);
@@ -63,15 +64,19 @@ extern "C" HRESULT PackagesParseFromXml(
63 64
64 // @Id 65 // @Id
65 hr = XmlGetAttributeEx(pixnNode, L"Id", &pRollbackBoundary->sczId); 66 hr = XmlGetAttributeEx(pixnNode, L"Id", &pRollbackBoundary->sczId);
66 ExitOnFailure(hr, "Failed to get @Id."); 67 ExitOnRequiredXmlQueryFailure(hr, "Failed to get @Id.");
67 68
68 // @Vital 69 // @Vital
69 hr = XmlGetYesNoAttribute(pixnNode, L"Vital", &pRollbackBoundary->fVital); 70 hr = XmlGetYesNoAttribute(pixnNode, L"Vital", &pRollbackBoundary->fVital);
70 ExitOnFailure(hr, "Failed to get @Vital."); 71 ExitOnRequiredXmlQueryFailure(hr, "Failed to get @Vital.");
71 72
72 // @Transaction 73 // @Transaction
73 hr = XmlGetYesNoAttribute(pixnNode, L"Transaction", &pRollbackBoundary->fTransactionAuthored); 74 hr = XmlGetYesNoAttribute(pixnNode, L"Transaction", &pRollbackBoundary->fTransactionAuthored);
74 ExitOnFailure(hr, "Failed to get @Transaction."); 75 ExitOnRequiredXmlQueryFailure(hr, "Failed to get @Transaction.");
76
77 // @LogPathVariable
78 hr = XmlGetAttributeEx(pixnNode, L"LogPathVariable", &pRollbackBoundary->sczLogPathVariable);
79 ExitOnOptionalXmlQueryFailure(hr, fFoundXml, "Failed to get @LogPathVariable.");
75 80
76 // prepare next iteration 81 // prepare next iteration
77 ReleaseNullObject(pixnNode); 82 ReleaseNullObject(pixnNode);
@@ -110,11 +115,13 @@ extern "C" HRESULT PackagesParseFromXml(
110 115
111 // @Id 116 // @Id
112 hr = XmlGetAttributeEx(pixnNode, L"Id", &pPackage->sczId); 117 hr = XmlGetAttributeEx(pixnNode, L"Id", &pPackage->sczId);
113 ExitOnFailure(hr, "Failed to get @Id."); 118 ExitOnRequiredXmlQueryFailure(hr, "Failed to get @Id.");
114 119
115 // @Cache 120 // @Cache
116 hr = XmlGetAttributeEx(pixnNode, L"Cache", &scz); 121 hr = XmlGetAttributeEx(pixnNode, L"Cache", &scz);
117 if (SUCCEEDED(hr)) 122 ExitOnOptionalXmlQueryFailure(hr, fFoundXml, "Failed to get @Cache.");
123
124 if (fFoundXml)
118 { 125 {
119 if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, scz, -1, L"remove", -1)) 126 if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, scz, -1, L"remove", -1))
120 { 127 {
@@ -134,72 +141,62 @@ extern "C" HRESULT PackagesParseFromXml(
134 ExitOnRootFailure(hr, "Invalid cache type: %ls", scz); 141 ExitOnRootFailure(hr, "Invalid cache type: %ls", scz);
135 } 142 }
136 } 143 }
137 ExitOnFailure(hr, "Failed to get @Cache.");
138 144
139 // @CacheId 145 // @CacheId
140 hr = XmlGetAttributeEx(pixnNode, L"CacheId", &pPackage->sczCacheId); 146 hr = XmlGetAttributeEx(pixnNode, L"CacheId", &pPackage->sczCacheId);
141 ExitOnFailure(hr, "Failed to get @CacheId."); 147 ExitOnRequiredXmlQueryFailure(hr, "Failed to get @CacheId.");
142 148
143 // @Size 149 // @Size
144 hr = XmlGetAttributeUInt64(pixnNode, L"Size", &pPackage->qwSize); 150 hr = XmlGetAttributeUInt64(pixnNode, L"Size", &pPackage->qwSize);
145 ExitOnFailure(hr, "Failed to get @Size."); 151 ExitOnOptionalXmlQueryFailure(hr, fFoundXml, "Failed to get @Size.");
146 152
147 // @InstallSize 153 // @InstallSize
148 hr = XmlGetAttributeUInt64(pixnNode, L"InstallSize", &pPackage->qwInstallSize); 154 hr = XmlGetAttributeUInt64(pixnNode, L"InstallSize", &pPackage->qwInstallSize);
149 ExitOnFailure(hr, "Failed to get @InstallSize."); 155 ExitOnOptionalXmlQueryFailure(hr, fFoundXml, "Failed to get @InstallSize.");
150 156
151 // @PerMachine 157 // @PerMachine
152 hr = XmlGetYesNoAttribute(pixnNode, L"PerMachine", &pPackage->fPerMachine); 158 hr = XmlGetYesNoAttribute(pixnNode, L"PerMachine", &pPackage->fPerMachine);
153 ExitOnFailure(hr, "Failed to get @PerMachine."); 159 ExitOnRequiredXmlQueryFailure(hr, "Failed to get @PerMachine.");
154 160
155 // @Permanent 161 // @Permanent
156 hr = XmlGetYesNoAttribute(pixnNode, L"Permanent", &pPackage->fUninstallable); 162 hr = XmlGetYesNoAttribute(pixnNode, L"Permanent", &pPackage->fUninstallable);
157 ExitOnFailure(hr, "Failed to get @Permanent."); 163 ExitOnRequiredXmlQueryFailure(hr, "Failed to get @Permanent.");
158 pPackage->fUninstallable = !pPackage->fUninstallable; // TODO: change "Uninstallable" variable name to permanent, until then Uninstallable is the opposite of Permanent so fix the variable. 164 pPackage->fUninstallable = !pPackage->fUninstallable; // TODO: change "Uninstallable" variable name to permanent, until then Uninstallable is the opposite of Permanent so fix the variable.
159 pPackage->fCanAffectRegistration = pPackage->fUninstallable; 165 pPackage->fCanAffectRegistration = pPackage->fUninstallable;
160 166
161 // @Vital 167 // @Vital
162 hr = XmlGetYesNoAttribute(pixnNode, L"Vital", &pPackage->fVital); 168 hr = XmlGetYesNoAttribute(pixnNode, L"Vital", &pPackage->fVital);
163 ExitOnFailure(hr, "Failed to get @Vital."); 169 ExitOnRequiredXmlQueryFailure(hr, "Failed to get @Vital.");
164 170
165 // @LogPathVariable 171 // @LogPathVariable
166 hr = XmlGetAttributeEx(pixnNode, L"LogPathVariable", &pPackage->sczLogPathVariable); 172 hr = XmlGetAttributeEx(pixnNode, L"LogPathVariable", &pPackage->sczLogPathVariable);
167 if (E_NOTFOUND != hr) 173 ExitOnOptionalXmlQueryFailure(hr, fFoundXml, "Failed to get @LogPathVariable.");
168 {
169 ExitOnFailure(hr, "Failed to get @LogPathVariable.");
170 }
171 174
172 // @RollbackLogPathVariable 175 // @RollbackLogPathVariable
173 hr = XmlGetAttributeEx(pixnNode, L"RollbackLogPathVariable", &pPackage->sczRollbackLogPathVariable); 176 hr = XmlGetAttributeEx(pixnNode, L"RollbackLogPathVariable", &pPackage->sczRollbackLogPathVariable);
174 if (E_NOTFOUND != hr) 177 ExitOnOptionalXmlQueryFailure(hr, fFoundXml, "Failed to get @RollbackLogPathVariable.");
175 {
176 ExitOnFailure(hr, "Failed to get @RollbackLogPathVariable.");
177 }
178 178
179 // @InstallCondition 179 // @InstallCondition
180 hr = XmlGetAttributeEx(pixnNode, L"InstallCondition", &pPackage->sczInstallCondition); 180 hr = XmlGetAttributeEx(pixnNode, L"InstallCondition", &pPackage->sczInstallCondition);
181 if (E_NOTFOUND != hr) 181 ExitOnOptionalXmlQueryFailure(hr, fFoundXml, "Failed to get @InstallCondition.");
182 {
183 ExitOnFailure(hr, "Failed to get @InstallCondition.");
184 }
185 182
186 // @RollbackBoundaryForward 183 // @RollbackBoundaryForward
187 hr = XmlGetAttributeEx(pixnNode, L"RollbackBoundaryForward", &scz); 184 hr = XmlGetAttributeEx(pixnNode, L"RollbackBoundaryForward", &scz);
188 if (E_NOTFOUND != hr) 185 ExitOnOptionalXmlQueryFailure(hr, fFoundXml, "Failed to get @RollbackBoundaryForward.");
189 {
190 ExitOnFailure(hr, "Failed to get @RollbackBoundaryForward.");
191 186
192 hr = FindRollbackBoundaryById(pPackages, scz, &pPackage->pRollbackBoundaryForward); 187 if (fFoundXml)
188 {
189 hr = FindRollbackBoundaryById(pPackages, scz, &pPackage->pRollbackBoundaryForward);
193 ExitOnFailure(hr, "Failed to find forward transaction boundary: %ls", scz); 190 ExitOnFailure(hr, "Failed to find forward transaction boundary: %ls", scz);
194 } 191 }
195 192
196 // @RollbackBoundaryBackward 193 // @RollbackBoundaryBackward
197 hr = XmlGetAttributeEx(pixnNode, L"RollbackBoundaryBackward", &scz); 194 hr = XmlGetAttributeEx(pixnNode, L"RollbackBoundaryBackward", &scz);
198 if (E_NOTFOUND != hr) 195 ExitOnOptionalXmlQueryFailure(hr, fFoundXml, "Failed to get @RollbackBoundaryBackward.");
199 {
200 ExitOnFailure(hr, "Failed to get @RollbackBoundaryBackward.");
201 196
202 hr = FindRollbackBoundaryById(pPackages, scz, &pPackage->pRollbackBoundaryBackward); 197 if (fFoundXml)
198 {
199 hr = FindRollbackBoundaryById(pPackages, scz, &pPackage->pRollbackBoundaryBackward);
203 ExitOnFailure(hr, "Failed to find backward transaction boundary: %ls", scz); 200 ExitOnFailure(hr, "Failed to find backward transaction boundary: %ls", scz);
204 } 201 }
205 202
@@ -378,6 +375,7 @@ extern "C" void PackagesUninitialize(
378 { 375 {
379 ReleaseStr(pPackages->rgRollbackBoundaries[i].sczId); 376 ReleaseStr(pPackages->rgRollbackBoundaries[i].sczId);
380 ReleaseStr(pPackages->rgRollbackBoundaries[i].sczLogPath); 377 ReleaseStr(pPackages->rgRollbackBoundaries[i].sczLogPath);
378 ReleaseStr(pPackages->rgRollbackBoundaries[i].sczLogPathVariable);
381 } 379 }
382 MemFree(pPackages->rgRollbackBoundaries); 380 MemFree(pPackages->rgRollbackBoundaries);
383 } 381 }