wix复制文件错误

wix复制文件错误,wix,wix3.5,Wix,Wix3.5,我得到这个错误: 中对符号“目录:SQLSERVERDATAPATH”的未解析引用 “产品”一节:* 更新: <DirectoryRef Id="SomeFolder"> <Component Id="cmpMDF" Guid="066AFD32-D9B4-42A9-AEE1-F1951DAE959F"> <File Id="MDF" Name="Database.MDF" Source="DatabaseScripts/Database/Databas

我得到这个错误:

中对符号“目录:SQLSERVERDATAPATH”的未解析引用 “产品”一节:*

更新:

<DirectoryRef Id="SomeFolder">
  <Component Id="cmpMDF" Guid="066AFD32-D9B4-42A9-AEE1-F1951DAE959F">
    <File Id="MDF" Name="Database.MDF" Source="DatabaseScripts/Database/Database.MDF" KeyPath="yes" ReadOnly="no">
      <CopyFile Id="MDFFileCopy" DestinationProperty="SQLSERVERDATAPATH" />
    </File>
  </Component>
  <Component Id="cmpLDF" Guid="311283B0-A6E8-402D-BB33-D1BEB6EA282B">
    <File Id="LDF" Name="Database.LDF" Source="DatabaseScripts/Database/Database.LDF" KeyPath="yes" ReadOnly="no">
      <CopyFile Id="LDFFileCopy" DestinationProperty="SQLSERVERDATAPATH" />
    </File>
  </Component>
</DirectoryRef>
日志:

MSI s 18:BC[13:42:32:002]:执行op:FileCopySourceName=Database.MDF,SourceCabKey=MDF,DestName=Database.MDF,Attributes=512,FileSize=1178468352,PerTick=32768,VerifyMedia=1,,,,,,CheckCRC=0,,,InstallMode=58982400,HashOptions=0,HashPart1=-67171634,HashPart2=622189464,HashPart3=-328220288,HashPart4=-1777642375

MSI s 18:BC[13:42:32:006]:文件:C:\Program Files\MyApp\Database\Database.MDF;待安装;不会修补;没有现有文件

MSI s 18:BC[13:42:32:009]:文件“MDF”的源已压缩 InstallFiles:File:Database.MDF,目录:C:\Program Files\MyApp\Database\,大小:1178468352

MSI s 18:BC[13:42:32:015]:注意:1:23182:C:\Program Files\MyApp\Database\Database.MDF

MSI s 18:BC[13:42:32:034]:注意:1:2360 这意味着您还必须在某个位置具有id=SQLSERVERDATAPATH的

编辑:看起来您想改用DestinationProperty=SQLSERVERDATAPATH。
请参见

我将其更改为DestinationProperty,现在它可以编译,但不会将文件复制到目标文件夹。我更新了我的帖子。我移动了内部元素,仍然是一样的;msiexec/i您的.msi/l*v C:\temp\install.log,并检查是否存在错误日志未显示任何错误。我用日志更新了我的帖子,使其更清晰。我发现CopyFile在Windows 7上工作,但在Windows XP上没有复制任何内容。请参阅此功能请求:
<DirectoryRef Id="SomeFolder">
  <Component Id="cmpMDF" Guid="066AFD32-D9B4-42A9-AEE1-F1951DAE959F">
    <File Id="MDF" Name="Database.MDF" Source="DatabaseScripts/Database/Database.MDF" KeyPath="yes" ReadOnly="no">
      <CopyFile Id="MDFFileCopy" DestinationProperty="SQLSERVERDATAPATH" />
    </File>
  </Component>
  <Component Id="cmpLDF" Guid="311283B0-A6E8-402D-BB33-D1BEB6EA282B">
    <File Id="LDF" Name="Database.LDF" Source="DatabaseScripts/Database/Database.LDF" KeyPath="yes" ReadOnly="no">
      <CopyFile Id="LDFFileCopy" DestinationProperty="SQLSERVERDATAPATH" />
    </File>
  </Component>
</DirectoryRef>