Skip to content

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

metsma
Copy link

@metsma metsma commented May 26, 2025

(e.g. FileSearch, DirectorySearch, RegistrySearch)

Closes wixtoolset/issues#9079

Signed-off-by: Raul Metsma raul@metsma.ee

Copy link

github-actions bot commented May 26, 2025

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@metsma
Copy link
Author

metsma commented May 26, 2025

I have read the CLA Document and I hereby sign the CLA

wixbot added a commit to wixtoolset/.github that referenced this pull request May 26, 2025
@barnson
Copy link
Member

barnson commented May 26, 2025

Please open an issue so it can go through triage for approval.

@robmen robmen self-requested a review June 18, 2025 19:20
@robmen robmen self-assigned this Jun 18, 2025
Copy link
Member

@robmen robmen left a 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;
Copy link
Member

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.

Copy link
Author

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?

@@ -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;
Copy link
Member

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. :)

Copy link
Author

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?

@metsma metsma force-pushed the ProductSearchExists branch from 118c8b6 to a5496b4 Compare June 20, 2025 05:47
(e.g. FileSearch, DirectorySearch, RegistrySearch)

Signed-off-by: Raul Metsma <raul@metsma.ee>
@metsma metsma force-pushed the ProductSearchExists branch from a5496b4 to 17b965b Compare June 20, 2025 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add exists option to ProductSearch Result for matching other search types
3 participants