wixwindows-installer

Why does property from directory ID not get set to expected value in WiX source?


    <Fragment>
        <StandardDirectory Id="ProgramFilesFolder">
            <Directory Id="INSTALLDIR" Name="FurooAccountantSync" />
        </StandardDirectory>
    </Fragment>

    <Fragment>
        <StandardDirectory Id="ProgramFilesFolder">
            <Directory Id="ACCOUNTSYNCDIR" Name="Sync" />
        </StandardDirectory>
    </Fragment>

The problem here is that INSTALLDIR is set to the expected value, but that ACCOUNTSYNCDIR stays empty.

When checking their contents in my dialog with

<Control Id="QueryLabel" Type="Text" X="48" Y="140" Width="220" Height="15" Text="#[INSTALLDIR]#[ACCOUNTSYNCDIR]#" />

this is the result I get:

enter image description here

The problem I am trying to solve is that at installation time (and perhaps also when repairing/patching) the user should be able to select a path to a directory where data will be downloaded. This value should be saved into a local configuration file.

To complete, this is with Wix 6 (well, I did install the latest HeatWave extension in VS2022).


Solution

  •     <Fragment>
            <StandardDirectory Id="ProgramFilesFolder">
                <Directory Id="INSTALLDIR" Name="FurooAccountantSync" />
                <Directory Id="ACCOUNTSYNCDIR" Name="Sync" />
            </StandardDirectory>
        </Fragment>
    

    This is the solution to my problem, there should apparently not be two fragments for directories.