WIX 自动生成 GUID *?
假设我生成产品 ID 为 * 的 WIX XML 文件。另外,对于每个组件 GUID,我都使用 *.
<Product Id="*" Name="xxx" Language="1033" Version="1.0.0.0" Manufacturer="xxx" UpgradeCode="xxx">
每次我编译 WIX 安装程序时,* 在幕后都会旋转一个唯一的 GUID?假设我有一台机器安装了1.0.0版本。然后我将 WIX 安装程序重新编译为版本 1.0.1。
当我安装 1.0.1 时,WIX 如何知道 1.0.0 已安装,从而删除所有文件/注册表项并安装 1.0.1?
我应该使用 GUID 中的 * 还是应该在 WIX XML 配置中使用唯一的 ID/GUID?
Let's say I generate my WIX XML file with a Product Id of *. Also for each Component GUID I use a *.
<Product Id="*" Name="xxx" Language="1033" Version="1.0.0.0" Manufacturer="xxx" UpgradeCode="xxx">
Behind the scenes is the * spinning a unique GUID each time I compile my WIX Installer? Let's say I have version 1.0.0 installed a machine. Then I recompile my WIX Installer to version 1.0.1.
When I go to install 1.0.1 how does WIX know that 1.0.0 is already installed and thus will remove all files/registry entries and install 1.0.1?
Should I be using * from GUID or should I have a unique ID/GUID in my WIX XML configuration?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
Product/@Id="*"
随机生成一个新的 GUID,这足以用于产品代码。Component/@Guid="*"
计算只要目标路径保持不变,GUID 就保持不变,这是遵守组件规则所必需的。Product/@Id="*"
randomly generates a new GUID, which is sufficient for product codes.Component/@Guid="*"
calculates a GUID that stays the same as long as your target path stays the same, which is necessary to comply with component rules.产品 ID (ProductCode) 将安装程序包中的所有内容唯一标识为特定产品。当您搜索是否安装了以前的版本时,系统会搜索升级代码。对于使用特定升级代码找到的所有项目,安装程序会将每个产品代码标记为同一产品的不同版本。因此,您可以说相同升级代码的不同产品代码标识不同的化身(如果您愿意,可以是同一产品的版本)。
Product ID (ProductCode) uniquely identifies everything in the installer package as a particular product. When you search to see if a previous version is installed search is performed on the Upgrade Code. For all items found with the particular Upgrade code Installer will note each of the Product Codes as different incarnations of the same product. So you can say a different product code of same upgrade code identifies different incarnations (versions if you will, of the same product).
来自 http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Auto- generated-vs-statically-assigned-GUIDs-td4670083.html:
From http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Auto-generated-vs-statically-assigned-GUIDs-td4670083.html:
此快速指南可以帮助您。请务必检查该文章引用的 MSDN 链接,以便更好地了解其工作原理。
This quick guideline can help you. Be sure the check the MSDN links referenced from that article for better understanding how it works.
将其他版本链接到新版本的是升级代码。假设您想使用升级功能,对于同一产品,这一点不应改变。否则几乎就像每个版本都是不同的产品
What links other versions to new version is the upgrade code. That should not change for the same product assuming you want to use the upgrade functionality. Otherwise it is almost like each version is a different product
这可能有点误导,但我确实有很多文件作为组件导入到新的 WiX
Product.wxs
文件中。我发现在使用Guid="*"
创建所有组件后,在尝试构建安装程序时,WiX 为每个组件报告了以下错误:我使用以下 PowerShell 脚本为每个组件分配一个新的 guid。请注意,此脚本将直接修改
Product.wxs
文件,并且应保留该文件的备份,以防出现问题:This may be somewhat misguided but I did have a lot of files I was importing as components into a new WiX
Product.wxs
file. I discovered after I had created all the components withGuid="*"
that when trying to build the installer, WiX reported the following error for each component:I used the following PowerShell script to assign a new guid to each component. Be aware that this script will modify the
Product.wxs
file directly and a backup of the file should be kept in case something goes wrong:您必须为产品元素中的属性“UpgradeCode”设置一个值。它必须是唯一的,并且对于该设置的所有未来构建都必须保持不变。升级代码负责让安装升级或不升级,具体取决于正在执行的安装版本。
即:-
不维护静态升级代码将导致重复相同的安装。
You must set a value to the property "UpgradeCode" in your product element. Which must be unique and must remain the same for all of your future builds for the setup. The upgrade code is responsible for letting an installations upgrade or not upgrade depending on the setup versions being executed.
ie:-
NOT maintaining a static upgrade code will result duplicating identical installations.