diff options
Diffstat (limited to 'src/ext')
-rw-r--r-- | src/ext/Dependency/ca/wixdepca.cpp | 42 | ||||
-rw-r--r-- | src/ext/Dependency/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs | 6 |
2 files changed, 24 insertions, 24 deletions
diff --git a/src/ext/Dependency/ca/wixdepca.cpp b/src/ext/Dependency/ca/wixdepca.cpp index d6433707..efb19ea2 100644 --- a/src/ext/Dependency/ca/wixdepca.cpp +++ b/src/ext/Dependency/ca/wixdepca.cpp | |||
@@ -6,14 +6,14 @@ | |||
6 | #define INITIAL_STRINGDICT_SIZE 4 | 6 | #define INITIAL_STRINGDICT_SIZE 4 |
7 | 7 | ||
8 | LPCWSTR vcsDependencyProviderQuery = | 8 | LPCWSTR vcsDependencyProviderQuery = |
9 | L"SELECT `WixDependencyProvider`.`WixDependencyProvider`, `WixDependencyProvider`.`Component_`, `WixDependencyProvider`.`ProviderKey`, `WixDependencyProvider`.`Attributes` " | 9 | L"SELECT `Wix4DependencyProvider`.`Wix4DependencyProvider`, `Wix4DependencyProvider`.`Component_`, `Wix4DependencyProvider`.`ProviderKey`, `Wix4DependencyProvider`.`Attributes` " |
10 | L"FROM `WixDependencyProvider`"; | 10 | L"FROM `Wix4DependencyProvider`"; |
11 | enum eDependencyProviderQuery { dpqId = 1, dpqComponent, dpqProviderKey, dpqAttributes }; | 11 | enum eDependencyProviderQuery { dpqId = 1, dpqComponent, dpqProviderKey, dpqAttributes }; |
12 | 12 | ||
13 | LPCWSTR vcsDependencyQuery = | 13 | LPCWSTR vcsDependencyQuery = |
14 | L"SELECT `WixDependency`.`WixDependency`, `WixDependencyProvider`.`Component_`, `WixDependency`.`ProviderKey`, `WixDependency`.`MinVersion`, `WixDependency`.`MaxVersion`, `WixDependency`.`Attributes` " | 14 | L"SELECT `Wix4Dependency`.`Wix4Dependency`, `Wix4DependencyProvider`.`Component_`, `Wix4Dependency`.`ProviderKey`, `Wix4Dependency`.`MinVersion`, `Wix4Dependency`.`MaxVersion`, `Wix4Dependency`.`Attributes` " |
15 | L"FROM `WixDependencyProvider`, `WixDependency`, `WixDependencyRef` " | 15 | L"FROM `Wix4DependencyProvider`, `Wix4Dependency`, `Wix4DependencyRef` " |
16 | L"WHERE `WixDependency`.`WixDependency` = `WixDependencyRef`.`WixDependency_` AND `WixDependencyProvider`.`WixDependencyProvider` = `WixDependencyRef`.`WixDependencyProvider_`"; | 16 | L"WHERE `Wix4Dependency`.`Wix4Dependency` = `Wix4DependencyRef`.`Wix4Dependency_` AND `Wix4DependencyProvider`.`Wix4DependencyProvider` = `Wix4DependencyRef`.`Wix4DependencyProvider_`"; |
17 | enum eDependencyComponentQuery { dqId = 1, dqComponent, dqProviderKey, dqMinVersion, dqMaxVersion, dqAttributes }; | 17 | enum eDependencyComponentQuery { dqId = 1, dqComponent, dqProviderKey, dqMinVersion, dqMaxVersion, dqAttributes }; |
18 | 18 | ||
19 | static HRESULT EnsureRequiredDependencies( | 19 | static HRESULT EnsureRequiredDependencies( |
@@ -134,8 +134,8 @@ static HRESULT EnsureRequiredDependencies( | |||
134 | UINT cDependencies = 0; | 134 | UINT cDependencies = 0; |
135 | PMSIHANDLE hDependencyRec = NULL; | 135 | PMSIHANDLE hDependencyRec = NULL; |
136 | 136 | ||
137 | // Skip the dependency check if the WixDependency table is missing (no dependencies to check for). | 137 | // Skip the dependency check if the Wix4Dependency table is missing (no dependencies to check for). |
138 | hr = WcaTableExists(L"WixDependency"); | 138 | hr = WcaTableExists(L"Wix4Dependency"); |
139 | if (S_FALSE == hr) | 139 | if (S_FALSE == hr) |
140 | { | 140 | { |
141 | WcaLog(LOGMSG_STANDARD, "Skipping the dependency check since no dependencies are authored."); | 141 | WcaLog(LOGMSG_STANDARD, "Skipping the dependency check since no dependencies are authored."); |
@@ -143,7 +143,7 @@ static HRESULT EnsureRequiredDependencies( | |||
143 | } | 143 | } |
144 | 144 | ||
145 | // If the table exists but not the others, the database was not authored correctly. | 145 | // If the table exists but not the others, the database was not authored correctly. |
146 | ExitOnFailure(hr, "Failed to check if the WixDependency table exists."); | 146 | ExitOnFailure(hr, "Failed to check if the Wix4Dependency table exists."); |
147 | 147 | ||
148 | // Initialize the dictionary to keep track of unique dependency keys. | 148 | // Initialize the dictionary to keep track of unique dependency keys. |
149 | hr = DictCreateStringList(&sdDependencies, INITIAL_STRINGDICT_SIZE, DICT_FLAG_CASEINSENSITIVE); | 149 | hr = DictCreateStringList(&sdDependencies, INITIAL_STRINGDICT_SIZE, DICT_FLAG_CASEINSENSITIVE); |
@@ -159,10 +159,10 @@ static HRESULT EnsureRequiredDependencies( | |||
159 | while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) | 159 | while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) |
160 | { | 160 | { |
161 | hr = WcaGetRecordString(hRec, dqId, &sczId); | 161 | hr = WcaGetRecordString(hRec, dqId, &sczId); |
162 | ExitOnFailure(hr, "Failed to get WixDependency.WixDependency."); | 162 | ExitOnFailure(hr, "Failed to get Wix4Dependency.Wix4Dependency."); |
163 | 163 | ||
164 | hr = WcaGetRecordString(hRec, dqComponent, &sczComponent); | 164 | hr = WcaGetRecordString(hRec, dqComponent, &sczComponent); |
165 | ExitOnFailure(hr, "Failed to get WixDependencyProvider.Component_."); | 165 | ExitOnFailure(hr, "Failed to get Wix4DependencyProvider.Component_."); |
166 | 166 | ||
167 | // Skip the current component if its not being installed or reinstalled. | 167 | // Skip the current component if its not being installed or reinstalled. |
168 | tComponentAction = WcaGetComponentToDo(sczComponent); | 168 | tComponentAction = WcaGetComponentToDo(sczComponent); |
@@ -173,16 +173,16 @@ static HRESULT EnsureRequiredDependencies( | |||
173 | } | 173 | } |
174 | 174 | ||
175 | hr = WcaGetRecordString(hRec, dqProviderKey, &sczProviderKey); | 175 | hr = WcaGetRecordString(hRec, dqProviderKey, &sczProviderKey); |
176 | ExitOnFailure(hr, "Failed to get WixDependency.ProviderKey."); | 176 | ExitOnFailure(hr, "Failed to get Wix4Dependency.ProviderKey."); |
177 | 177 | ||
178 | hr = WcaGetRecordString(hRec, dqMinVersion, &sczMinVersion); | 178 | hr = WcaGetRecordString(hRec, dqMinVersion, &sczMinVersion); |
179 | ExitOnFailure(hr, "Failed to get WixDependency.MinVersion."); | 179 | ExitOnFailure(hr, "Failed to get Wix4Dependency.MinVersion."); |
180 | 180 | ||
181 | hr = WcaGetRecordString(hRec, dqMaxVersion, &sczMaxVersion); | 181 | hr = WcaGetRecordString(hRec, dqMaxVersion, &sczMaxVersion); |
182 | ExitOnFailure(hr, "Failed to get WixDependency.MaxVersion."); | 182 | ExitOnFailure(hr, "Failed to get Wix4Dependency.MaxVersion."); |
183 | 183 | ||
184 | hr = WcaGetRecordInteger(hRec, dqAttributes, &iAttributes); | 184 | hr = WcaGetRecordInteger(hRec, dqAttributes, &iAttributes); |
185 | ExitOnFailure(hr, "Failed to get WixDependency.Attributes."); | 185 | ExitOnFailure(hr, "Failed to get Wix4Dependency.Attributes."); |
186 | 186 | ||
187 | // Check the registry to see if the required providers (dependencies) exist. | 187 | // Check the registry to see if the required providers (dependencies) exist. |
188 | hr = DepCheckDependency(hkHive, sczProviderKey, sczMinVersion, sczMaxVersion, iAttributes, sdDependencies, &rgDependencies, &cDependencies); | 188 | hr = DepCheckDependency(hkHive, sczProviderKey, sczMinVersion, sczMaxVersion, iAttributes, sdDependencies, &rgDependencies, &cDependencies); |
@@ -278,15 +278,15 @@ static HRESULT EnsureAbsentDependents( | |||
278 | UINT cDependents = 0; | 278 | UINT cDependents = 0; |
279 | PMSIHANDLE hDependencyRec = NULL; | 279 | PMSIHANDLE hDependencyRec = NULL; |
280 | 280 | ||
281 | // Skip the dependent check if the WixDependencyProvider table is missing (no dependency providers). | 281 | // Skip the dependent check if the Wix4DependencyProvider table is missing (no dependency providers). |
282 | hr = WcaTableExists(L"WixDependencyProvider"); | 282 | hr = WcaTableExists(L"Wix4DependencyProvider"); |
283 | if (S_FALSE == hr) | 283 | if (S_FALSE == hr) |
284 | { | 284 | { |
285 | WcaLog(LOGMSG_STANDARD, "Skipping the dependents check since no dependency providers are authored."); | 285 | WcaLog(LOGMSG_STANDARD, "Skipping the dependents check since no dependency providers are authored."); |
286 | ExitFunction1(hr = S_OK); | 286 | ExitFunction1(hr = S_OK); |
287 | } | 287 | } |
288 | 288 | ||
289 | ExitOnFailure(hr, "Failed to check if the WixDependencyProvider table exists."); | 289 | ExitOnFailure(hr, "Failed to check if the Wix4DependencyProvider table exists."); |
290 | 290 | ||
291 | // Split the IGNOREDEPENDENCIES property for use below if set. If it is "ALL", then quit now. | 291 | // Split the IGNOREDEPENDENCIES property for use below if set. If it is "ALL", then quit now. |
292 | hr = SplitIgnoredDependents(&sdIgnoredDependents); | 292 | hr = SplitIgnoredDependents(&sdIgnoredDependents); |
@@ -317,10 +317,10 @@ static HRESULT EnsureAbsentDependents( | |||
317 | while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) | 317 | while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) |
318 | { | 318 | { |
319 | hr = WcaGetRecordString(hRec, dpqId, &sczId); | 319 | hr = WcaGetRecordString(hRec, dpqId, &sczId); |
320 | ExitOnFailure(hr, "Failed to get WixDependencyProvider.WixDependencyProvider."); | 320 | ExitOnFailure(hr, "Failed to get Wix4DependencyProvider.Wix4DependencyProvider."); |
321 | 321 | ||
322 | hr = WcaGetRecordString(hRec, dpqComponent, &sczComponent); | 322 | hr = WcaGetRecordString(hRec, dpqComponent, &sczComponent); |
323 | ExitOnFailure(hr, "Failed to get WixDependencyProvider.Component."); | 323 | ExitOnFailure(hr, "Failed to get Wix4DependencyProvider.Component."); |
324 | 324 | ||
325 | // Skip the current component if its not being uninstalled. | 325 | // Skip the current component if its not being uninstalled. |
326 | tComponentAction = WcaGetComponentToDo(sczComponent); | 326 | tComponentAction = WcaGetComponentToDo(sczComponent); |
@@ -331,10 +331,10 @@ static HRESULT EnsureAbsentDependents( | |||
331 | } | 331 | } |
332 | 332 | ||
333 | hr = WcaGetRecordString(hRec, dpqProviderKey, &sczProviderKey); | 333 | hr = WcaGetRecordString(hRec, dpqProviderKey, &sczProviderKey); |
334 | ExitOnFailure(hr, "Failed to get WixDependencyProvider.ProviderKey."); | 334 | ExitOnFailure(hr, "Failed to get Wix4DependencyProvider.ProviderKey."); |
335 | 335 | ||
336 | hr = WcaGetRecordInteger(hRec, dpqAttributes, &iAttributes); | 336 | hr = WcaGetRecordInteger(hRec, dpqAttributes, &iAttributes); |
337 | ExitOnFailure(hr, "Failed to get WixDependencyProvider.Attributes."); | 337 | ExitOnFailure(hr, "Failed to get Wix4DependencyProvider.Attributes."); |
338 | 338 | ||
339 | // Check the registry to see if the provider has any dependents registered. | 339 | // Check the registry to see if the provider has any dependents registered. |
340 | hr = DepCheckDependents(hkHive, sczProviderKey, iAttributes, sdIgnoredDependents, &rgDependents, &cDependents); | 340 | hr = DepCheckDependents(hkHive, sczProviderKey, iAttributes, sdIgnoredDependents, &rgDependents, &cDependents); |
diff --git a/src/ext/Dependency/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs b/src/ext/Dependency/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs index 708ae658..bce128e8 100644 --- a/src/ext/Dependency/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs +++ b/src/ext/Dependency/test/WixToolsetTest.Dependency/DependencyExtensionFixture.cs | |||
@@ -17,15 +17,15 @@ namespace WixToolsetTest.Dependency | |||
17 | var folder = TestData.Get(@"TestData\UsingProvides"); | 17 | var folder = TestData.Get(@"TestData\UsingProvides"); |
18 | var build = new Builder(folder, typeof(DependencyExtensionFactory), new[] { folder }); | 18 | var build = new Builder(folder, typeof(DependencyExtensionFactory), new[] { folder }); |
19 | 19 | ||
20 | var results = build.BuildAndQuery(Build, "CustomAction", "WixDependencyProvider") | 20 | var results = build.BuildAndQuery(Build, "CustomAction", "Wix4DependencyProvider") |
21 | .Select(r => Regex.Replace(r, "{[^}]*}", "{*}")) | 21 | .Select(r => Regex.Replace(r, "{[^}]*}", "{*}")) |
22 | .ToArray(); | 22 | .ToArray(); |
23 | WixAssert.CompareLineByLine(new[] | 23 | WixAssert.CompareLineByLine(new[] |
24 | { | 24 | { |
25 | "CustomAction:Wix4DependencyCheck_X86\t1\tDependencyCA_X86\tWixDependencyCheck\t", | 25 | "CustomAction:Wix4DependencyCheck_X86\t1\tDependencyCA_X86\tWixDependencyCheck\t", |
26 | "CustomAction:Wix4DependencyRequire_X86\t1\tDependencyCA_X86\tWixDependencyRequire\t", | 26 | "CustomAction:Wix4DependencyRequire_X86\t1\tDependencyCA_X86\tWixDependencyRequire\t", |
27 | "WixDependencyProvider:dep74OfIcniaqxA7EprRGBw4Oyy3r8\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tUsingProvides\t\t\t", | 27 | "Wix4DependencyProvider:dep74OfIcniaqxA7EprRGBw4Oyy3r8\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\tUsingProvides\t\t\t", |
28 | "WixDependencyProvider:depTpv28q7slcxvXPWmU4Z0GfbiI.4\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\t{*}\t\t\t", | 28 | "Wix4DependencyProvider:depTpv28q7slcxvXPWmU4Z0GfbiI.4\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo\t{*}\t\t\t", |
29 | }, results); | 29 | }, results); |
30 | } | 30 | } |
31 | 31 | ||