在Azure DevOps中为Wix MSI文件生成GUID [英] Generating GUIDs for Wix MSI files in Azure DevOps

查看:98
本文介绍了在Azure DevOps中为Wix MSI文件生成GUID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Web服务器应用程序和Sitecore前端应用程序设置Wix安装程序.我的问题不是特定于Web服务器或Sitecore.我的问题是关于Wix,以及如何连续使用它.

1)Wix要求每个文件和产品本身都有GUID.我需要在每次构建时更新Wix文件中的每个GUID吗?在Git仓库中,可能会有很多变化.

2)如果我必须在CD服务器(Azure DevOps)上的每个分支(开发,暂存和母版)进行构建时更新GUID,如何在Azure DevOps中使用新的GUID更新Wix文件?/p>

我们真正想要的是能够在我们的3台服务器(开发服务器,登台服务器和主服务器)中的每一个上构建,发布,部署以及潜在地回滚到最新的良好版本.我原本以为我们只是在部署步骤中复制文件,但是我受命构建一个MSI安装程序,因为它更干净并且可以始终轻松地回滚错误的安装.如果您认为Wix是错误的工具或有更好的方法,也请大声说出来. Wix似乎太冗长了:基本上每个文件都有一个组件,每个文件都有生成的GUID.

解决方案

产品,包装,升级代码 :您可以使用安全吗?

您需要管理的 Product Code Upgrade Code .在大多数情况下,您会 更改每个版本的产品代码和包装代码.可以将Package Code设置为在生成时自动生成.实际上,如果仅使用主要升级,则产品代码也可以. 来自Flexera的不错的摘要,涉及产品,包装和升级代码.


Hello WiX :这里有一个 WiX Visual Studio Hello此处的世界示例 .它应该向您展示使用WiX和Visual Studio编译工作设置的基础知识. 也有此处有许多关于WiX的快速入门技巧 (许多链接指向示例).


自动魔术 :您可以按照以下说明使用WiX的自动引导功能:在wix中更改我的组件GUID吗?

以下是其他信息来源:

RoX Mensching,WiX创建者 :

Flexera :


Azure DevOps :我不能在此环境下工作,但是如果您使用自动组件GUID,则通常只需要更新产品代码和产品每个版本的版本-我可能忘记了一些东西.您可以将Package Code设置为在生成时自动生成,因为对于每个文件而言,Package Code都应该是唯一的(为每个build创建新文件,因此只需自动生成).许多人还将产品代码设置为自动生成,因为他们仅使用主要升级.

我从未真正需要它,但是您应该能够将值传递给WiX源内的编译器变量,这意味着您可以将新版本和产品代码(或仅是版本)传递给 candle.exe light.exe .另请参见下面的链接(msbuild).会尽快尝试挖掘出更好的一个.


某些链接 :

Product-, Package-, Upgrade Code: You can use WiX's auto-GUIDs for components (for most components). Using auto-GUIDs significantly reduces WiX source complexity. Is it safe?

The Product Code, and Upgrade Code you need to manage. For most purposes you would change Product Code and Package Code for each release. Package Code can be set to auto-generate on build. In fact product code can as well, if you use major upgrades only. Nice summary from Flexera on product, package and upgrade code.


Hello WiX: There is a WiX Visual Studio Hello World example here. It should show you the basics of compiling a working setup with WiX and Visual Studio. There are also a bunch of quick start tips for WiX here (many links to samples).


Auto-Magic: You can use WiX's auto-guid feature as described here: Syntax for guids in WIX?. You simply leave out the hard coded GUID for components where WiX is able to manage the GUIDs auto-magically.

Understanding Component GUIDs: This pragmatic description of how the component GUIDs are intended to work might help understand them better: Change my component GUID in wix?

Here are other sources of information:

Rob Mensching, WiX creator:

Flexera:


Azure DevOps: I don't work with this environment, but if you use auto-component GUIDs, then you generally only need to update the Product Code and Product Version for each build - I am probably forgetting something. You can se the Package Code to auto-generate on build since it is merely supposed to be unique for every file (new file created for each build, so just auto-generate). Many also set the product code to auto-generate since they only use major upgrades.

I have never actually needed it, but you should be able to pass values to compiler variables inside the WiX source which means you can just pass the new version and product code (or just the version) to candle.exe, light.exe. Also see link below (msbuild). Will try to dig up a better one soon.


Some Links:

这篇关于在Azure DevOps中为Wix MSI文件生成GUID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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