我正在使用HeatDirectory来创建源.wxs文件.在拾取目录中有一个exe应该作为服务安装.实际上,如果我自己创建组件,我知道如何安装服务,但我不知道如何在自动生成的组件中包含ServiceInstall.有什么建议吗?
<HeatDirectory DirectoryRefId="Guardian" OutputFile="Source\GuardianSource.wxs" Transforms="Filter.xsl" Directory="..\Setup\C24.Guardian\bin\Debug" PreprocessorVariable="var.GuardianPath" ComponentGroupName="GuardianGroup" ToolPath="$(WixToolPath)" SuppressCom="true" SuppressFragments="true" SuppressRegistry="true" SuppressRootDirectory="true" AutoGenerateGuids="true" GenerateGuidsNow="false">
</HeatDirectory>
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="Guardian">
<Component Id="cmp70BEDA00F3161F3FB5E847EB1136B1D5" Guid="*">
<File Id="fil26DCBF1E4218C7363018FBA2CD456633" KeyPath="yes" Source="$(var.GuardianPath)\C24.Guardian.exe" />
</Component>
<Component Id="cmp2EE8126A193FA022ED35FAD8F182E65A" Guid="*">
<File Id="fil785CD681C496EDDAB457E8314C49D686" KeyPath="yes" Source="$(var.GuardianPath)\C24.Guardian.exe.config" />
</Component>
<Component Id="cmp0CC91B457FBC44F978A2AD6B24043DCF" Guid="*">
<File Id="fil2D304D0395599AAAAAF975A2DBFD530F" KeyPath="yes" Source="$(var.GuardianPath)\C24.Guardian.pdb" />
</Component>
<Component Id="cmpFB799FA015274DDBE2C337C60667D2C5" Guid="*">
<File Id="filB9C39B394CAD03F5A1BC3262C61EDDEB" KeyPath="yes" Source="$(var.GuardianPath)\C24.Guardian.vshost.exe" />
</Component>
<Component Id="cmp28C29865AE85B067BCEEBD70EFDB19D5" Guid="*">
<File Id="fil0A756B711769AAD657F306B3A6EA7134" KeyPath="yes" Source="$(var.GuardianPath)\C24.Guardian.vshost.exe.config" />
</Component>
<Component Id="cmp92A715A4BD4B580A6E70362230170428" Guid="*">
<File Id="filBD9D504F303A6EEC9E340E3872BBB0AE" KeyPath="yes" Source="$(var.GuardianPath)\C24.Guardian.vshost.exe.manifest" />
</Component>
<Component Id="cmp8AB6A241FA2D13F296CBD946C9711579" …Run Code Online (Sandbox Code Playgroud) 我有一个VS2010 WiX项目,主要是.wxs文件和一个空的.wxs文件.在项目的prebuild事件中覆盖空的.wxs,使用heat.exe从控制台exe收集所有内容.exe有InstallUtil挂钩,在VS安装项目的时代,exe作为服务安装.
我尝试使用<ServiceInstall>WiX中的位,但是当我指定可执行文件和其他元素来安装服务时,轻抱怨主.wxs中的.exe与热量生成的.wxs中的.exe之间的冲突.
我认为自定义操作不是进行服务安装的最佳方式,因此我尝试使用XSL转换来获取我不想要的文件(它是100个单个文件).
我的XSL必须有问题,因为它不匹配/过滤.这里是:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
exclude-result-prefixes="msxsl"
xmlns:Wix="http://schemas.microsoft.com/wix/2006/wi">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
</xsl:copy>
</xsl:template>
<xsl:template match="
Component[File/@Source='$(var.bindir)\servicehost.exe']"/
</xsl:stylesheet>
Run Code Online (Sandbox Code Playgroud)
我需要撕掉的部分.wxs看起来像这样:
....
<Component Id="cmpD64BE1790BFAF0F05DA37558F5D72572" Guid="{6C70DDC8-349B-4B66-A415-DE08E302C2A8}">
<File Id="fil24DFDFCA765C9A8BBB8854CE66AED0E8" KeyPath="yes" Source="$(var.bindir)\servicehost.exe" />
</Component>
....
<ComponentRef Id="cmpD64BE1790BFAF0F05DA37558F5D72572" />
....
Run Code Online (Sandbox Code Playgroud)
使这项工作的最佳方法是什么?
谢谢.
我将为我的 Web 项目创建设置。我使用http://blog.bartdemeyer.be/2013/10/create-an-installer-for-website-with-wix-part-1/作为我的参考。在文章中间,作者创建了一个名为WebSiteContent.wxsusing heat.exe的文件:
<Target Name="Harvest">
<!-- Harvest all content of published result -->
<Exec
Command='$(WixPath)heat dir $(Publish) -dr INSTALLFOLDER -ke -srd -cg MyWebWebComponents -var var.publishDir -gg -out $(WebSiteContentCode)'
ContinueOnError="false"
WorkingDirectory="." />
</Target>
Run Code Online (Sandbox Code Playgroud)
运行 msbuild 后,文件包含以下内容:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<!--...-->
<Fragment>
<ComponentGroup Id="MyWebWebComponents">
<!--...-->
<Component Id="cmpCDB7F4EFDEF1E65C3B12BEBAD7E4D7EA" Directory="INSTALLFOLDER" Guid="{7EA5DB39-513D-482B-9FDC-2F16FCE5E712}">
<File Id="fil8994620207C22CA15AF75ACDD6420C79" KeyPath="yes" Source="$(var.publishDir)\Web.config" />
</Component>
</ComponentGroup>
<!--...-->
</Fragment>
</Wix>
Run Code Online (Sandbox Code Playgroud)
我想更改 web.config 文件内容的值,如从 WiX 更改 XML 节点值中所述,但我不知道如何将 WebSiteContent.wxs 文件之外的引用添加到 fil8994620207C22CA15AF75ACDD6420C79 元素。
我知道我可以将 xml 脚本添加到 …