【发布时间】:2012-05-26 02:30:51
【问题描述】:
我正在为 Web 服务开发 WIX 3.6 安装程序。但是我在尝试使用 HeatDirectory 来获取所有必要的输出时遇到了一个问题,无论我尝试什么,每个获取的文件都会出现以下错误:
系统找不到文件'SourceDir\Some.dll...'
WcfService.wxs 中出现错误;奇怪的是 WcfService.wxs 是由我的项目文件中的 heatdirectory 部分自动创建的(如下)。 如果它必须首先知道它们在哪里来创建 WcfService.wxs,它怎么能说它找不到这些 .dll? 这些错误甚至在我下载并构建一个我读过的任何一篇教程中的 WIX 示例项目(原样)。
目标:尽可能多地自动化 .dll 包含(即利用收集来处理依赖项项目等)
我正在运行 Win 7 64bit,项目是 .NET 4。
Product.wxs:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="CompleteInstall" Language="1033" Version="1.0.0.0" Manufacturer="Technologies" UpgradeCode="b2ae6aa5-263f-4f9a-a250-8599a7f2cb03">
<Package InstallerVersion="200" Compressed="yes" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="CommonDir1" Name="Common Directory 1">
<Directory Id="CommonDir2" Name="Common Directory 2">
<Directory Id="INSTALLFOLDER" Name="Install Directory"/>
</Directory>
</Directory>
</Directory>
</Directory>
<Feature Id="ProductFeature" Title="CompleteInstall" Level="1">
<ComponentGroupRef Id="WcfService_Project" />
</Feature>
<Property Id="WIXUI_INSTALLDIR">INSTALLFOLDER</Property>
<UIRef Id="WixUI_InstallDir" />
</Product>
</Wix>
项目文件:
<Target Name="BeforeBuild">
<MSBuild Projects="%(ProjectReference.FullPath)" Targets="Build" Properties="Configuration=$(Configuration);Platform=x86" Condition="'%(ProjectReference.ContentProject)'=='True'" />
<PropertyGroup>
<LinkerBaseInputPaths>%(ProjectReference.RootDir)%(ProjectReference.Directory)bin\$(Platform)\$(Configuration)\</LinkerBaseInputPaths>
</PropertyGroup>
<HeatDirectory OutputFile="%(ProjectReference.Filename)-temp.xml"
Directory="%(ProjectReference.RootDir)%(ProjectReference.Directory)bin\$(Platform)\$(Configuration)\"
DirectoryRefId="INSTALLFOLDER"
ComponentGroupName="%(ProjectReference.Filename)_Project"
SuppressCom="true"
SuppressFragments="true"
SuppressRegistry="true"
SuppressRootDirectory="true"
AutoGenerateGuids="false"
GenerateGuidsNow="true"
ToolPath="$(WixToolPath)"
Condition="'%(ProjectReference.ContentProject)'=='True'" />
<XslTransformation XmlInputPaths="%(ProjectReference.Filename)-temp.xml"
XslInputPath="XslTransform.xslt"
OutputPaths="%(ProjectReference.Filename).wxs"
Condition="'%(ProjectReference.ContentProject)'=='True'" />
</Target>
WcfService.wxs:
<?xml version="1.0" encoding="utf-8"?><Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="INSTALLFOLDER">
<Component Id="cmpE6EBA3D8D6D4DB0C93E73200C78DCC51" Guid="{C88B5CF9-8807-45DF-AA6F-732437B74BB6}">
<File Id="fil0118BBA61671E80581CA9C9AA6DD3E8D" KeyPath="yes" Source="SourceDir\Some.dll" />
</Component>
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="WcfService_Project">
<ComponentRef Id="cmpE6EBA3D8D6D4DB0C93E73200C78DCC51" />
</ComponentGroup>
</Fragment>
</Wix>
【问题讨论】:
-
你能发布完整的 wxs 文件吗?可能您没有为 Some.dll 输入正确的目录...
-
@Wimmel,我已经用完整的 wxs 更新了原始帖子。谢谢!
-
@Wimmel,请记住,我说过我从多个来源下载的示例项目也会出现同样的问题。
-
你参考
WcfService_Project,应该是另一个文件作为片段。参见例如here。在链接的问题中使用Source="PathToFile"。PathToFile应该指向一个现有文件。 -
@Wimmel,这实际上是对来自收获的热目录的 wxs 的引用。请看我上面的更新,我已经为你添加了那个 wxs。旁注:我还看到了您在发布之前提供的示例。感谢您迄今为止的帮助,我真的很感激。
标签: visual-studio-2010 wix windows-installer wix3.6 heat