安装项目 - 允许多个安装相同的Windows服务 [英] Setup Project - Allow multiple installation of the same Windows Service

查看:579
本文介绍了安装项目 - 允许多个安装相同的Windows服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于.net(c#语言,框架4.0)中的安装项目的问题:



我为Windows服务做了安装项目,向导,则用户必须输入将安装的Windows服务的名称。安装程序还创建一个卸载程序的快捷方式,以防用户想要删除该Windows服务。



问题是:如何让用户运行相同的安装程序多次指定不同的服务名称
可能需要此行为,因为Windows服务是连接到服务器并检索数据的套接字消费者;为了利用服务器能力,用户可以多次安装相同的Windows服务,指向服务器上的不同端口,以更快地执行数据检索任务。服务是一样的,用户只需修改服务配置文件上的端口,这就是为什么每次都创建一个新版本的安装程序是不合逻辑的。


解决方案

这可以通过使用多实例安装来完成。一般方法是:




  • 创建 transform 您希望对用户可用的每个实例

  • 使用自定义EXE引导程序,



转换应至少更改PackageCode,ProductCode和UpgradeCode。



Visual Studio安装项目不支持。因此,无论是手动还是使用支持多个实例的商业设置创作工具。


I have a question regarding to Setup Projects in .Net (c# language, Framework 4.0):

I made a setup project for a Windows Service, on the installation wizard, the user must input the name of the Windows Service as it would be installed. The setup program also creates a shortcut to the Uninstall program in case the user wants to remove that Windows Service.

The question is: how to let the user run the same setup program several times specifing different service name? This behaviour could be required because the windows service is a socket consumer that connects to a server and retrieves data; to take advantage of the server capabilities the user could install the same windows service multiple times pointing to a different port on the server, to perform the data retrieving task much faster. The service is the same, the user just modify the port on the configuration file of the service, so that's why it's not logical to create a new version of the installer each time.

Any clue or suggestion would be appreciated, thanks in advance.

解决方案

This can be done by using an multiple instances installation. The general approach is:

  • create a transform for each instance you want available to the user
  • use a custom EXE bootstrapper which applies a new transform to your MSI package each time a new instance is installed

The transform should change at least the PackageCode, ProductCode and UpgradeCode.

This is not supported by Visual Studio setup projects. So either you do it manually or use a commercial setup authoring tool which supports multiple instances.

这篇关于安装项目 - 允许多个安装相同的Windows服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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