Skip to content

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.

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?

Copy link
Author

@metsma metsma Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want me to anything with this commit?
I am not using existing case because at this point the value is string and later converted to int.
hr = WiuGetProductInfo(sczGuid, wzProperty, &value.sczValue);
...
hr = BVariantChangeType(&value, type);
and then int value is compared
value.llValue = (value.llValue == INSTALLSTATE_ABSENT) ? 0 : 1;


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