Bootstrapper:在运行之前检查是否安装了 msi 版本 [英] Bootstrapper: Check if msi version is installed before running

查看:24
本文介绍了Bootstrapper:在运行之前检查是否安装了 msi 版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为以下问题寻找解决方案:

I'm trying to find a solution for the following issue:

我有许多程序(让我们称它们为奴隶),它们都依赖于一个程序(主).我需要为每个从站分发一个安装程序.这个安装程序需要安装master.

I have numerous programs (lets call them slaves) that all rely on a single program (master). I need to distribute an installer for each slave. This installer needs to install the master.

我希望能够对两个部分进行版本控制,因此多个 msi 似乎是正确的解决方案,并与引导程序链接在一起.

I want to be able to version both pieces, so multiple msi's appear to be the right solution, chained with a bootstrapper.

我的问题是,如果从属安装程序安装与已安装的主服务器版本相同的版本,.msi 将以修复/删除模式运行.

My problem is if a slave installer installs the same version of the master that is already installed, the .msi will run in repair/remove mode.

从用户的角度来看,这是不可接受的,只会引起混淆.

This is unacceptable from a user standpoint and will just cause confusion.

在尝试运行 msi 之前,有没有办法检查当前安装的文件的版本?

Is there any way to check for a version of the currently installed fiels before trying to run the msi?

我目前使用 WIX 的 setupbld.exe 作为引导程序.

I am currently using WIX's setupbld.exe as a bootstrapper.

非常感谢任何其他解决方案(我也尝试过合并模块但没有成功,因为版本控制是无用的)

Any other solutions greatly appreciated (I have also tried merge modules with no success, since the versioning is useless)

推荐答案

您可以使用而不是使用 setupbld.exe(我真的不知道,因为我找不到任何文档)msbuild 的 generatebootstrapper 任务.wix 文档已经介绍了如何使用此任务生成安装 .NET 框架的引导程序.请参阅如何:使用引导程序安装 .NET Framework.这利用了预定义的引导程序包.

Instead of using setupbld.exe (which I don't really know as I can't find any documentation) you can use msbuild's generatebootstrapper task. The wix documentation already covers how to use this task to generate a bootstrapper that installs the .NET framework. See How To: Install the .NET Framework Using a Bootstrapper. This makes use of the pre-defined bootstrapper packages.

但是,在这种情况下,您还必须编写自己的引导程序包.一种方法是研究 C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\ 中现有的引导程序包(或 Windows SDK)并阅读引导程序清单 XML 格式的文档.引导程序生成器工具也可能会有所帮助.

However, in this case you will also have to author your own bootstrapper packages. One way to do this is to study the existing bootstrapper packages in C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\ (or the ones in the Windows SDK) and read the documentation of the Bootstrapper Manifest XML format. The bootstrapper generator tool might also be helpful.

要确定是否需要安装包,可以使用InstallChecks 设置属性,然后在 命令 元素.

To determine whether the package needs to be installed, you can use one of the InstallChecks to set a property, and then check the property value in a InstallCondition under the Commands element.

如果你认为这一切都比它应该的要难—我同意,但这是我迄今为止所使用的.有一些我还没有尝试过的替代方法:

If you're thinking that this is all harder than it should be — I agree, but it's what I've used so far. There are some alternatives which I have not tried yet:

  • 名称不佳的dotNetInstaller这实际上是一个通用目的引导程序生成器.
  • wix 3.5 Burn 引导程序尚未发布.我不确定它是否处于可用状态.
  • the poorly named dotNetInstaller which is actually a general purpose bootstrapper generator.
  • the wix 3.5 burn bootstrapper which is not yet released. I'm not sure if it is in a usable state yet.

这篇关于Bootstrapper:在运行之前检查是否安装了 msi 版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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