[wix-users] Custom Action based on condition

Rob Mensching rob at firegiant.com
Fri Oct 28 09:46:13 PDT 2016


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



More information about the wix-users mailing list