WiX“服务安装"究竟是如何在内部工作的? [英] How exactly does the WiX 'Service Install' work internally?

查看:90
本文介绍了WiX“服务安装"究竟是如何在内部工作的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在安装和启动使用 WiX 工具集创建的 .msi 的 Web 服务时遇到问题.

I have a problem with a web service that is installed and started with a .msi that is created with the WiX toolset.

该服务可以在我测试过的所有机器上安装和启动(显示为在服务管理器中运行),但在某些机器上无法访问(例如通过浏览器)并且未显示在监听列表中该机器上的端口(显示为netstat -a").

The service can be installed and started on all the machines I tested so far (shown as running in the Services Manager) but on some machines it is not reachable (for example via a browser) and not shown in the list of listening ports on that machine (displayed with 'netstat -a').

我正在尝试找出问题所在,但我对 Web 服务开发和配置并不十分熟悉.这是第三方服务,因此我不知道它在内部是如何工作的.对我来说,一个很好的起点是找出在执行 .msi 文件期间安装和启动服务时到底发生了什么.也许我可以尝试在较低的层次上解决这个问题.

I am trying to figure out what's going wrong but I am not really familiar with web service development and configuration. It's a third party service, thus I don't know how it works internally. A good starting point for me would be to find out, what exactly happens when a service is installed and started during the execution of the .msi-file. Maybe I could try to tackle the problem on a lower level then.

以下是我在 ServiceInstall-Element 中的代码:

Below is my code in the ServiceInstall-Element:

<ServiceInstall
            Id="ServiceID"
            Type="ownProcess"
            Vital="yes"
            Name="ServiceName"
            DisplayName="ServiceDisplayName"
            Description="Lorem Ipsum"
            Start="auto"
            Account="LocalSystem"
            ErrorControl="normal"
            Interactive="no"
            Arguments="action=run">
    </ServiceInstall>

参数很重要 - 没有它,服务将无法启动或运行.也许其他人遇到了相同或类似的问题,可以帮助我.

The argument is important - without it, the service won't start or run. Maybe someone else encounterd the same or a similar problem and can help me out.

提前致谢 - 每个提示都值得赞赏.

Thanks already in advance - each hint is appreciated.

编辑我 (15.04.18):

由于可能是特定服务的问题,我将在此处添加一些进一步的信息:

As it might be a problem with the specific service, I will add some further information here:

这是一个名为 CryptoLicensing 的第三方软件:http://www.ssware.com/cryptolicensing/cryptolicensing_net.htm

It's a third party software called CryptoLicensing: http://www.ssware.com/cryptolicensing/cryptolicensing_net.htm

该软件的一部分是该特定程序,用作许可证服务器并进行许可证注册,例如在客户的网络中.该服务可以作为 Windows 应用程序运行,也可以作为 Windows 服务安装和运行.在这两种情况下,它都应该监听已安装机器上(预先)指定的端口.每当我将 .exe 作为应用程序启动时,一切都按预期工作.该服务是可访问的(例如使用浏览器)并且可以从网络中的其他机器访问.当 .exe 安装并作为服务启动时,它不会在每台机器上按预期工作.例如,如果我在笔记本电脑上安装并启动该服务,它在服务管理器中显示为正在运行,但无法通过其分配的 URL(甚至在本地主机上)访问,也无法在活动侦听端口中显示特定端口,例如使用'netstat -a'.服务本身启动时没有任何错误消息,也不会记录任何错误或异常,因为它似乎运行没有任何问题.

Part of this software is that specific program, that serves as a License Server and does the license registration, for example in a customer's network. The service can be run as a Windows application or installed and run as a Windows service. In both cases it should be listening on a (pre-)specified port on the installed machine. Whenever I start the .exe as an application, everything works as intended. The service is reachable (for example with the browser) and can be accessed from other machines in the network. When the .exe is installed and started as a service, it does not work as intended on every machine. For example if I install and start the service on my laptop, it is shown as running in the Services Manager, but is not reachable on its assigned URL (not even on the localhost) nor is the specific port displayed in the active listening ports, for example with 'netstat -a'. The service itself starts without any error messages and does not log any errors or exceptions as it seems to be running without any problems.

我联系了供应商,但有时他不会很快回复,而且他的回复也不是很具体.

I contacted the vendor, but sometimes he doesn't reply quickly and he is not very specific in his replies.

在问这个问题之前,我认为这是 Windows 用户权限和 WiX 安装程序的问题,但在此处的讨论中,我觉得这可能是服务本身的问题.我希望这条新"信息有助于隔离和定位问题.

Before asking the question I assumed that it was a problem with the Windows user rights and the WiX installer but during the discussion here I had the feeling that it might a problem with the service itself. I hope this 'new' piece of information helps in isolating and location the problem.

感谢迄今为止提供帮助的所有人!

Thanks to everyone who helped so far!

推荐答案

在将近 20 个月后,我们终于(意外地)找到了问题的解决方案!对于服务无法正常运行的少数机器,将注册表中的 NoInteractiveServices 值设置为 0 即可解决问题.值 1(默认值)表示不允许任何服务以交互方式运行,无论它是否具有 SERVICE_INTERACTIVE_PROCESS 属性.有关交互式服务的更多信息.

After almost 20 months we finally (and accidentally) found a solution to the problem! For the few machines, on which the service did not run properly, setting the NoInteractiveServices value in the registry to 0 did the trick. A value of 1 (which is default) means that no service is allowed to run interactively, regardless of whether it has the SERVICE_INTERACTIVE_PROCESS property. More information on Interactive Services.

我对解决方案并不完全满意,因为在所有其他机器上 NoInteractiveServices 设置为 1 并且服务无论如何都可以正常运行.然而,在服务没有交互运行的机器上,这个解决方案对我们有用.因此我会接受这个作为答案.

I am not completely satisfied with the solution, because on all the other machines NoInteractiveServices is set to 1 AND the service runs properly anyway. However, on the machines where the service did not run interactively this solution worked for us. Thus I will accept this as an answer.

如果有人对此问题有更多信息并能解释为什么会这样,请随时添加它们 - 我会很感兴趣!

If anyone has more information on this issue and can explain why this works, feel free to add them - I would be very interested!

这篇关于WiX“服务安装"究竟是如何在内部工作的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆