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

Fyodor Koryazhkin fyodorkor at gmail.com
Sun Dec 23 03:56:25 PST 2018


HI,
If both components belong to the same feature then the second component
will be installed because:
1. Conditions are not reevaluated during patch installation
2. First component was installed during initial run and that sets feature
state to as "installed" too. This makes all components to be installed.

On initial run the second component was not installed based on false
condition. On the patch run, because the condition is not reevaluated the
second component regarded as missing and therefore is marked for
installation.

To overcome this pass REINSTALL="ALL" property during patch run. This will
reinstall/update only what was installed on first run.

On Mon, Dec 17, 2018 at 7:35 PM manogna reddy via wix-users <
wix-users at lists.wixtoolset.org> wrote:

> 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.
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>


-- 
Regards,
Fyodor Koryazhkin..



More information about the wix-users mailing list