I am trying to copy some of the files from installation location to other folder during install. When I set the SourceDirectory/SourceProperty to a hardcoded location the setup works fine as expected. But when I replace the SourceDirectory to "INSTALLFOLDER" then the files are not copied during install.
Here is the full source code,
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="FolderCopySetupProject" Language="1033"
Version="1.0.0.0" Manufacturer="Microsoft"
UpgradeCode="PUT-GUID-HERE">
<Package InstallerVersion="200" Compressed="yes"
InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="Newer version installed." />
<MediaTemplate EmbedCab="yes" />
<Feature Id="ProductFeature" Title="FolderCopySetupProject" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="PE" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<Property Id="DestFilesFolder" Value="C:\Temp\" />
<Component Id="cmpCC76E631D128DE73CBFBA4A3C6F364AC" Guid="*"
Directory="INSTALLFOLDER" KeyPath="yes">
<File Id="filCDC69907319511E61137A95EF50FAB30" Source="a.txt" />
<File Id="filCDC69907319511E61137A95EF50FAB31" Source="b.txt" />
</Component>
<Component Id="CMP_LOG4TXT" Guid="*"
Directory="INSTALLFOLDER" KeyPath="yes">
<CopyFile Id="Copy_LOG4TXT" SourceDirectory="INSTALLFOLDER"
SourceName="*"
DestinationProperty="DestFilesFolder"/>
</Component>
<ComponentGroup Id="ProductComponents">
<ComponentRef Id="cmpCC76E631D128DE73CBFBA4A3C6F364AC" />
<ComponentRef Id="CMP_LOG4TXT" />
</ComponentGroup>
</Fragment>
</Wix>
Here is the log file information,
Executing op:
ComponentRegister(ComponentId={341BD660-7249-42DD-9744-DBEF0776AD52},KeyPath=C:\Program
Files (x86)\PE,State=3,,Disk=1,SharedDllRefCount=0,BinaryType=0) MSI
(s) (A0:64) [11:30:49:374]: Executing op:
ActionStart(Name=CreateFolders,Description=Creating
folders,Template=Folder: [1]) MSI (s) (A0:64) [11:30:49:375]:
Executing op: FolderCreate(Folder=C:\Program Files
(x86)\PE\,Foreign=0,,) MSI (s) (A0:64) [11:30:49:379]: Executing op:
FolderCreate(Folder=C:\Program Files (x86)\PE\,Foreign=0,,) MSI (s)
(A0:64) [11:30:49:380]: Executing op:
ActionStart(Name=InstallFiles,Description=Copying new
files,Template=File: [1], Directory: [9], Size: [6]) MSI (s)
(A0:64) [11:30:49:381]: Executing op:
ProgressTotal(Total=2,Type=0,ByteEquivalent=1) MSI (s) (A0:64)
[11:30:49:381]: Executing op: SetTargetFolder(Folder=C:\Program Files
(x86)\PE\) MSI (s) (A0:64) [11:30:49:381]: Executing op:
SetSourceFolder(Folder=1\PE\) MSI (s) (A0:64) [11:30:49:381]:
Executing op: ChangeMedia(,MediaPrompt=Please insert the disk:
,MediaCabinet=cab1.cab,BytesPerTick=65536,CopierType=2,ModuleFileName=C:\Windows\Installer\37a12097.msi,,,,,IsFirstPhysicalMedia=1)
MSI (s) (A0:64) [11:30:49:381]: Executing op:
FileCopy(SourceName=a.txt,SourceCabKey=filCDC69907319511E61137A95EF50FAB30,DestName=a.txt,Attributes=512,FileSize=1,PerTick=65536,,VerifyMedia=1,,,,,CheckCRC=0,,,InstallMode=58982400,HashOptions=0,HashPart1=-1183465204,HashPart2=-1464405568,HashPart3=-493239503,HashPart4=1629910889,,)
MSI (s) (A0:64) [11:30:49:382]: File: C:\Program Files
(x86)\PE\a.txt; To be installed; Won't patch; No existing file MSI
(s) (A0:64) [11:30:49:382]: Source for file
'filCDC69907319511E61137A95EF50FAB30' is compressed
Looks like the files are not available in the "INSTALLFOLDER" for copying, I am not sure how to sequence the Components to execute in order. (InstallExecuteSequence On="AfterInstall" something like that)
Anyhelp would be very much appreciated
Thanks, Rajesh