[wix-users] Strategies for Reducing Installer Code Duplication

Edwin Castro egcastr at gmail.com
Fri Sep 18 14:00:37 PDT 2020

On Fri, Sep 18, 2020 at 1:05 PM Todd Hoatson via wix-users <
wix-users at lists.wixtoolset.org> wrote:

> So Directories and DirectoryRefs can contain Components, but not
> ComponentRefs or ComponentGroups or ComponentGroupRefs...?
> And a Directory can be specified by Id on a ComponentGroup, but not on a
> Component or a ComponentRef...?
> So it would seem impossible to define the components in a Fragment and then
> define a directory structure in the main WiX file with references to those
> components.  Correct?

Components reference Directories, not the other way around. A Component
defined inside a Directory simply references that Directory. These
Components are not contained within a ComponentGroup, FeatureGroup, or
Feature so they must be referenced individually using ComponentRef either
directly in a Feature or indirectly via a ComponentGroupRef or

You can define your Directory structure in the main WiX file, or its own
Fragment, and then reference Directories from Components or
ComponentGroups. To get those Components installed by your MSI, they will
still need to be referenced directly or indirectly from one or more

Edwin G. Castro

More information about the wix-users mailing list