tags:

views:

32

answers:

1

I need some clarification on the directory structure in *.wxs files. As far as i know it install the files in the directory that we have specified in the directory element. Does it have any other use?

If it does describe the directory structure where the product will be installed, than what will happen if the user has a browse option in the installer.

what will i have to do if i don't want any directory structure in my .msm file?

      <Directory Id='TARGETDIR' Name='SourceDir'>
         <Directory Id='MyModuleDirectory' Name='.'>
            <Component Id='MyModuleComponent' Guid='87654321-4321-4321-4321-110987654321'>
               <File Id='readme2' Name='readme2.txt' src='readme2.txt' />
            </Component>
         </Directory>
      </Directory>
    </Module>
</Wix>
+1  A: 

A couple of points:

1) You must have a directory in your MSM as every component must belong to a directory.

2) When you merge the module into your installer, you associate / redirect the modules directory to be a child of a directory in your installer. For example:

<!-- in your MSI .wxs -->
<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramFilesFolder">
    <Directory Id="CompanyFolder" Name="DeploymentEngineering">
      <Directory Id="INSTALLLOCATION" Name="Fireworks">
        <Merge Id="FireworksMM" SourceFile="..." DiskId="1" Language="1033">

This means INSTALLLOCATION will have a default value of:

[ProgramFilesFolder]DeploymentEngineering\Fireworks

Since the module's directory has a value of '.' and INSTALLLOCATION as it's parent, it will also have a default value of [ProgramFilesFolder]DeploymentEngineering\Fireworks

If a user hits the browse button and changes the value of INSTALLLOCATION to another directory all will be fine because the modules directory is still a child of INSTALLLOCATION with a value of '.'.

Make sense?

Christopher Painter