[wix-users] Independent Directory element

Edwin Castro egcastr at gmail.com
Tue Jan 16 09:23:27 PST 2018


"There may only be a single root
directory per product or module and it's Id attribute value must be
TARGETDIR and it's Name attribute value must be SourceDir."

That is a rule of how Windows Installer works.

What do you mean by independent Directory?

I define Directories in fragments all the time. You just need to ensure
they are all children of TARGETDIR directly or indirectly.

<Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir"/>
</Fragment>
<Fragment>
    <DirectoryRef Id="TARGETDIR">
        <Directory Id="CommonAppDataFolder"/>
    </DirectoryRef>
</Fragment>
<Fragment>
    <DirectoryRef Id="TARGETDIR">
        <Directory Id="ProgramFilesFolder"/>
    </DirectoryRef>
</Fragment>
<Fragment>
    <DirectoryRef Id="TARGETDIR">
        <Directory Id="ProgramFiles64Folder"/>
    </DirectoryRef>
</Fragment>
<Fragment>
    <DirectoryRef Id="CommonAppDataFolder">
        <Directory Id="CADCompanyFolder" Name="MyCompany"/>
    </DirectoryRef>
</Fragment>
<Fragment>
    <DirectoryRef Id="ProgramFilesFolder">
        <Directory Id="PF32CompanyFolder" Name="MyCompany"/>
    </DirectoryRef>
</Fragment>
<Fragment>
    <DirectoryRef Id="ProgramFiles64Folder">
        <Directory Id="PF64CompanyFolder" Name="MyCompany"/>
    </DirectoryRef>
</Fragment>
<Fragment>
    <DirectoryRef Id="CADCompanyFolder">
        <Directory Id="CADApplicationFolder" Name="MyApplication"/>
    <DirectoryRef>
</Fragment>
<Fragment>
    <DirectoryRef Id="PF32CompanyFolder">
        <Directory Id="PF32ApplicationFolder" Name="MyApplication"/>
    </DirectoryRef>
</Fragment>
<Fragment>
    <DirectoryRef Id="PF64CompanyFolder">
        <Directory Id="PF64ApplicationFolder" Name="MyApplication"/>
    </DirectoryRef>
</Fragment>

--
Edwin G. Castro



On Tue, Jan 16, 2018 at 8:17 AM, Ven H via wix-users <
wix-users at lists.wixtoolset.org> wrote:

> Can't I define an independent Directory element inside a separate fragment
> or component? If I do that, I get an error saying "The directory with the
> Id 'TestDir' is not a valid root directory. There may only be a single root
> directory per product or module and it's Id attribute value must be
> TARGETDIR and it's Name attribute value must be SourceDir. " Sorry for
> asking such a silly question, but I am new to WiX, so, please forgive me. I
> am a newbie and a learner and could use all the help. Hence, please help.
>
> Regards,
> Venkatesh
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>



More information about the wix-users mailing list