使用动态实例名称安装 MSI 的多个实例 [英] Install multiple instances of an MSI with dynamic instance name

查看:26
本文介绍了使用动态实例名称安装 MSI 的多个实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的产品有一个 MSI 安装程序(用 WiX 编写),它基本上将一些文件复制到文件夹 c:\ourproduct 并安装 Windows 服务ourwindowsservice".

Our product has an MSI installer (written in WiX) which basically copies some files into a folder c:\ourproduct and installs a windows service "ourwindowsservice".

我们希望添加对服务的多个实例的支持,并且应该可以相互独立地安装/卸载它们.类似的例如对于 SQL Server,每个实例都应该有一个名称,该名称可以作为命令行参数传递给 MSI.

We'd like to add support for multiple instances of the service, and it should be possible to install/uninstall them independently of each other. Similar e.g. to SQL Server, each instance should have a name which can be passed to the MSI as a command line parameter.

示例:实例A"=> 将文件复制到c:\ourproductA",将服务安装为ourwindowsserviceA"实例B"=> 将文件复制到c:\ourproductB",将服务安装为ourwindowsserviceB"...

Example: instance "A" => copy files to "c:\ourproductA", install service as "ourwindowsserviceA" instance "B" => copy files to "c:\ourproductB", install service as "ourwindowsserviceB" ...

有什么想法吗?

实例转换似乎需要预先定义和预先命名的实例集.

Instance transformation seems to require a pre-defined and pre-named set of instances.

谢谢

推荐答案

ServiceInstall 表的名称列是格式化类型.这意味着您可以在运行时使用属性来驱动名称.

The ServiceInstall table's name column is the Formatted Type. These means you can use properties at runtime to drive the name.

几年前,我写了一篇关于多个实例安装程序的博客文章.在评论中,有人询问了动态数量的实例,我谈到了需要做什么.基本上,您必须编写一个具有 UI 的 bootstrapper.exe,并且可以驱动具有独特属性的转换的创建.为您的 MSI Interop 使用 C# 和 WiX/DTF 实际上是很有可能的.我只是从来没有觉得有必要真正做到这一点.我对 Product、Product-1 ... Product-15 非常满意,你就完成了.ShortCuts 必须通过自定义操作完成,因为它们不支持 Formatted 类型,但 INSTALLDIR 可以变形并且 ServiceNames 支持 Formatted.

A few years back I wrote a blog article on multiple instance installers. In the comments someone asked about a dynamic number of instances and I talk about what would need to be done. Basically you'd have to write a bootstrapper.exe that had a UI and could drive the creation of transforms with unique properties. Using C# and WiX/DTF for your MSI Interop it's actually quite possible. I just never felt the need to actually do it. I've been perfectly happy with Product, Product-1 ... Product-15 and you are done. ShortCuts have to be done by a custom action because they don't support Formatted type but INSTALLDIR can be morphed and ServiceNames do support Formatted.

这篇关于使用动态实例名称安装 MSI 的多个实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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