2014-10-02 16:57 GMT-03:00 Pavan Konduru <pavan.kond...@accelrys.com>:
> Hi,
>
> I have used conditional component install this way, which works for me when I 
> don't want to install a file in some situations:
>
> <Component Id="someComponent" Guid="{DE943477-4229-45f8-8A02-5300ACCC6A39}">
>           <Condition>KEY_FOUND</Condition>
>   <File Id="someFIle" Source="\file_path " KeyPath="yes" ></File>
> </Component>
>
> Can the same be done for a directory? I want a directory created only a 
> particular condition.
>
> Or will it suiffice to add the component condition to each of the files under 
> the directory like this? Will it create an empty directory if KEY_FOUND does 
> not exist?
>
> <Directory Id="my_dir" Name="MyDir">
>               <Component Id="comp1 " 
> Guid="{C4A78194-1EB2-4bcd-A801-33C445AB94B2}">
>                    <Condition>KEY_FOUND</Condition>
>                 <File Id="file1" Source="\path_to_file1 " KeyPath="yes" 
> ></File>
>               </Component>
>               <Component Id="comp2" 
> Guid="{C3B5C0A9-81F0-4178-B093-A8AB00728028}">
>                   <Condition>KEY_FOUND</Condition>
>                 <File Id="file2" Source="\path_to_file2" KeyPath="yes" 
> ></File>
>               </Component>
> </Directory>

Directories are created on-demand when files are created inside them.
The only case where Windows Installer will make an empty directory is
if you explicitly ask for one using the CreateFolder element. An empty
<Directory>, or in your case, a <Directory> with components that are
conditioned away, will not make an empty directory on disk.

So your code will do what you want.

-- 
Nicolás

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to