I achieve this by using a CopyFile elememt (a child of the File element). Basically I copy it to the install location and then copy the file to another arbitrary location like this:
<Component Id="cmpMycomponent" Guid="*" > <Condition> MYDIRPATH </Condition> <File Id="flefile.txt" KeyPath="yes" Source="$(var.MySourceDir)\file.txt" > <CopyFile Id="COPY_flefile.txt" DestinationProperty=" MYDIRPATH" /> </File> </Component> Note that you specify the destination directory as a property (which can be set dynamically -- I set it via a registry search). Hope that helps sanjay > -----Original Message----- > From: Gregg Swanson [mailto:gregg.swan...@microsoft.com] > Sent: 15 February 2011 16:14 > To: General discussion for Windows Installer XML toolset. > Subject: Re: [WiX-users] Using properties for Directories > > Sorry, I wasn't clear. > > I am looking for a WIX sample that would allow me to do something like > the following -- > > <Property Id="MyProperty" > Value="MyPropertyBasedFolderName" /> > > <Directory Id="TARGETDIR" Name="SourceDir"> > <Directory Id="ProgramFilesFolder"> > <Directory Id="INSTALLLOCATION" > Name="[MyProperty]"> > > </Directory> > </Directory> > </Directory> > > I would like to set the INSTALLLOCATION directory name dynamically at > install time. > > Thanks, > Gregg > > > -----Original Message----- > From: Pally Sandher [mailto:pally.sand...@iesve.com] > Sent: Tuesday, February 15, 2011 9:53 AM > To: General discussion for Windows Installer XML toolset. > Subject: Re: [WiX-users] Using properties for Directories > > TARGETDIR is the root of your Directory Tree. It essentially represents > the root of the drive you're installing to (as in C: or D: or E: etc). > > You shouldn't be trying to use TARGETDIR to install your product in a > standard installation. This is covered in the tutorial (see > http://www.tramontana.co.hu/wix/lesson1.php#1.2) > > Palbinder Sandher > Software Deployment Engineer > T: +44 (0) 141 945 8500 > F: +44 (0) 141 945 8501 > > http://www.iesve.com > **Design, Simulate + Innovate with the <Virtual Environment>** > Integrated Environmental Solutions Limited. Registered in Scotland No. > SC151456 > Registered Office - Helix Building, West Of Scotland Science Park, > Glasgow G20 0SP Email Disclaimer > > -----Original Message----- > From: Gregg Swanson [mailto:gregg.swan...@microsoft.com] > Sent: 15 February 2011 15:26 > To: General discussion for Windows Installer XML toolset. > Subject: Re: [WiX-users] Using properties for Directories > > I have a similar requirement, I was hoping to find a sample... > > Thanks, > Gregg > > -----Original Message----- > From: Rob Mensching [mailto:r...@robmensching.com] > Sent: Monday, February 14, 2011 11:11 PM > To: General discussion for Windows Installer XML toolset. > Subject: Re: [WiX-users] Using properties for Directories > > All directories must be rooted in TARGETDIR. This old series of blog > posts might be useful: > http://blogs.msdn.com/b/robmen/archive/2006/10/17/deciphering-the-msi- > di > rectory-table-part-7-directories-are-properties.aspx > > On Mon, Feb 14, 2011 at 7:41 AM, John Thornborrow > <j...@pinesoft.co.uk>wrote: > > > Hi all, > > > > I'm quite green when it comes to WiX. > > > > Has anyone got any examples of creating an arbitrary folder outside > of > > > the TARGETDIR? > > > > And is it possible (and how to do so) to have a property for that > > path, and then have subdirectories created from/in it? > > > > Sorry if I'm too vague.. > > > > I envision something like this: > > > > <Directory Id="TARGETDIR" Name="SourceDir"> <!--the rest snipped --> > > </Directory> > > > > <Property ID="RootPath"><![CDATA[c:\root\]]></Property> > > > > <Directory Id="RootPath" Name="."> > > <Directory Name="foo" /> > > <Directory Name="bar" /> > > </Directory> > > > > > > Consider your responsibility to the environment - think before you > print! > > > > > > > ********************************************************************** > > ******************************************************************** > > This email is from Pinesoft Limited. Its contents are confidential to > > the intended recipient(s) at the email address(es) to which it has > > been addressed. It may not be disclosed to or used by anyone other > > than the addressee(s), nor may it be copied in anyway. If received in > > error, please contact the sender, then delete it from your system. > > Although this email and attachments are believed to be free of virus, > > or any other defect which might affect any computer or IT system into > > which they are received and opened, it is the responsibility of the > > recipient to ensure that they are virus free and no responsibility is > > accepted by Pinesoft for any loss or damage arising in any way from > receipt or use thereof. > > > ********************************************************************** > > ********************************************************************* > > > > > > Pinesoft Limited are registered in England, Registered number: > 2914825. > > Registered office: 266-268 High Street, Waltham Cross, Herts, EN8 7EA > > > > > > --------------------------------------------------------------------- > - > > -------- The ultimate all-in-one performance toolkit: Intel(R) > > Parallel Studio XE: > > Pinpoint memory and threading errors before they happen. > > Find and fix more than 250 security defects in the development cycle. > > Locate bottlenecks in serial and parallel code that limit > performance. > > http://p.sf.net/sfu/intel-dev2devfeb > > _______________________________________________ > > WiX-users mailing list > > WiX-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/wix-users > > > > > > > -- > virtually, Rob Mensching - http://RobMensching.com LLC > ----------------------------------------------------------------------- > - > ------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio > XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > > > ----------------------------------------------------------------------- > - > ------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio > XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > > > > ----------------------------------------------------------------------- > ------- > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio > XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > > ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users