How to compare strings in wix ExePackage?

4
<ExePackage InstallCommand='/q /action=UPGRADE /HIDECONSOLE /IACCEPTSQLSERVERLICENSETERMS=1 /INSTANCENAME=ABC' InstallCondition="SqlVersion32 &lt; v10.50.1600.1 AND SqlEdition32 = 'Express Edition'"/>

I am using the above code. In install condition I want to check if SqlEdition32 (its value is provided by a registry search) is Express edition but I am having error saying:

Error 0x8007000d: Failed to parse condition "SqlVersion32 < v10.50.1600.1 AND SqlEdition32='Express Edition'". Unexpected character at position 46.

Position 46 is where I am comparing SqlEdition32 string variable to string 'Express Edition' I want to know how to compare strings in WiX?

wix
wix3.6
wix3.7
wix-extension
asked on Stack Overflow Apr 29, 2014 by ABHI • edited Apr 30, 2014 by Yan Sklyarenko

2 Answers

1

Use double quotes around strings, not single quotes.

answered on Stack Overflow Apr 29, 2014 by Bob Arnson
1

You have two solutions:

  1. You can replace double quotes with single quote and vice versa, so you will have something like this:
InstallCondition='SqlVersion32
    &lt; v10.50.1600.1 AND SqlEdition32 = "Express Edition"'
  1. Or replace single quote ' with &quot ;, you will get:
InstallCondition="SqlVersion32 &lt; v10.50.1600.1 AND
    SqlEdition32 = &quot;Express Edition&quot;"
answered on Stack Overflow Oct 19, 2014 by Reda Beloued • edited Oct 19, 2014 by Reda Beloued

User contributions licensed under CC BY-SA 3.0