diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2022-01-14 20:48:01 -0600 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2022-01-16 10:30:28 -0600 |
| commit | abe316b80fae80eba54b0b79e76b6362105fa098 (patch) | |
| tree | 699290ccc7e924a5ef498e487924834c1018b80e /src/libs | |
| parent | 47bca2dc51525fcad86f325278b14953ac5b137e (diff) | |
| download | wix-abe316b80fae80eba54b0b79e76b6362105fa098.tar.gz wix-abe316b80fae80eba54b0b79e76b6362105fa098.tar.bz2 wix-abe316b80fae80eba54b0b79e76b6362105fa098.zip | |
Refactor some dependency detection.
* Run DependencyDetect earlier
* Do package dependency checking during each package/related bundle
Diffstat (limited to 'src/libs')
| -rw-r--r-- | src/libs/dutil/WixToolset.DUtil/deputil.cpp | 19 | ||||
| -rw-r--r-- | src/libs/dutil/WixToolset.DUtil/inc/deputil.h | 2 |
2 files changed, 15 insertions, 6 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/deputil.cpp b/src/libs/dutil/WixToolset.DUtil/deputil.cpp index 754365e9..1a480263 100644 --- a/src/libs/dutil/WixToolset.DUtil/deputil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/deputil.cpp | |||
| @@ -246,7 +246,7 @@ DAPI_(HRESULT) DepCheckDependents( | |||
| 246 | __in HKEY hkHive, | 246 | __in HKEY hkHive, |
| 247 | __in_z LPCWSTR wzProviderKey, | 247 | __in_z LPCWSTR wzProviderKey, |
| 248 | __reserved int /*iAttributes*/, | 248 | __reserved int /*iAttributes*/, |
| 249 | __in C_STRINGDICT_HANDLE sdIgnoredDependents, | 249 | __in_opt C_STRINGDICT_HANDLE sdIgnoredDependents, |
| 250 | __deref_inout_ecount_opt(*pcDependents) DEPENDENCY** prgDependents, | 250 | __deref_inout_ecount_opt(*pcDependents) DEPENDENCY** prgDependents, |
| 251 | __inout LPUINT pcDependents | 251 | __inout LPUINT pcDependents |
| 252 | ) | 252 | ) |
| @@ -257,6 +257,7 @@ DAPI_(HRESULT) DepCheckDependents( | |||
| 257 | HKEY hkDependentsKey = NULL; | 257 | HKEY hkDependentsKey = NULL; |
| 258 | LPWSTR sczDependentKey = NULL; | 258 | LPWSTR sczDependentKey = NULL; |
| 259 | LPWSTR sczDependentName = NULL; | 259 | LPWSTR sczDependentName = NULL; |
| 260 | BOOL fIgnore = FALSE; | ||
| 260 | 261 | ||
| 261 | // Format the provider dependency registry key. | 262 | // Format the provider dependency registry key. |
| 262 | hr = AllocDependencyKeyName(wzProviderKey, &sczKey); | 263 | hr = AllocDependencyKeyName(wzProviderKey, &sczKey); |
| @@ -280,6 +281,8 @@ DAPI_(HRESULT) DepCheckDependents( | |||
| 280 | // Now enumerate the dependent keys. If they are not defined in the ignored list, add them to the array. | 281 | // Now enumerate the dependent keys. If they are not defined in the ignored list, add them to the array. |
| 281 | for (DWORD dwIndex = 0; ; ++dwIndex) | 282 | for (DWORD dwIndex = 0; ; ++dwIndex) |
| 282 | { | 283 | { |
| 284 | fIgnore = FALSE; | ||
| 285 | |||
| 283 | hr = RegKeyEnum(hkDependentsKey, dwIndex, &sczDependentKey); | 286 | hr = RegKeyEnum(hkDependentsKey, dwIndex, &sczDependentKey); |
| 284 | if (E_NOMOREITEMS != hr) | 287 | if (E_NOMOREITEMS != hr) |
| 285 | { | 288 | { |
| @@ -292,12 +295,18 @@ DAPI_(HRESULT) DepCheckDependents( | |||
| 292 | } | 295 | } |
| 293 | 296 | ||
| 294 | // If the key isn't ignored, add it to the dependent array. | 297 | // If the key isn't ignored, add it to the dependent array. |
| 295 | hr = DictKeyExists(sdIgnoredDependents, sczDependentKey); | 298 | if (sdIgnoredDependents) |
| 296 | if (E_NOTFOUND != hr) | ||
| 297 | { | 299 | { |
| 298 | DepExitOnFailure(hr, "Failed to check the dictionary of ignored dependents."); | 300 | hr = DictKeyExists(sdIgnoredDependents, sczDependentKey); |
| 301 | if (E_NOTFOUND != hr) | ||
| 302 | { | ||
| 303 | DepExitOnFailure(hr, "Failed to check the dictionary of ignored dependents."); | ||
| 304 | |||
| 305 | fIgnore = TRUE; | ||
| 306 | } | ||
| 299 | } | 307 | } |
| 300 | else | 308 | |
| 309 | if (!fIgnore) | ||
| 301 | { | 310 | { |
| 302 | // Get the name of the dependent from the key. | 311 | // Get the name of the dependent from the key. |
| 303 | hr = GetDependencyNameFromKey(hkHive, sczDependentKey, &sczDependentName); | 312 | hr = GetDependencyNameFromKey(hkHive, sczDependentKey, &sczDependentName); |
diff --git a/src/libs/dutil/WixToolset.DUtil/inc/deputil.h b/src/libs/dutil/WixToolset.DUtil/inc/deputil.h index bfe235f3..96f353f6 100644 --- a/src/libs/dutil/WixToolset.DUtil/inc/deputil.h +++ b/src/libs/dutil/WixToolset.DUtil/inc/deputil.h | |||
| @@ -56,7 +56,7 @@ DAPI_(HRESULT) DepCheckDependents( | |||
| 56 | __in HKEY hkHive, | 56 | __in HKEY hkHive, |
| 57 | __in_z LPCWSTR wzProviderKey, | 57 | __in_z LPCWSTR wzProviderKey, |
| 58 | __reserved int iAttributes, | 58 | __reserved int iAttributes, |
| 59 | __in C_STRINGDICT_HANDLE sdIgnoredDependents, | 59 | __in_opt C_STRINGDICT_HANDLE sdIgnoredDependents, |
| 60 | __deref_inout_ecount_opt(*pcDependents) DEPENDENCY** prgDependents, | 60 | __deref_inout_ecount_opt(*pcDependents) DEPENDENCY** prgDependents, |
| 61 | __inout LPUINT pcDependents | 61 | __inout LPUINT pcDependents |
| 62 | ); | 62 | ); |
