diff options
author | Bob Arnson <bob@joyofsetup.com> | 2020-03-05 19:48:12 -0500 |
---|---|---|
committer | Bob Arnson <bob@firegiant.com> | 2020-03-09 12:16:09 -0400 |
commit | e9d10933bedb8215ec50ca85db272d6647426b31 (patch) | |
tree | 262cbaf190de5d5461941c79923bef8cf4cf7ad1 /src/ca/XmlConfig.cpp | |
parent | 7533ca33de2b8125e9f9ecb3b28a247acca85f83 (diff) | |
download | wix-e9d10933bedb8215ec50ca85db272d6647426b31.tar.gz wix-e9d10933bedb8215ec50ca85db272d6647426b31.tar.bz2 wix-e9d10933bedb8215ec50ca85db272d6647426b31.zip |
Version extension ids.
Partial fix for wixtoolset/issues#5933.
Diffstat (limited to 'src/ca/XmlConfig.cpp')
-rw-r--r-- | src/ca/XmlConfig.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/ca/XmlConfig.cpp b/src/ca/XmlConfig.cpp index c12b2bc2..8c60979d 100644 --- a/src/ca/XmlConfig.cpp +++ b/src/ca/XmlConfig.cpp | |||
@@ -30,9 +30,9 @@ enum eXmlPreserveDate | |||
30 | }; | 30 | }; |
31 | 31 | ||
32 | LPCWSTR vcsXmlConfigQuery = | 32 | LPCWSTR vcsXmlConfigQuery = |
33 | L"SELECT `XmlConfig`.`XmlConfig`, `XmlConfig`.`File`, `XmlConfig`.`ElementPath`, `XmlConfig`.`VerifyPath`, `XmlConfig`.`Name`, " | 33 | L"SELECT `Wix4XmlConfig`.`Wix4XmlConfig`, `Wix4XmlConfig`.`File`, `Wix4XmlConfig`.`ElementPath`, `Wix4XmlConfig`.`VerifyPath`, `Wix4XmlConfig`.`Name`, " |
34 | L"`XmlConfig`.`Value`, `XmlConfig`.`Flags`, `XmlConfig`.`Component_`, `Component`.`Attributes` " | 34 | L"`Wix4XmlConfig`.`Value`, `Wix4XmlConfig`.`Flags`, `Wix4XmlConfig`.`Component_`, `Component`.`Attributes` " |
35 | L"FROM `XmlConfig`,`Component` WHERE `XmlConfig`.`Component_`=`Component`.`Component` ORDER BY `File`, `Sequence`"; | 35 | L"FROM `Wix4XmlConfig`,`Component` WHERE `Wix4XmlConfig`.`Component_`=`Component`.`Component` ORDER BY `File`, `Sequence`"; |
36 | enum eXmlConfigQuery { xfqXmlConfig = 1, xfqFile, xfqElementPath, xfqVerifyPath, xfqName, xfqValue, xfqXmlFlags, xfqComponent, xfqCompAttributes }; | 36 | enum eXmlConfigQuery { xfqXmlConfig = 1, xfqFile, xfqElementPath, xfqVerifyPath, xfqName, xfqValue, xfqXmlFlags, xfqComponent, xfqCompAttributes }; |
37 | 37 | ||
38 | struct XML_CONFIG_CHANGE | 38 | struct XML_CONFIG_CHANGE |
@@ -146,7 +146,7 @@ static HRESULT ReadXmlConfigTable( | |||
146 | 146 | ||
147 | // loop through all the xml configurations | 147 | // loop through all the xml configurations |
148 | hr = WcaOpenExecuteView(vcsXmlConfigQuery, &hView); | 148 | hr = WcaOpenExecuteView(vcsXmlConfigQuery, &hView); |
149 | ExitOnFailure(hr, "failed to open view on XmlConfig table"); | 149 | ExitOnFailure(hr, "failed to open view on Wix4XmlConfig table"); |
150 | 150 | ||
151 | while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) | 151 | while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) |
152 | { | 152 | { |
@@ -155,13 +155,13 @@ static HRESULT ReadXmlConfigTable( | |||
155 | 155 | ||
156 | // Get record Id | 156 | // Get record Id |
157 | hr = WcaGetRecordString(hRec, xfqXmlConfig, &pwzData); | 157 | hr = WcaGetRecordString(hRec, xfqXmlConfig, &pwzData); |
158 | ExitOnFailure(hr, "failed to get XmlConfig record Id"); | 158 | ExitOnFailure(hr, "failed to get Wix4XmlConfig record Id"); |
159 | hr = StringCchCopyW((*ppxfcTail)->wzId, countof((*ppxfcTail)->wzId), pwzData); | 159 | hr = StringCchCopyW((*ppxfcTail)->wzId, countof((*ppxfcTail)->wzId), pwzData); |
160 | ExitOnFailure(hr, "failed to copy XmlConfig record Id"); | 160 | ExitOnFailure(hr, "failed to copy Wix4XmlConfig record Id"); |
161 | 161 | ||
162 | // Get component name | 162 | // Get component name |
163 | hr = WcaGetRecordString(hRec, xfqComponent, &pwzData); | 163 | hr = WcaGetRecordString(hRec, xfqComponent, &pwzData); |
164 | ExitOnFailure(hr, "failed to get component name for XmlConfig: %ls", (*ppxfcTail)->wzId); | 164 | ExitOnFailure(hr, "failed to get component name for Wix4XmlConfig: %ls", (*ppxfcTail)->wzId); |
165 | 165 | ||
166 | // Get the component's state | 166 | // Get the component's state |
167 | if (0 < lstrlenW(pwzData)) | 167 | if (0 < lstrlenW(pwzData)) |
@@ -175,45 +175,45 @@ static HRESULT ReadXmlConfigTable( | |||
175 | 175 | ||
176 | // Get the xml file | 176 | // Get the xml file |
177 | hr = WcaGetRecordFormattedString(hRec, xfqFile, &pwzData); | 177 | hr = WcaGetRecordFormattedString(hRec, xfqFile, &pwzData); |
178 | ExitOnFailure(hr, "failed to get xml file for XmlConfig: %ls", (*ppxfcTail)->wzId); | 178 | ExitOnFailure(hr, "failed to get xml file for Wix4XmlConfig: %ls", (*ppxfcTail)->wzId); |
179 | hr = StringCchCopyW((*ppxfcTail)->wzFile, countof((*ppxfcTail)->wzFile), pwzData); | 179 | hr = StringCchCopyW((*ppxfcTail)->wzFile, countof((*ppxfcTail)->wzFile), pwzData); |
180 | ExitOnFailure(hr, "failed to copy xml file path"); | 180 | ExitOnFailure(hr, "failed to copy xml file path"); |
181 | 181 | ||
182 | // Figure out if the file is already on the machine or if it's being installed | 182 | // Figure out if the file is already on the machine or if it's being installed |
183 | hr = WcaGetRecordString(hRec, xfqFile, &pwzData); | 183 | hr = WcaGetRecordString(hRec, xfqFile, &pwzData); |
184 | ExitOnFailure(hr, "failed to get xml file for XmlConfig: %ls", (*ppxfcTail)->wzId); | 184 | ExitOnFailure(hr, "failed to get xml file for Wix4XmlConfig: %ls", (*ppxfcTail)->wzId); |
185 | if (NULL != wcsstr(pwzData, L"[!") || NULL != wcsstr(pwzData, L"[#")) | 185 | if (NULL != wcsstr(pwzData, L"[!") || NULL != wcsstr(pwzData, L"[#")) |
186 | { | 186 | { |
187 | (*ppxfcTail)->fInstalledFile = TRUE; | 187 | (*ppxfcTail)->fInstalledFile = TRUE; |
188 | } | 188 | } |
189 | 189 | ||
190 | // Get the XmlConfig table flags | 190 | // Get the Wix4XmlConfig table flags |
191 | hr = WcaGetRecordInteger(hRec, xfqXmlFlags, &(*ppxfcTail)->iXmlFlags); | 191 | hr = WcaGetRecordInteger(hRec, xfqXmlFlags, &(*ppxfcTail)->iXmlFlags); |
192 | ExitOnFailure(hr, "failed to get XmlConfig flags for XmlConfig: %ls", (*ppxfcTail)->wzId); | 192 | ExitOnFailure(hr, "failed to get Wix4XmlConfig flags for Wix4XmlConfig: %ls", (*ppxfcTail)->wzId); |
193 | 193 | ||
194 | // Get the Element Path | 194 | // Get the Element Path |
195 | hr = WcaGetRecordFormattedString(hRec, xfqElementPath, &(*ppxfcTail)->pwzElementPath); | 195 | hr = WcaGetRecordFormattedString(hRec, xfqElementPath, &(*ppxfcTail)->pwzElementPath); |
196 | ExitOnFailure(hr, "failed to get Element Path for XmlConfig: %ls", (*ppxfcTail)->wzId); | 196 | ExitOnFailure(hr, "failed to get Element Path for Wix4XmlConfig: %ls", (*ppxfcTail)->wzId); |
197 | 197 | ||
198 | // Get the Verify Path | 198 | // Get the Verify Path |
199 | hr = WcaGetRecordFormattedString(hRec, xfqVerifyPath, &(*ppxfcTail)->pwzVerifyPath); | 199 | hr = WcaGetRecordFormattedString(hRec, xfqVerifyPath, &(*ppxfcTail)->pwzVerifyPath); |
200 | ExitOnFailure(hr, "failed to get Verify Path for XmlConfig: %ls", (*ppxfcTail)->wzId); | 200 | ExitOnFailure(hr, "failed to get Verify Path for Wix4XmlConfig: %ls", (*ppxfcTail)->wzId); |
201 | 201 | ||
202 | // Get the name | 202 | // Get the name |
203 | hr = WcaGetRecordFormattedString(hRec, xfqName, &pwzData); | 203 | hr = WcaGetRecordFormattedString(hRec, xfqName, &pwzData); |
204 | ExitOnFailure(hr, "failed to get Name for XmlConfig: %ls", (*ppxfcTail)->wzId); | 204 | ExitOnFailure(hr, "failed to get Name for Wix4XmlConfig: %ls", (*ppxfcTail)->wzId); |
205 | hr = StringCchCopyW((*ppxfcTail)->wzName, countof((*ppxfcTail)->wzName), pwzData); | 205 | hr = StringCchCopyW((*ppxfcTail)->wzName, countof((*ppxfcTail)->wzName), pwzData); |
206 | ExitOnFailure(hr, "failed to copy name of element"); | 206 | ExitOnFailure(hr, "failed to copy name of element"); |
207 | 207 | ||
208 | // Get the value | 208 | // Get the value |
209 | hr = WcaGetRecordFormattedString(hRec, xfqValue, &pwzData); | 209 | hr = WcaGetRecordFormattedString(hRec, xfqValue, &pwzData); |
210 | ExitOnFailure(hr, "failed to get Value for XmlConfig: %ls", (*ppxfcTail)->wzId); | 210 | ExitOnFailure(hr, "failed to get Value for Wix4XmlConfig: %ls", (*ppxfcTail)->wzId); |
211 | hr = StrAllocString(&(*ppxfcTail)->pwzValue, pwzData, 0); | 211 | hr = StrAllocString(&(*ppxfcTail)->pwzValue, pwzData, 0); |
212 | ExitOnFailure(hr, "failed to allocate buffer for value"); | 212 | ExitOnFailure(hr, "failed to allocate buffer for value"); |
213 | 213 | ||
214 | // Get the component attributes | 214 | // Get the component attributes |
215 | hr = WcaGetRecordInteger(hRec, xfqCompAttributes, &(*ppxfcTail)->iCompAttributes); | 215 | hr = WcaGetRecordInteger(hRec, xfqCompAttributes, &(*ppxfcTail)->iCompAttributes); |
216 | ExitOnFailure(hr, "failed to get component attributes for XmlConfig: %ls", (*ppxfcTail)->wzId); | 216 | ExitOnFailure(hr, "failed to get component attributes for Wix4XmlConfig: %ls", (*ppxfcTail)->wzId); |
217 | } | 217 | } |
218 | 218 | ||
219 | // if we looped through all records all is well | 219 | // if we looped through all records all is well |
@@ -359,7 +359,7 @@ static HRESULT BeginChangeFile( | |||
359 | hr = WcaWriteStreamToCaData(pbData, cbData, &pwzRollbackCustomActionData); | 359 | hr = WcaWriteStreamToCaData(pbData, cbData, &pwzRollbackCustomActionData); |
360 | ExitOnFailure(hr, "failed to write file contents to rollback custom action data."); | 360 | ExitOnFailure(hr, "failed to write file contents to rollback custom action data."); |
361 | 361 | ||
362 | hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"ExecXmlConfigRollback"), pwzRollbackCustomActionData, COST_XMLFILE); | 362 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"ExecXmlConfigRollback"), pwzRollbackCustomActionData, COST_XMLFILE); |
363 | ExitOnFailure(hr, "failed to schedule ExecXmlConfigRollback for file: %ls", pwzFile); | 363 | ExitOnFailure(hr, "failed to schedule ExecXmlConfigRollback for file: %ls", pwzFile); |
364 | 364 | ||
365 | ReleaseStr(pwzRollbackCustomActionData); | 365 | ReleaseStr(pwzRollbackCustomActionData); |
@@ -459,10 +459,10 @@ extern "C" UINT __stdcall SchedXmlConfig( | |||
459 | ExitOnFailure(hr, "failed to initialize"); | 459 | ExitOnFailure(hr, "failed to initialize"); |
460 | 460 | ||
461 | hr = ReadXmlConfigTable(&pxfcHead, &pxfcTail); | 461 | hr = ReadXmlConfigTable(&pxfcHead, &pxfcTail); |
462 | MessageExitOnFailure(hr, msierrXmlConfigFailedRead, "failed to read XmlConfig table"); | 462 | MessageExitOnFailure(hr, msierrXmlConfigFailedRead, "failed to read Wix4XmlConfig table"); |
463 | 463 | ||
464 | hr = ProcessChanges(&pxfcHead); | 464 | hr = ProcessChanges(&pxfcHead); |
465 | ExitOnFailure(hr, "failed to process XmlConfig changes"); | 465 | ExitOnFailure(hr, "failed to process Wix4XmlConfig changes"); |
466 | 466 | ||
467 | // loop through all the xml configurations | 467 | // loop through all the xml configurations |
468 | for (pxfc = pxfcHead; pxfc; pxfc = pxfc->pxfcNext) | 468 | for (pxfc = pxfcHead; pxfc; pxfc = pxfc->pxfcNext) |
@@ -557,7 +557,7 @@ extern "C" UINT __stdcall SchedXmlConfig( | |||
557 | { | 557 | { |
558 | Assert(0 < cFiles); | 558 | Assert(0 < cFiles); |
559 | 559 | ||
560 | hr = WcaDoDeferredAction(PLATFORM_DECORATION(L"ExecXmlConfig"), pwzCustomActionData, cFiles * COST_XMLFILE); | 560 | hr = WcaDoDeferredAction(CUSTOM_ACTION_DECORATION(L"ExecXmlConfig"), pwzCustomActionData, cFiles * COST_XMLFILE); |
561 | ExitOnFailure(hr, "failed to schedule ExecXmlConfig action"); | 561 | ExitOnFailure(hr, "failed to schedule ExecXmlConfig action"); |
562 | } | 562 | } |
563 | 563 | ||