pfletch101
Posts: 24
Joined: Sat Aug 18, 2012 9:19 pm

Comparing Properties and Search results.

1) Am I correct in thinking that Properties and Registry Search results are held internally as text strings, even if they could validly be treated as numeric?

2) If a Property is compared with a Search result, is a standard text comparison used, so that "A" is less than "B", and "3.15" is less than "3.16", or is it only possible to test for exact identity?

I ask because such a comparison being used as a launch condition in an installer I am writing to do some data file updates seems to be concluding that "3.15" >= "3.16"!
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Comparing Properties and Search results.

Hello,
Am I correct in thinking that Properties and Registry Search results are held internally as text strings, even if they could validly be treated as numeric?
Indeed search result are actually stored in public properties that have the search name (e.g SEARCH_RESULT). Also, please keep in mind all installer public properties are strings.
If a Property is compared with a Search result, is a standard text comparison used, so that "A" is less than "B", and "3.15" is less than "3.16", or is it only possible to test for exact identity?
Since search results are public properties which in turn are string type, the comparison will be between string values (ASCII table), not integer. Here's Edit Condition Dialog article with the available comparative operators and other related information.

A solution is to do the comparison using integer values within a custom action and work with the return value.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
pfletch101
Posts: 24
Joined: Sat Aug 18, 2012 9:19 pm

Re: Comparing Properties and Search results.

mihai.petcu wrote:A solution is to do the comparison using integer values within a custom action and work with the return value.
Is there a way of explicitly converting Search and/or Property values (assuming that they contain valid numeric strings) into numeric values for processing within custom actions, and are only Integer conversions supported? This issue is not covered or referred to in any of the material you point to.
pfletch101
Posts: 24
Joined: Sat Aug 18, 2012 9:19 pm

Re: Comparing Properties and Search results.

The problem that was exercising my mind turned out to stem from my connecting two comparisons with 'AND', when I should have been using 'OR'. Of all the things I've lost, I think I miss my mind the most!

Return to “Building Installers”