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

  • SEARCH
  • Home
  • 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 8471507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:48:53+00:00 2026-06-10T16:48:53+00:00

TL;DR : Why do I need an empty <CreateFolder/> element in this conditional component

  • 0

TL;DR: Why do I need an empty <CreateFolder/> element in this conditional component in order to make it work?

I’m putting together a simple WiX based installer for an in-house application. This installer needs to deploy a standard configuration file (a normal .NET .config file) and then customize it using properties passed to msiexec on the command line.

One of the customizations is to create a specific application setting only if the RUNTIME property has been defined. Here’s the WiX component for that:

  <Component Id="C.Rbnz.Fsis.CollectionPeriodService.exe.config.runtime"
             Guid="*">
    <Condition>
      <![CDATA[RUNTIME]]>
    </Condition>

    <CreateFolder/>

    <util:XmlFile Id="X.Runtime.1"
                  Action="createElement"
                  ElementPath="/configuration/appSettings"
                  File="[#F.Rbnz.Fsis.CollectionPeriodService.exe.config]"
                  Name="add"
                  Sequence="2"/>

    <util:XmlFile Id="X.Runtime.2"
                  File="[#F.Rbnz.Fsis.CollectionPeriodService.exe.config]"
                  ElementPath="/configuration/appSettings/add[\[]not(@key)[\]]"
                  Action="setValue"
                  Name="key"
                  Value="RunTime"
                  Sequence="3"/>

    <util:XmlFile Id="X.Runtime.3"
                  File="[#F.Rbnz.Fsis.CollectionPeriodService.exe.config]"
                  ElementPath="/configuration/appSettings/add[\[]@key='RunTime'[\]]"
                  Action="setValue"
                  Name="value"
                  Value="[RUNTIME]"
                  Sequence="4"/>

  </Component>

This works just as I want – if RUNTIME is specified on the commandline for msiexec, the new element gets created; if not, nothing happens.

Why do I have to have the empty <CreateFolder/> within this component?

While I was trying to get this working, I found “Wix Condition Statement“, which showed a working component, but doesn’t explain why <CreateFolder/> is necessary.

Removing <CreateFolder/> gives me this error:

ICE18: KeyPath for Component: ‘C.Rbnz.Fsis.CollectionPeriodService.exe.config.runtime’ is Directory: ‘INSTALLDIR’. The Directory/Component pair must be listed in the CreateFolders table.

which is, I’m sure, quite informative once you know what it means.

  • 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-06-10T16:48:54+00:00Added an answer on June 10, 2026 at 4:48 pm

    Every component has a key path; the most common is a file. Your component doesn’t have a file or other key path, so WiX gives it the default of a directory. Windows Installer then comes along and says that components with directory key paths must ensure the directory is created, even if something else will do so. It’s a silly rule with an easy fix.

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

Sidebar

Related Questions

I need an empty char array, but when i try do thing like this:
I need to remove element from com.google.gwt.core.client.JsArray . Also I need to empty the
In order convert a List to an array, you need an empty array like
So I've learned that I need an empty constructor in order for my fragments
I have a rendered Highcharts chart on a website and I need to empty
I have a file (file.txt), and I need to empty his current content, and
I need a method that creates an empty clone of an object in a
I need to check to see if a directory is empty. The problem is,
I need to validate submitted form data: To check whether fields are empty. Proceed
I need to get patch file for inital commit (which is not empty) for

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.