-
-
Notifications
You must be signed in to change notification settings - Fork 389
Add exists option to ProductSearch Result for matching other search types #641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
Please open an issue so it can go through triage for approval. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pretty good code change. Thanks.
I'd like to see a test added as well to make sure we don't regress this behavior.
@@ -1237,6 +1243,7 @@ static HRESULT MsiProductSearch( | |||
case BURN_MSI_PRODUCT_SEARCH_TYPE_LANGUAGE: | |||
type = BURN_VARIANT_TYPE_STRING; | |||
break; | |||
case BURN_MSI_PRODUCT_SEARCH_TYPE_EXISTS: __fallthrough; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than fall through here and check the type again below (line 1255), we should just set the value appropriately in this case
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value is in this stage string format?
src/burn/engine/search.cpp
Outdated
@@ -1245,6 +1252,11 @@ static HRESULT MsiProductSearch( | |||
hr = BVariantChangeType(&value, type); | |||
ExitOnFailure(hr, "Failed to change value type."); | |||
|
|||
if (BURN_MSI_PRODUCT_SEARCH_TYPE_EXISTS == pSearch->MsiProductSearch.Type) | |||
{ | |||
value.llValue = value.llValue == INSTALLSTATE_ABSENT ? 0 : 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see parens around the ternary condition:
value.llValue = (value.llValue == INSTALLSTATE_ABSENT) ? 0 : 1;
And moved up to the correct case
. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the value before BVariantChangeType string type?
118c8b6
to
a5496b4
Compare
(e.g. FileSearch, DirectorySearch, RegistrySearch) Signed-off-by: Raul Metsma <raul@metsma.ee>
a5496b4
to
17b965b
Compare
(e.g. FileSearch, DirectorySearch, RegistrySearch)
Closes wixtoolset/issues#9079
Signed-off-by: Raul Metsma raul@metsma.ee