Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6061551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:57:01+00:00 2026-05-23T08:57:01+00:00

I have a property that is set to 1 if the database feature is

  • 0

I have a property that is set to 1 if the database feature is being installed:

<Property Id="DBFLAG" Value="0" />
<CustomAction Id="DbCheck" Return="check" Execute="immediate" Property="DBFLAG" Value="1" />
<InstallExecuteSequence>
        <Custom Action="DbCheck" After="CostFinalize"><![CDATA[&ft_db=3]]></Custom>
</InstallExecuteSequence>

In another feature I check this DBFLAG to see if it is 0 or 1 and based upon this I want to start a service immediately or not:

<Component Id="cmp_Svc" Guid="99481212-F2E0-4B6E-934D-0994815C31ED">
            <File Id="FILE01" Source="$(var.Service.TargetDir)\Service.exe" KeyPath="yes" />

            <ServiceInstall Id="Svc" Name="My Service" Type="ownProcess" Account="[WIX_ACCOUNT_LOCALSYSTEM]" Description="My Service." DisplayName="My Service" ErrorControl="normal" Interactive="no" Start="auto" Vital="no" />
</Component>
<Component Id="cmp_SvcC_Start" Guid="2ED5DBC7-BD42-4D46-AB18-E82DB0E317AD">
            <Condition>DBFLAG=1</Condition>
            <ServiceControl Id="SvcC_Start" Name="My Service"  Remove="uninstall" Stop="both" Wait="yes" Start="install" />
</Component>

<Component Id="cmp_SvcC" Guid="5769A35B-FD61-45D4-8113-40FB762B79C6">
            <Condition>DBFLAG=0</Condition>
            <ServiceControl Id="SvcC" Name="My Service"  Remove="uninstall" Stop="both" Wait="yes" />
</Component>

However, it always runs the cmp_SvcC instead of the cmp_SvcC_Start service if the database feature is installed. I have checked the logs and can see that the DBFLAG is set to 1 before the cmp_SvcC and cmp_SvcC_Start are run but still the cmp_SvcC is run even though the condition is only when DBFLAG=0.

If I change the initial value of the DBFLAG to 1 then the cmp_SvcC_Start gets run.

Has anyone any idea as to why this is happening?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:57:01+00:00Added an answer on May 23, 2026 at 8:57 am

    It doesn’t work this way. You cannot condition a component with a feature action, even if your are doing it indirectly through a property.

    The correct approach is to share your component between all features which affect its installation. This is done through FeatureComponents table.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to have the nested containers inherit that property, but when I set
I've got some Columns in a DataGridView that have their Binding property set to
I have a custom control that exposes a property. When I set it using
I have a CompositeControl that contains a DropDownList. I have set the AutoPostBack property
If I have a property that I want to let inheritors write to, but
If you have a Property that gets and sets to an instance variable then
So I have an object that implements INotifyPropertyChanged, and I have a property that
I have a json property that might be null, and I'd prefer to keep
I have a Private property that I want to access in my MS Test
I have a string property that I would like to be able to force

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.