What is the meaning of WiX configurable directory?

2019-03-06 04:05发布

I have a test installer that has 2 features A and B. A has 2 files a1 and a2, B has also 2 files b1 and b2(Each file belongs to individual component).

Feature A = {a1, a2}
Feature B = {b1, b2}

And the installation location for each file is as follows(somewhat mixed):

[ProgramFilesFolder]
    MyApp\
        Dir1\
            a1
            b1
        Dir2\
            a2
            b2

I set feature A's configurable directory to Dir1 and feature B's to Dir2.

When I launch the installer feature tree dialog says feature A's install location is [ProgramFilesFolder]\MyApp\Dir1 and feature B's install location is [ProgramFilesFolder]\MyApp\Dir2, like meaning a1, a2(feature A) are installed into Dir1 and b1, b2(featuer B) into Dir2.

But actual installation result is that a1, b1 are installed into Dir1 and a2, b2 are installed into Dir2. Of course, this is very normal behavior compared to my source code, but I don't get what the configurable diretory means in this situation.

2条回答
乱世女痞
2楼-- · 2019-03-06 04:51

This is for the feature selection tree and browse button on a custom setup dialog. You can associate a directory to the feature so that the user can select which directory the feature goes to.

The reality is most applications have all features (if they have more then one in the first place) all use the same configurable directory. ( Say INSTALLLOCATION for WiX, TARGETDIR for VDPROJ or INSTALLDIR for InstallShield ) Even then though components can actually have whatever directory they need for their destination so changing the destination for a feature doesn't actually mean every component in that feature will go to that directory. Some might need to go to places like SystemFolder.

In the more advanced scenarios you might have features broken out into say Windows App, Windows Service, WebUI and you might want to select where each of those go on the machine.

Make sense?

查看更多
Deceive 欺骗
3楼-- · 2019-03-06 04:53

For summary:

If I understood correctly, ConfigurableDirectory of a feature only has effect on its components that are installed under that ConfigurableDirectory. That is, a user can only change the target directory of components (of a feature) that are under ConfigurableDirectory.

查看更多
登录 后发表回答