0

I am learning windows installer xml(WIX) and have a condition in my code which checks if software-A is installed before my software is installed. I want my software could be installed when software-A has been installed but when I am uninstalling my software, this condition should not be triggered.

The bundle works fine when it is in the installing process, that means if software-A has already been installed, it will continue to install. But if software-A has not been installed at all, the bundle will trigger condition checking process, show the condition message and stop installing. I have tried two conditions "NOT Installed" and "Installed", but the condition checking process is still triggered all the time even it is in uninstalling process. That means whatever the process is the bundle always searches the same registry.

The logic of the installer is simple enough but I am a beginner on Windows installer xml technology.

<bal:Condition Message="Software-A is Required.">
   <![CDATA[NOT Installed OR SoftwareAInstalled]]>
</bal:Condition>

<util:RegistrySearch Id="SoftwareAInstalled"
                 Root="HKLM"  
                 Key="SOFTWARE\SoftwareA\"
                 Variable="SoftwareAInstalled"
                 Result="exists" />

I wanna know how to prevent the checking process when the installer is in the uninstalling. Or any other suggestions would be appreciate.

Kevin Yang
  • 13
  • 5
  • Take a look at the [Bundle log file](https://support.firegiant.com/hc/en-us/articles/230912407-Create-a-log-file-). It should provide more insight and if not enough insight, adding it to the question can provide insight to those here. – Rob Mensching Apr 12 '19 at 12:22
  • That's a good idea, thanks! – Kevin Yang Apr 16 '19 at 06:16

2 Answers2

1

Since you want to detect the state of your Bundle you should have a look at Burn Built-in Variables. WixBundleInstalled will give you the installation state of the current Bundle. Therefore

WixBundleInstalled OR SoftwareAInstalled

Will allow the installer to continue if either the current bundle is already installed or if you are performing a fresh install of the bundle and Software A is already present.

VolkerG
  • 148
  • 1
  • 2
  • 7
0

I don't have time to verify this right now, but it looks like you can use:

Installed OR SoftwareAInstalled

I would uppercase the latter property, but then it can be set at the command line. I guess it should work with what you have. Can't test right now. Tip: Remember to test in silent installation mode, in modify, repair, self-repair, uninstall, major upgrade, etc... Lots to check.

Some previous answers on similar issues:

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • Thank you for providing the links and suggestions though it does not helped me. The following property replied from Volker Gärtner helps me. Thank you man! – Kevin Yang Apr 16 '19 at 06:19