Hi.

I have 2 applications (A and B) that both shared the same feature (X).
I want the user to be able to decide where X is placed, X, however, may 
only exist at one location. 

I figure I would go for the following approach:
Feature X should have the "ConfigurableDirectory" property if, and only
if, X was
not allready installed by another application.

This is the code I ended up with:
<?xml version="1.0" encoding="iso-8859-1"?>

<Wix xmlns='http://schemas.microsoft.com/wix/2003/01/wi'>
  <Product Id='F7F4FCDF-7197-4C0D-B16F-354EC3466D95' Name='Test1'
Language='1033'
           Version='1.0.0.0' Manufacturer='Test'>
    <Package Id='????????-????-????-????-????????????'
              InstallerVersion='200' Compressed='yes' />

    <Media Id='1' Cabinet='product.cab' EmbedCab='yes' />

    <Property Id="X_DIR">
      <RegistrySearch Id="X" Type="raw" Root="HKLM"
          Key="Software\Test\Test1\X" Name="installdir"/>
    </Property>

    <Directory Id='TARGETDIR' Name='SourceDir'>
      <Directory Id='ProgramFilesFolder' Name='PFiles'>
        <Directory Id='INSTALLDIR' Name='Test1'>
          <Directory Id='X_DIR' Name='X'>
            <Component Id='comp'
Guid='12345678-1234-1234-1234-123456789013'>
              <File Id='file' Name='file' DiskId='1' src='test1.wxs' />
            </Component>
          </Directory>
        </Directory>
      </Directory>
    </Directory>

    <Feature Id='top' Title='Test App' Level='1'
ConfigurableDirectory='INSTALLDIR'>
      <Feature Id="featureXConfig" Level="1"
ConfigurableDirectory="X_DIR" Title="X">
        <Condition Level="0">(X_DIR)</Condition>
        <ComponentRef Id="comp"/>
      </Feature>

      <Feature Id="featureXNoConfig" Level="1" Title="X">
        <Condition Level="0">NOT X_DIR</Condition>
        <ComponentRef Id="comp"/>
      </Feature>      
      
    </Feature>

    <UIRef Id="WixUI_Mondo"/>

  </Product>
</Wix>


However the resulting installation does not install "Feature1" unless I
add the property
Absent="disallow" to the feature properties. What's the reason for this?

- Lars


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to