Conditional installation of ExePackage

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Conditional installation of ExePackage

Krys
This post has NOT been accepted by the mailing list yet.
Hi!

I have two pieces of software: a windows application, and a VSTO plugin (which only works if the main windows application is installed).
I have created a wix installer (<Product> .. msi) which lets the user choose whether or not to install the VSTO plugin in addition to the main program (one of the features in the feature tree).
If, and only if the plugin feature gets selected, I'd like the installer to also install the "Visual studio tools for office runtime" if it's missing.

I've found a snippet for a <bundle> which does that:

 <util:RegistrySearch Id="VSTOR_Installed" Variable="VSTOR40"
                         Root="HKLM" Key="SOFTWARE\Microsoft\VSTO Runtime Setup\v4R" Result="exists" />

  <ExePackage SourceFile="vstor_redist.exe" Permanent="yes" Vital="yes" Cache="no" Compressed="no"
                          DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=158917"
                          InstallCommand="/q /norestart"
                          DetectCondition="VSTOR40"
                          InstallCondition="NOT VSTOR40 AND ???" /> 
  </ExePackage>

I thought of using a <bundle> as in the example above. But even if I put my above mentioned msi and add it as an <MsiPackage> along with the <ExePackage> for the VSTO-Runtime, I still see no possibility to find out whether or not the Plugin feature was selected in my MsiPackage, in order to decide whether the ExePackage is to be installed.

What is the best practice in such a scenario? Should I do this with a custom action which gets executed if the plugin feature was selected?

Any help or hints greatly appreciated!