WiX 3.5 Install Service from Heat, Need from Custom Action?

最后都变了- 提交于 2019-11-30 14:10:38

The Wix XML elements are in a namespace, so you need to specify the namespace in the match value.

I solved the same problem by using XSL to add in the ServiceInstall and ServiceControl elements to the fragment generated by heat:

<!-- Add the service install/control entries to mybinary.exe -->
<xsl:template match="wix:Component[contains(wix:File/@Source,'mybinary.exe')]">
    <xsl:copy>
        <xsl:apply-templates select="node() | @*" />
        <wix:ServiceInstall Id="MyServiceInstall" DisplayName="[SERVICE_NAME]" Description="[SERVICE_DESC]" Name="MyService" Arguments="" ErrorControl="normal" Start="auto" Type="ownProcess" Vital="yes" Account="LocalSystem" />
        <wix:ServiceControl Id="MyServiceControl" Name="MyService" Start="install" Stop="uninstall" Remove="uninstall" />
    </xsl:copy>
</xsl:template>

Create a staging directory for the files you want to harvest with Heat. Keep the service .exe separate so you can manually author ServiceInstall.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!