WiX - install windows service to run in x64 mode

久未见 提交于 2020-04-13 11:12:17

问题


I'm installing a Windows Service using WiX 3.5 and its ServiceInstall tag:

<DirectoryRef Id="WindowsServiceContentDir">
        <Component Id="WindowsServiceExecutableComponent" Guid="*" Win64="yes">
            <File Source="$(var.WindowsServiceTargetDir)$(var.WindowsServiceTargetName).exe" KeyPath="yes" />

            <ServiceInstall Id="WindowsServiceInstall" Type="ownProcess" Start="auto" ErrorControl="normal" Vital="yes"
                            Name="[WIN_SERVICE_NAME]" DisplayName="Name"
                            Description="Name"
                            Account="[DENTITY_DOMAIN]\[IDENTITY_NAME]"
                            Password="[IDENTITY_PWD]">
            </ServiceInstall>


            <ServiceControl Id="WindowsServiceStop" Name="[WIN_SERVICE_NAME]" Stop="both" Remove="uninstall" Wait="yes" />
        </Component>
</DirectoryRef>

After installation on 64bit machine, the service is running in 32bit (x86) mode, despite the Win64="yes" attribute. What else need to be done to run service in x64 mode after installation?

Thank you


回答1:


Type="ownProcess" in service install is for win32 process hence the service is running in 32bit mode. Maybe you can use custom actions to install the service instead of ServiceInstall element.



来源:https://stackoverflow.com/questions/17785669/wix-install-windows-service-to-run-in-x64-mode

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