Thank you very much, Rob! It helped.

The new code is below.

--
<DirectoryRef Id="INSTALLDIR">
        <Component Id="LicenseComponent" Guid="MyGUID">
                <CopyFile Id="LicenseCopyFile"
SourceProperty="LICENSEFILEPATH" DestinationDirectory="INSTALLDIR" />
        </Component>
</DirectoryRef>


<CustomAction Id="SetLicenseFileDestinationPath" Property="LICENSEFILEPATH"
Value="[LicenseFolder][LICENSEFILENAME]" />

<InstallExecuteSequence>
        <Custom Action="SetLicenseFileDestinationPath"
Before="InstallInitialize" />
</InstallExecuteSequence>
--

Best regards,
Natalia Gladkova 

-----Original Message-----
From: Rob Hamflett [mailto:r...@snsys.com] 
Sent: Monday, April 06, 2009 2:15 PM
To: wix-users@lists.sourceforge.net
Subject: Re: [WiX-users] CopyFile doesn't work

Rather than using SourceDirectory and SourceName the way you are, I think
you need to use 
SourceProperty.

Rob

Natalia Gladkova wrote:
> Hello all,
> 
> I'm building an installation package with Wix 3.0.5120.0.
> 
> I need to copy a license file from the target machine to the installation
> directory.
> 
> The code is the following:
> 
> --
> <Directory Id="TARGETDIR" Name="SourceDir">
>       <Directory Id="LicenseFolder" Name="License"></Directory>
>       <Directory Id="ProgramFilesFolder" Name="PFiles">
>               <Directory Id="INSTALLDIR" Name="AS"></Directory>
>       </Directory>
> </Directory>
> 
> 
> <DirectoryRef Id="INSTALLDIR">
>       <Component Id="LicenseComponent" Guid="MyGUID">
>               <CopyFile Id="LicenseCopyFile"
> SourceDirectory="LicenseFolder"   SourceName="[LICENSEFILENAME]"
> DestinationDirectory="INSTALLDIR" />
>       </Component>
> </DirectoryRef>
> 
> 
> <Feature Id="License" Display="hidden" Title="License" Level="1">
>       <ComponentRef Id="LicenseComponent" />
> </Feature>
> --
> 
> License folder is chosen by user through the Browse dialog. I check that
> there is the file with the name "[LICENSEFILENAME]" in it.
> 
> However, the file is not being copied. I can't see what I'm doing wrong.
Any
> help will be greatly appreciated.
> 
> Best regards,
> Natalia Gladkova 
> 
> 
>
----------------------------------------------------------------------------
--


----------------------------------------------------------------------------
--
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to