wixsilent-installer

In Wix installer InstallCondition and InstallCommand do not work correctly together


We have 3 different parts of our application, part 1 can be installed and used as a standalone application as well. Part 2 and Part 3 communicate with Part 1. So, part 2 and part 3 installers contain part 1 as a dependency. Some user may have part 1 already installed. If user does not have part 1 installed and is trying to install part 2 or 3, the part 1 should be installed in quiet mode. Also, we need to make sure that the version that is installed should be the same version as current installation or a newer one. So, I found InstallCondition and DetectCondition to detect the existing installation of part 1.

Now, I have been facing an issue that when I set DetectCondition and InstallCondition, the InstallCommand is not passed to the ExePackage and it is displayed to the user to install manually. Although, I have passed "/q" in the InstallCommand,

<util:RegistrySearch Id='CheckCCClientVersion' Root="HKCU" Key="Software\Organization\MyProduct" Value="Version" Win64="no" Result='value' Variable='EXISTINGCLIENTVERSION'  />
<util:RegistrySearch Id='CheckCCClientExists' Root="HKCU" Key="Software\Organization\MyProduct" Value="Version" Win64="no" Result='exists' Variable='CHECKCLIENTEXISTS' />

    <Chain>
        <ExePackage Id="Product1Id" SourceFile="$(var.ClientBundlePath)" Compressed="yes" Permanent="no" PerMachine="no"
                    DisplayName="Product Display Name" DetectCondition="CHECKCLIENTEXISTS" InstallCommand=" /q /norestart" InstallCondition="EXISTINGCLIENTVERSION >= v$(var.Version)" UninstallCommand="/q /norestart"/>

        <MsiPackage Id="MainProductId" Visible="no" EnableFeatureSelection="no" Description="Required Files."
                    SourceFile="$(var.AddinsMsiPath)"/>
    </Chain>
</Bundle>

I have tried adding and removing space character in the start of InstallCommand but with no luck. Any suggestions or ideas would be appreciated in this regards.

PS: WiX Toolset v3.11.2.4516 is installed on build servers and same is installed on my machine.

Regards, Umar


Solution

  • Make your DetectCondition what you currently have for InstallCondition, then remove InstallCondition. DetectCondition should detect the desired version (or higher). If it's false, Burn will install it.