安装项目 - 允许多次安装同一 Windows 服务

发布于 2024-11-18 07:24:50 字数 374 浏览 3 评论 0原文

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

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

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

任何线索或建议将不胜感激,提前致谢。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无边思念无边月 2024-11-25 07:24:50

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

  • 为您希望用户可用的每个实例都
  • 使用自定义 EXE 引导程序,每次安装新实例时,该引导程序都会将新的转换应用于您的 MSI 包。

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

Visual Studio 安装项目不支持此功能。因此,您可以手动执行此操作,也可以使用支持多个实例的商业设置创作工具。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文