如何在 WIX Bundle 中使用 CustomAction? [英] How to use CustomAction in WIX Bundle?

查看:34
本文介绍了如何在 WIX Bundle 中使用 CustomAction?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给你一个背景 - 我有一个来自我们供应商的 4 个 MSI,这必须转到我们公司的服务器(我们正在查看大约 3500 个服务器).到目前为止,我的同行正在使用 vbs、ps1 脚本管理这个.但是脚本的问题在于每次更新时我们都必须担心在运行新软件包之前卸载现有软件包和大量硬编码.

To give you a background - I have a 4 MSI's which comes from our vendor and this has to go to our company servers (we are looking at around 3500 servers). As of now, my counterparts are managing this using vbs, ps1 scripts. But the problem with the script is that everytime an update comes we have to worry about uninstalling the existing package before running the new one and a ton of hardcoding.

我想通过设置一个 WIX 脚本来将所有 4 个 MSI 打包在一起,从而自动化整个过程(使用非常少的硬编码).我阅读了 WIX 包并用它来创建单个 MSI.但是现在有很多变量要传递给 4 个 MSI,所以我想到使用自定义操作来根据 MSI 运行的环境/机器设置这些变量.但是我不能使自定义操作起作用?我错过了什么吗?

I want to automate the whole process (with very less hardcoding) by setting up a WIX script to package all the 4 MSI's together. I read about the WIX bundle and used that to create a single MSI. But now there are lot of a variables to be passed to the 4 MSI's, so I thought of using custom actions to set these variables based on the environment/machine where the MSI is running. But I cant make custom action to work? Am i missing something?

稍微搜索一下,我看到 Bundle 中没有 CustomActions 之类的东西?有人可以确认吗?

A little bit of googling and I saw something like there are no CustomActions in Bundle? can someone confirm?

另外,如果没有 CA,我有什么选择?如何操作要传递给 4 个 MSI 的变量?其中大部分需要根据正在运行的机器进行设置(如安装路径、用户 ID、应用程序池 ID 等).

Also if there are no CA's what are my options? how can I manipulate the variables to be passed on to the 4 MSI's? Most of them needs to be set based on the machine its being run (like install path, user id's, app pool id's etc).

推荐答案

在我看来,您有三个选择:

As I see it, you have three options:

  1. 根据您需要的信息,您可以使用 WixUtilExtension 执行简单的任务,例如读取注册表项和执行文件搜索,然后您可以将结果作为属性传递给安装包.

  1. Depending on what information you need, you can use the WixUtilExtension to perform simple tasks such as reading registry keys and performing file searches, which you can then pass the results to your installation packages as properties.

在各个安装包本身(不在包中)实现自定义操作.

Implement custom actions in the individual installation packages themselves (not in the bundle).

编写您自己的自定义引导程序应用程序以确定您需要设置的所有属性,然后将它们传递给您的安装包.这比 #1 和 #2 更复杂,但如果您有兴趣,以下链接应该可以帮助您入门:介绍托管引导程序应用编写 wpf wix 安装程序

Write your own custom bootstrapper application to determine all the properties you need to set, and then pass them to your installation packages. This is more complex than the #1 and #2, but if your interested the following links should get you started: introducing managed bootstrapper applications and write a wpf wix installer

这篇关于如何在 WIX Bundle 中使用 CustomAction?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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