使用Wix工具集安装应用程序的多个实例 [英] Installing multiple instances of an Application with Wix Toolset

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

问题描述

我只需要安装我的应用程序的多个实例,将它们保存在不同的文件夹中,而在桌面上则没有快捷方式. 换句话说,当该应用程序已经安装在文件夹中时,如果我再次双击.msi文件,安装程序将不会询问我是否要修复或删除我的应用程序,而只是允许安装它在一个新文件夹中. 我该如何解决这个问题?

I simply need to install multiple instances of my application saving them in different folders, with no shortcut on desktop. In other words, when the App is already installed in a Folder, if I double-click the .msi file once again, the installer shouldn’t ask me if I want repair or remove my App, but it simply should permit to install it in a new folder. How can I solve this problem?

推荐答案

我以前曾经使用过这种安装,并且我同意@Nikolay-这是一个例外,而不是Windows的规则基于安装程序的安装. 组件规则通常很难遵循,并且有很多实例方面增加了一些复杂性.因此,在走这条路之前,请三思.

I used to work with this kind of installations before, and I would agree with @Nikolay - it is rather an exception, than the rule when it comes to Windows Installer based installations. Component rules are often tricky to follow, and multiple instances aspect adds some complexity on top. So, think twice before you go this road.

很复杂,这仍然是可能的.多年前,我发表了有关如何开始创作多实例安装的文章使用WiX 3.6.请注意,此版本的WiX大大简化了它.这不是简短的阅读,因此这里是一个简短的摘要:

Being complex, it is still possible. Years ago I published the article of how to start authoring multiple instance installations with WiX 3.6. Note that this version of WiX simplifies it significantly. It's not a short read, so here is a quick digest:

  • 您将无法实现通过双击MSI文件安装每个新实例"的行为.您必须具有引导程序-引导程序将正确的命令行参数传递给msiexec.exe.
  • 请勿尝试支持无限数量的实例-尝试坚持使用合理数量的实例.您是否想象有人在计算机上安装您的应用10次? 50吗100?做出明智的选择-这将是您的<Instance/>元素的数量.
  • 尽管您只需要使用MultiInstance属性装饰非文件数据组件,但我认为将其添加到所有组件中不会破坏它.
  • 尽管我在那篇文章中解释了修补多个实例的过程,但如果没有其他选择,我只会在生产中使用它.
  • You won't be able to achieve the "install each new instance with double-clicking MSI file" behavior. You have to have a bootstrapper - something that passes correct command line parameters to msiexec.exe.
  • Don't try to support unlimited number of instances - try sticking with reasonably big number. Do you imagine someone installing your app 10 times on a machine? 50? 100? Make a sane choice - this will be the number of your <Instance/> elements.
  • Although you only have to decorate non-file data components with MultiInstance attribute, I don't think it will break if you add it to all of your components.
  • Although I explained the patching of multiple instances in that post, I would only use it in production if I had no other choice.

这篇关于使用Wix工具集安装应用程序的多个实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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