This is useful if you want to provide a hook for other fragments to
reference - for example you might have a <DirectoryRef> element
pointing to SFSAEWSBIN, in a totally seperate wxs file.  This allows
you to split up your source code in a meaningful way - say directories
in one wxs and various components for different modules each with its
own .wxs file but all going into that folder.

In addition, even if there are no components pointing to that
directory, its path does get set as a property.  Suppose you want to
write a path to the registry to tell your app where it should put data
files.  You don't need to create the directory, since in my example
the app will take care of that, so there's no need for a component
with a CreateFolder record.  To do this, you can reference
[SFSAEWSBIN] in the Registry/@Value attribute.  However, if you want
the SFSAEWSBIN directory to be created even though it has no files,
you need the Component and CreateFolder elements.

HTH

John

2009/6/24 Jirong Hu <[email protected]>:
> Thanks for your reply, John.
>
> Then what's the purpose of the first piece of code snip if they don't create 
> the folder?
>
> For example, I found two pieces of code to create a web application in IIS, 
> one creates the folders and the other create the virtual directory. BTW, do 
> we need to create the directory first in order to create a web site?
>
>  <Directory Id="TARGETDIR" Name="SourceDir">
>      <Directory Id="IISMain" Name="Inetpub">
>        <Directory Id="WWWMain" Name="wwwroot">
>          <Directory Id="SFSAEWS" Name="SFS.Assessment.WebService">
>            <Directory Id="SFSAEWSBIN" Name="bin" />
>            <Directory Id="SFSAEWSREF" Name="ReferenceData" />
>          </Directory>
>        </Directory>
>      </Directory>
>
>
>        <DirectoryRef Id="TARGETDIR">
>                        <Component Id='SFSAEAppPoolComp' 
> Guid='B7D1E298-5A98-11DE-937D-1DD455D89593' >
>                                <iis:WebAppPool Id='SFSAEAppPool' 
> Name='Assessment Engine AppPool'>
>                                </iis:WebAppPool>
>                        </Component>
>            <Component Id="CreateVirDirs_" 
> Guid="71D67525-D378-4169-AAF0-71C4B4D87D8B">
>                <!-- Alias: the URL-relative name of the virtual directory; 
> Directory: the ID of the physical directory -->
>                <iis:WebVirtualDir Id="SFSAssessmentWebServiceVirtualDir"
>                                        Alias="SFS.Assessment.WebService"
>                                        Directory="SFSAEWS"
>                                        WebSite="DefaultWebSite"
>                                        DirProperties="WebDirAnonAndNT">
>                    <iis:WebApplication 
> Id="SFSAssessmentWebServiceWebApplication" Name="SFS.Assessment.WebService" 
> WebAppPool="SFSAEAppPool">
>
>
> -----Original Message-----
> From: John Ludlow [mailto:[email protected]]
> Sent: Wednesday, June 24, 2009 10:06 AM
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] About <Directory>, what's the difference?
>
> The difference is <CreateFolder/>
>
> What's going on here is that MSI will never create a directory if
> there are no files to be installed there - unless you add the
> directory to the CreateFolders table by adding <CreateFolder/> under a
> component in that directory.  Yes, that's right you need a component
> per empty folder so that MSI can use that to decide *when* the folder
> should be created - what features it belongs to, when to remove it,
> and so on.
>
> HTH
>
> John
>
> 2009/6/24 Jirong Hu <[email protected]>:
>> I tried the following, the last four directories are not created, why?
>>
>>        <!-- Temp folders -->
>>                <Directory Id="Root" Name="Root">
>>                        <Directory Id="Temp" Name="Temp">
>>                                <Directory Id="Exceptions" Name="Except" 
>> LongName="SFS Exceptions Trace Output">
>>                                        <Component Id="TempFolderExcept" 
>> Guid="0A809D08-5518-11DE-8B06-BA3956D89593">
>>                                                <CreateFolder 
>> Directory="Exceptions"/>
>>                                        </Component>
>>                                        <Directory Id="ExCONNX" Name="CONNX">
>>                                                <Component 
>> Id="TempFolderCONNX" Guid="BFAC81A5-5165-45e5-AA6E-0800331C464C">
>>                                                        <CreateFolder/>
>>                                                </Component>
>>                                        </Directory>
>>                                        <Directory Id="ExBridge" 
>> Name="Bridge">
>>                                                <Component 
>> Id="TempFolderBridge" Guid="D1F1514A-375D-4d70-803E-50C151A65011">
>>                                                        <CreateFolder/>
>>                                                </Component>
>>                                        </Directory>
>>                                        <Directory Id="TempWebServices" 
>> Name="SFSWebSe" LongName="SFSWebServices"/>
>>                                        <Directory Id="TempInternal" 
>> Name="Internal"/>
>>                                        <Directory Id="TempStudent" 
>> Name="Student"/>
>>                                        <Directory Id="TempInstitution" 
>> Name="Institut" LongName="Institution"/>
>>                                </Directory>
>>                        </Directory>
>>                </Directory>
>>
>>
>> -----Original Message-----
>> From: Jirong Hu [mailto:[email protected]]
>> Sent: Wednesday, June 24, 2009 9:41 AM
>> To: 'General discussion for Windows Installer XML toolset.'
>> Subject: [WiX-users] About <Directory>, what's the difference?
>>
>> Hi
>>
>> Both of these two methods will create directories, what's the difference?
>>
>> -------------------------------
>> <Directory Id="WebRoots" Name="WebRoots">
>>                <Directory Id="WebServices" Name="SFSWebSe" 
>> LongName="SFSWebServices"/>
>>                <Directory Id="Internal" Name="Internal"/>
>>                <Directory Id="Student" Name="Student"/>
>>                <Directory Id="Institution" Name="Institut" 
>> LongName="Institution"/>
>> </Directory>
>> --------------------------------
>>
>> ~~~~~~~~~~~~~~~~
>> <Directory Id="ExBridge" Name="Bridge">
>>                <Component Id="TempFolderBridge" 
>> Guid="D1F1514A-375D-4d70-803E-50C151A65011">
>>                                <CreateFolder/>
>>                </Component>
>> </Directory>
>> ~~~~~~~~~~~~~~~~~~~~
>>
>> Thanks
>> Jirong Hu
>> Build Master
>> 780-644-5488
>>
>>
>> This communication is intended for the use of the recipient to which it is 
>> addressed, and may contain confidential, personal, and or privileged 
>> information. Please contact us immediately if you are not the intended 
>> recipient of this communication, and do not copy, distribute, or take action 
>> relying on it. Any communication received in error, or subsequent reply, 
>> should be deleted or destroyed.
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> WiX-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/wix-users
>>
>> This communication is intended for the use of the recipient to which it is 
>> addressed, and may contain confidential, personal, and or privileged 
>> information. Please contact us immediately if you are not the intended 
>> recipient of this communication, and do not copy, distribute, or take action 
>> relying on it. Any communication received in error, or subsequent reply, 
>> should be deleted or destroyed.
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> WiX-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/wix-users
>>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> WiX-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
> This communication is intended for the use of the recipient to which it is 
> addressed, and may contain confidential, personal, and or privileged 
> information. Please contact us immediately if you are not the intended 
> recipient of this communication, and do not copy, distribute, or take action 
> relying on it. Any communication received in error, or subsequent reply, 
> should be deleted or destroyed.
>
> ------------------------------------------------------------------------------
> _______________________________________________
> WiX-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>

------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to