.net - Wix 安装程序和 XSLT - 省略特定目录中的某些文件

标签 .net xslt wix installation wix3.5

我正在按照以下链接中给出的步骤创建安装程序。我是 Wix 安装程序的新手。

Creating WIX Installer using DotNet

使用上述文章中给出的步骤,我能够创建 Wix 项目并且它也运行良好。

这里我使用 Xsl 来控制我不想包含的文件。

<xsl:key name="xml-search" match=" wix:Component[contains(wix:File/@Source, '.xml')]" use ="@Id " />
<!--Match and ignore leftover .xml files on developer machines -->  
<xsl:template match=" wix:Component[key('xml-search', @Id)]" />  
<xsl:template match=" wix:ComponentRef[key('xml-search', @Id)]" />

我正在为 dotNet web 应用程序创建 WIX 安装程序。所以我正在发布应用程序并将路径分配给 .Wixproj。

<Target Name="BeforeBuild">
<HeatDirectory NoLogo="$(HarvestDirectoryNoLogo)"
SuppressAllWarnings="$(HarvestDirectorySuppressAllWarnings)"
SuppressSpecificWarnings="$(HarvestDirectorySuppressSpecificWarnings);"
ToolPath="$(WixToolPath)"
TreatWarningsAsErrors="$(HarvestDirectoryTreatWarningsAsErrors)"
TreatSpecificWarningsAsErrors="$(HarvestDirectoryTreatSpecificWarningsAsErrors)"
VerboseOutput="$(HarvestDirectoryVerboseOutput)" AutogenerateGuids="false"
GenerateGuidsNow="true" OutputFile="Components.wxs"
SuppressFragments="$(HarvestDirectorySuppressFragments)"
SuppressUniqueIds="$(HarvestDirectorySuppressUniqueIds)"
Directory="D:\wixTest\Custom\WebApplication" ComponentGroupName="C_CommonAssemblies"
Transforms="WIXInstaller.xslt" DirectoryRefId="TARGETDIR" KeepEmptyDirectories="false" 
PreprocessorVariable="var.SourceDir" SuppressCom="%(HarvestDirectory.SuppressCom)"
SuppressRootDirectory="true" SuppressRegistry="%(HarvestDirectory.SuppressRegistry)">
</HeatDirectory>

问题是它正在删除项目目录中的所有 .XML 文件。我只想从特定目录 (\bin) 中删除。那可能吗 ?如果是,请指导我..

最佳答案

目前还不清楚您如何知道 bin 文件夹中有哪些文件,但我会试一试。

如果 Source 属性包含完整的文件路径:

<xsl:key name="xml-search" match=" wix:Component[contains(wix:File/@Source, '.xml') and contains(wix:File/@Source,'\bin')]" use ="@Id " />

关于.net - Wix 安装程序和 XSLT - 省略特定目录中的某些文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21180054/

相关文章:

c# - 在没有 OverflowException 的情况下将 "1.79769313486232E+308"转换为 double?

.net - TFS Issue : No source control options (get latest, check-out, check-in) 解决方案

WiX 与 Windows Installer 版本(架构)的兼容性

wix 64 位 DLL 自定义操作支持?

wix - 在 WIX 安装程序中自定义对话框图像和横幅图像

c# - 在 winform 中播放和暂停 .GIF 动画

c# - 没有从 visual studio 2015 中的文件中获取选项 sqlite 数据库

xml - 如何将多个 xml 文件转换并合并为一个文件

xml - 如何使用 XSLT/XPath 生成以逗号分隔的列表?

java - 从 java 生成 HTML 最好用什么,但在 web 相关项目上用什么更好?