WIX 自动生成 GUID *?

发布于 2024-11-04 06:05:40 字数 401 浏览 0 评论 0原文

假设我生成产品 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 技术交流群。

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

发布评论

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

评论(7

黑色毁心梦 2024-11-11 06:05:40

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.

冷弦 2024-11-11 06:05:40

产品 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).

两仪 2024-11-11 06:05:40

来自 http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Auto- generated-vs-statically-assigned-GUIDs-td4670083.html

如果您想将更新作为 MSP 发布(小更新或小升级)
Microsoft 术语)不要使用自动生成的 GUID。如果你只是
是否要以 MSI(主要升级)的形式发布更新,您需要更改
无论如何,每次都会输入产品代码,因此自动生成就可以了。参见->
http://msdn.microsoft.com/en-us/library/aa370579.aspx

From http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Auto-generated-vs-statically-assigned-GUIDs-td4670083.html:

If you want to ship updates as MSP's (Small Update or Minor Upgrade in
Microsoft terminology) don't use auto-generated GUIDs. If you're only
ever going to ship updates as MSI's (Major Upgrades) you need to change
the Product Code every time anyway so auto-generating is fine. See ->
http://msdn.microsoft.com/en-us/library/aa370579.aspx

昇り龍 2024-11-11 06:05:40

此快速指南可以帮助您。请务必检查该文章引用的 MSDN 链接,以便更好地了解其工作原理。

This quick guideline can help you. Be sure the check the MSDN links referenced from that article for better understanding how it works.

执手闯天涯 2024-11-11 06:05:40

将其他版本链接到新版本的是升级代码。假设您想使用升级功能,对于同一产品,这一点不应改变。否则几乎就像每个版本都是不同的产品

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

你又不是我 2024-11-11 06:05:40

这可能有点误导,但我确实有很多文件作为组件导入到新的 WiX Product.wxs 文件中。我发现在使用 Guid="*" 创建所有组件后,在尝试构建安装程序时,WiX 为每个组件报告了以下错误:

组件“AjaxControlToolkit.dll”具有路径为“TARGETDIR\ajaxcontroltoolkit.dll”的密钥文件。由于此路径不是根植于标准目录之一(如 ProgramFilesFolder),因此此组件不符合自动生成 GUID 的标准。

我使用以下 PowerShell 脚本为每个组件分配一个新的 guid。请注意,此脚本将直接修改 Product.wxs 文件,并且应保留该文件的备份,以防出现问题:

(Get-Content Product.wxs) | 
Foreach-Object { $guid = [guid]::NewGuid().ToString(); $_ -replace 'Guid="\*"',"Guid=""$guid"""}  | 
Out-File 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 with Guid="*" that when trying to build the installer, WiX reported the following error for each component:

The component 'AjaxControlToolkit.dll' has a key file with path 'TARGETDIR\ajaxcontroltoolkit.dll'. Since this path is not rooted in one of the standard directories (like ProgramFilesFolder), this component does not fit the criteria for having an automatically generated guid.

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:

(Get-Content Product.wxs) | 
Foreach-Object { $guid = [guid]::NewGuid().ToString(); $_ -replace 'Guid="\*"',"Guid=""$guid"""}  | 
Out-File Product.wxs
沫离伤花 2024-11-11 06:05:40

您必须为产品元素中的属性“UpgradeCode”设置一个值。它必须是唯一的,并且对于该设置的所有未来构建都必须保持不变。升级代码负责让安装升级或不升级,具体取决于正在执行的安装版本。

即:-

<Product Id="*" Name="My Application" Language="1033" Version="1.1.0" Manufacturer="Myself :p" UpgradeCode="{561DA858-5398-4B87-8F3A-8B8BB12650F6}"> 

不维护静态升级代码将导致重复相同的安装。

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:-

<Product Id="*" Name="My Application" Language="1033" Version="1.1.0" Manufacturer="Myself :p" UpgradeCode="{561DA858-5398-4B87-8F3A-8B8BB12650F6}"> 

NOT maintaining a static upgrade code will result duplicating identical installations.

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