I am working on a bootstrapper project that when run, installs a 32bit or 64bit driver depending on the architecture the installed program is.
I would like to display an error message, prevent installation and close the application if there is no 32bit or 64bit program installed on the machine.
This is what I have but the <Condition> is causing an invalid child element error. Perhaps I cannot use a condition in the chain but is there a way I could do this very simply or will I need to create an <ExePackage>?
<Bundle...
<!-- Define variables -->
<Variable Name="ErrorMessage" Type="string" Value="Neither the 32-bit nor the 64-bit program is installed." />
<!-- Registry searches -->
...
<Chain>
<MsiPackages...
<Condition Message="[ErrorMessage]">
<![CDATA[NOT ProgramInstalled32 AND NOT ProgramInstalled64]]>
</Condition>
</Chain>
</Bundle>
I got it working! After some research on the
Conditiontag and how it works I realized the approach I had was wrong because the MsiPackage will not install if theConditionreturns false.This is my solution, I put it just under the chain:
I tested it and when I ran the
.EXEit installed the64bitdriver as I have the64bitprogram installed. And when I uninstalled the program, then ran the.EXE, the error message displayed and prevented the installation. Hope this works for you!