如何使用 WiX 安装插件或附加组件

发布于 2024-08-02 21:23:11 字数 332 浏览 4 评论 0原文

我需要将插件(或附加组件)安装到我们编写的应用程序中。我使用 WiX 作为应用程序的安装程序。 在我看来,插件是应用程序的可选部分。它需要集成到应用程序的文件系统结构中,但也可以在以后添加,即使是由无法控制原始应用程序安装程序的人添加。所以我发现 WiX 的所有开箱即用机制都不够充分:无论是小/次要/主要更新还是补丁机制似乎都不符合前一句话中所述的先决条件。 所以我发现对我来说最好的方法是让原始安装程序留下一个注册表项,以某种方式指定安装插件的位置,并为插件构建单独的安装程序。这留下了一个悬而未决的问题,即如何继续卸载,但这是我稍后可以处理的问题。 有人有更好的主意吗? WiX 中是否有我不知道的专门针对此问题的机制? 感谢您的建议, N-曼

I need to install plugins (or add-ons) to an application we write. I user WiX for the installer of the application.
A plugin is, in my mind, an optional part of the application. It needs to integrate into the file-system structure of the application, but it can also be added later, even by someone who does not have control over the installer of the original application. So I find all out of the box-mechanisms of WiX inadequate: neither small/minor/major update nor the patch mechanism seem to fit into the prerequisites stated in the previous phrase.
So I find the best way for me is to let the original installer leave a registry-entry specifying in some way where to install the plugins, and build separate installers for the plugins. Which leaves open the question, how to proceed on uninstall, but that's an issue I can handle later.
Does anyone have a better idea? Are there any mechanisms specifically for this in WiX which I'm not aware of?
Thnx for your advice,
N-Man

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

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

发布评论

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

评论(2

新雨望断虹 2024-08-09 21:23:12

注册表项是解决此问题的一种流行方法。创建插件目录的一种更以 Windows Installer 为中心的方法是使用 Component 创建插件目录,并让其他人使用 ComponentSearch 来查找 Component/@Guid。

如果没有外部引导程序/链接器来管理卸载,那么在应用程序的同时卸载插件将很困难(可能是不可能的)。将插件的卸载与应用程序完全解耦要容易得多,因此可以独立删除它们。

A registry key is a popular way to solve this. A more Windows Installer centric way of creating a plug-in directory is to use a Component to create the plug-in directory and have others use a ComponentSearch for the Component/@Guid.

Uninstalling plug-ins at the same time as your app will be difficult (probably impossible) without an external bootstrapper/chainer managing your uninstall. It is far easier to decouple the uninstall of plug-ins from application completely so they can be removed independently.

空袭的梦i 2024-08-09 21:23:12

所以我发现对我来说最好的方法是
让原来的安装者留下一个
以某种方式指定的注册表项
在哪里安装插件,以及

插件。

是的,我相信这是标准方法。您的主应用程序安装程序可以留下一个有关在何处安装插件的注册表项,如下所示:

<Registry Id='WritePluginsLoc'
  Root='HKLM'
  Key='Software\Acme\Foo 1.x' 
  Name='PluginsLocation'
  Type='string'
  Action='write'
  Value='[PLUGINSFOLDER]' />

然后插件安装程序可以像这样检索注册表项:

<Property Id="PLUGINSFOLDER">
  <RegistrySearch Id='PluginsLocationSearch'
     Root='HKLM' 
     Key='Software\Acme\Foo 1.x'
     Name='PluginsLocation'
     Type='raw' />
</Property>

要自动卸载插件以及主产品,我担心您会拥有编写自定义卸载程序 exe。该 exe 必须知道如何查找插件 MSI 产品代码,并为每个代码调用 msiexec /x

So I find the best way for me is to
let the original installer leave a
registry-entry specifying in some way
where to install the plugins, and
build separate installers for the
plugins.

Yes, I believe that's the standard approach. Your main application installer can leave a registry entry about where to install plugins like this:

<Registry Id='WritePluginsLoc'
  Root='HKLM'
  Key='Software\Acme\Foo 1.x' 
  Name='PluginsLocation'
  Type='string'
  Action='write'
  Value='[PLUGINSFOLDER]' />

The plug-in installer can then retrieve the registry entry like this:

<Property Id="PLUGINSFOLDER">
  <RegistrySearch Id='PluginsLocationSearch'
     Root='HKLM' 
     Key='Software\Acme\Foo 1.x'
     Name='PluginsLocation'
     Type='raw' />
</Property>

To automatically uninstall plug-ins along with the main product I'm afraid you'll have to write a custom uninstaller exe. This exe would have to know how to find the plug-in MSI product codes and would invoke msiexec /x for each one.

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