[wix-users] Custom Action based on condition

Farrukh Waheed farrukh1 at gmail.com
Fri Oct 28 10:49:14 PDT 2016


<?if?> <?endif?> are pre-processor conditions. These would only work while
building your msi, not on install time.

On 28 October 2016 at 09:46, Rob Mensching <rob at firegiant.com> wrote:

> Don't. Use Component states instead.
>
> _____________________________________________________________
>  Short replies here. Complete answers over there:
> http://www.firegiant.com/
>
>
> -----Original Message-----
> From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf
> Of Priyanka Kandpal
> Sent: Friday, October 28, 2016 9:27 AM
> To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
> Subject: [wix-users] Custom Action based on condition
>
> Hello Everyone
> I am trying to execute custom action based on the feature selected in the
> selection tree. Could you please help me with the condition. I tried
> putting the feature id in the conditional statement but it didn't work.
> Below is the code for the Feature
>
> <Feature Id="Service" Title="Contract Companion Server Service"
> Description="Installs all the files needed for Contract Companion Server's
> Analysis Service" Level="1" AllowAdvertise="no" ConfigurableDirectory="
> SERVICE">
>       <ComponentGroupRef Id="ServiceProductComponents"/>
>     </Feature>
>
>     <Feature Id="Website" Title="Contract Companion Server Website"
> Description="Installs all the files needed for Contract Companion Server
> IIS Website" Level="1" AllowAdvertise="no" ConfigurableDirectory="
> WEBSITE">
>       <ComponentGroupRef Id="WebsiteProductComponents"/>
>       <ComponentRef Id="webSite" />
>     </Feature>
>
> Below are my conditional statements.
>
> <? Feature Id="Website"?>
>     <CustomAction Id='SetCA_RunDBUpgrade' Property='CA_RunDBUpgrade'
>                   Value='EXE_FILE_NAME=[EXE_FILE_NAME];RUN_EXE_CMD_ARGS=[
> RUN_EXE_CMD_ARGS];ProductName=[ProductName];DATABASERESOURCESFOLDER=[
> DATABASERESOURCESFOLDER];INSTALLFOLDER=[WEBSITE];
> PRODUCT_FOLDER_NAME=[PRODUCT_FOLDER_NAME];UILevel=[UILevel]
> ;PRODUCT_SUBFOLDER_FOLDER_NAME=[PRODUCT_SUBFOLDER_FOLDER_NAME]'/>
>     <?else?>
>     <CustomAction Id='SetCA_RunDBUpgrade' Property='CA_RunDBUpgrade'
>                    Value='EXE_FILE_NAME=[EXE_FILE_NAME];RUN_EXE_CMD_ARGS=[
> RUN_EXE_CMD_ARGS];ProductName=[ProductName];DATABASERESOURCESFOLDER=[
> DATABASERESOURCESFOLDER];INSTALLFOLDER=[SERVICE];
> PRODUCT_FOLDER_NAME=[PRODUCT_FOLDER_NAME];UILevel=[UILevel]
> ;PRODUCT_SUBFOLDER_FOLDER_NAME=[PRODUCT_SUBFOLDER_FOLDER_NAME]'/>
>     <?endif?>
>
> Thanks & Regards
> Priyanka Kandpal
>
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>


More information about the wix-users mailing list