1
votes

I am trying to execute an EXE file through my installation and this file should be installed if the related feature will be installed in the feature tree. I have two questions :

1-How to relate the Custom Action to this feature."The condition"

2- How I can include this exe file in the generated file. "This EXE File is a SQL Installation which I already made in WIX BOOTSTRAPPER "

http://apprize.info/web/wix/13.html

and my code is

<Feature Id="SubFeature1" Title="SQL Installation" Level="1" >
    <ComponentRef Id="SubComponent1"/>
  </Feature>
  <Feature Id="SubFeature2" Title="Second Subfeature" Level="1" >
    <ComponentRef Id="SubComponent2"/>
    <!-- <Condition Level="0">IISMAJORVERSION=""</Condition>    -->
  </Feature>
</Feature>


<CustomAction Id="CreateSQLINSTALLER" Directory="BMSS4_Installer"
Execute= "deferred" Impersonate="no" Return="ignore"
ExeCommand="[BMSS4_Installer]Sql_Installation_Test1.exe -install" />

<InstallExecuteSequence>

  <Custom Action="CreateSQLINSTALLER"  Before="InstallFinalize"><![CDATA[(&SubFeature1)]]></Custom>

</InstallExecuteSequence>

the Sql_Installation_Test1.exe is included in the main folder so BMSS4_Installer.. But is it right to use it direclty like that in Directory tag om CustomAction !!

1

1 Answers

3
votes

Feature conditions are documented here:

https://msdn.microsoft.com/en-us/library/aa368012(v=vs.85).aspx

in the action state of the feature. Basically you use a condition such as:

&featurename=3

where 3 is INSTALLSTATE_LOCAL, as there in the documentation. There are limits on where the condition can be used, the main one being after CostFinalize.

It's not clear if you are installing some version of SQL itself, but that would have its own install and wouldn't need repackaging, and it would be a prerequisite installed with Burn, for example. If it's a separate MSI setup of yours, again a Burn package would probably be the best way to install it and your other MSI.