用于用户定义服务安装的 Wix 安装程序替换 INSTSRV 和 SRVANY [英] Wix installer to replace INSTSRV and SRVANY for user defined service installation

查看:21
本文介绍了用于用户定义服务安装的 Wix 安装程序替换 INSTSRV 和 SRVANY的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Visual Studio C# Express 创建了一个可执行的 MyService.exe.Express 版本中没有创建服务的选项.过去,这是使用 INSTSRV 和 SRVANY 作为用户定义的服务手动安装的,如 MSDN 文章中所述'如何创建用户定义的服务'

I created an executable MyService.exe using Visual Studio C# Express. There are no options in the Express version to create a service. In the past, this has been manually installed as a user defined service using the INSTSRV and SRVANY as described in the MSDN Article 'How To Create a User-Defined Service'

是否可以为此文件创建一个 wix 3.5 安装程序

Is it possible to create a wix 3.5 installer for this file that

  1. 不需要目标计算机上存在 SRVANY.exe 和 INSTRV.exe 文件
  2. 不使用 INSTSRV.exe 作为自定义操作

推荐答案

WiX 确实支持安装 Windows 服务,但只支持本地服务.这意味着应用程序必须写成服务.

WiX does support installing Windows services, but only native ones. This means that the application must be written as a service.

由于您的应用程序使用 SRVANY.EXE 作为服务运行,因此您有两种选择

Since your application uses SRVANY.EXE to run as a service, you have two options

  • 将您的应用程序重写为原生 Windows 服务

  • use custom actions to execute the SRVANY.EXE and INSTSRV.EXE command lines

这篇关于用于用户定义服务安装的 Wix 安装程序替换 INSTSRV 和 SRVANY的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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