[wix-users] Component conditions are not being evaluated properly while applying patch in wix

manogna reddy manogna657 at gmail.com
Mon Dec 17 00:05:33 PST 2018


Component conditions are not being evaluated  properly while applying patch


I have a scenario where I have two components with conditions  . Files
under these components are with same names but with different versions .
Based on properties passed from bootstrapper to MSI , components conditions
are being evaluated



     <Component Id="TestAppversionone"
Guid="{F5472ED3-EF89-4B13-B595-A6F33F1DF9EE}" Transitive="Yes" >
        <File Id="wpfappversionone"
Source="TestAPP\1.0.0.0\Testapplication11.exe"/>
        <Condition>
          VERSIONCHOSEN = VERSION_ONE
        </Condition>
      </Component>
      <Component Id="TestAppversiontwo"
Guid="{85F1C55A-A25B-4D33-BEF1-0AA61DAA759E}" Transitive="Yes">
        <File Id="wpfappversiontwo"
Source="TestAPP\2.0.0.0\Testapplication11.exe"/>
        <Condition>
         VERSIONCHOSEN = VERSION_TWO
        </Condition>
      </Component>

While installing the setup based  on the VERSIONCHOSEN property value
passed from bootstrapper respective component is getting installed . In my
case 1st component is getting installed which is correct .

But while applying patch ,second component is getting installed even though
the condition is evaluating to false. The file should be updated to version
1.0.1.0 .Where as it is getting updated to 2.0.1.0 .

My patch code looks as below.


    <Component Id="TestAppversionone"
Guid="{F5472ED3-EF89-4B13-B595-A6F33F1DF9EE}" Transitive="Yes" >
        <File Id="wpfappversionone"
Source="TestAPP\1.0.1.0\Testapplication11.exe"/>
        <Condition>
          VERSIONCHOSEN = VERSION_ONE
        </Condition>
      </Component>
      <Component Id="TestAppversiontwo"
Guid="{85F1C55A-A25B-4D33-BEF1-0AA61DAA759E}" Transitive="Yes">
        <File Id="wpfappversiontwo"
Source="TestAPP\2.0.1.0\Testapplication11.exe"/>
        <Condition>
         VERSIONCHOSEN = VERSION_TWO
        </Condition>
      </Component>




When I observe the logs , first component condition is evaluated to true
and file is getting overwritten .But if I navigate to installpath wrong
file is present .Can any help me to resolve the issue.


More information about the wix-users mailing list