Setup Project - Allow multiple installation of the same Windows Service

无人久伴 提交于 2019-12-24 03:08:22

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/6573518/setup-project-allow-multiple-installation-of-the-same-windows-service

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