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

后端 未结 2 1178
野趣味
野趣味 2020-12-31 21:50

I have a VS2010 WiX project with a main .wxs file and an empty .wxs file. The empty .wxs is overwritten in the prebuild event of the project, using heat.exe to harvest every

相关标签:
2条回答
  • 2020-12-31 22:07

    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>
    
    0 讨论(0)
  • 2020-12-31 22:15

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

    0 讨论(0)
提交回复
热议问题