在组件标签上使用自动生成的 GUID 是否安全 [英] Is it safe to use autogenerated GUID on Component tags

查看:24
本文介绍了在组件标签上使用自动生成的 GUID 是否安全的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的情况是这样的:我希望安装程序完全删除旧版本(除应用程序在其生命周期中创建的文件之外的所有文件)并将其替换为新版本.

My scenario is this: I want the installer to completely remove the old version (all files except those created by the application during its lifetime) and replace it with the new version.

在我的 Wix 脚本中,我使用自动生成的 GUID(星号)作为产品 ID 和包 ID,而我使用我自己的 GUID 作为 UpgradeCode,它始终保持不变.对于我的场景,我不确定是否可以安全地将自动生成的 GUID(星号)用于组件标签?

In my Wix script I use auto-generated GUID (asterisk) for Product ID and Package ID, while I use my own GUID for UpgradeCode which always stays same. What I'm not sure if I can safely use auto-generated GUID (asterisk) for Component tags as well, with respect to my scenario?

到目前为止,我使用的是 NSIS.我想尝试 Wix 但有点怀疑,因为论坛上的人说你需要大约 30 天才能学会它,而一个人可以在 1-2 天内开始使用 NSIS.但是,对于典型用户需要的标准安装,我花了 2 天时间才使用 Wix 获得了一个非常好的安装程序包.如果您有一点 xml 背景知识,您应该不用担心.感谢 Rob 和所有其他贡献者创建 Wix!

So far I was using NSIS. I wanted to try Wix but got a little doubt since people on forums say it will take you about 30 days to learn it while one can start off with NSIS in 1-2 days. However, for a standard installation that typical users need, it took me 2 days to get a really good installer package using Wix. If you have a little background in xml you should probably have no worries. Thanks to Rob and all the other contributors for creating the Wix!

推荐答案

是的,auto-guid Component/@Guid 是安全的.它们是非常特别地完成的,以确保以一种在该组件的发行版中稳定的方式生成 GUID,使得 组件规则未违反.

Yes, the auto-guid Component/@Guid are safe. They are done very specially to ensure that the GUID is generated in a way that is stable across releases for that Component such that the Component Rules are not violated.

此外,如果您不与其他产品共享组件并且您总是使用主要升级并且您提前安排主要升级,那么您不必担心关于组件 GUID 的内容非常多,因为这两个组件 GUID 定义永远不会同时出现在机器上.例如,MajorUpgrade 元素的默认值就是这样:

Additionally, if you do not share Components with other Products and you always use major upgrades and you schedule the major upgrade early, then you don't have to worry about Component GUIDs much at all, because the two Component GUID definitions will never be on the machine at the same time. For example, the defaults for the MajorUpgrade element give you exactly this:

<MajorUpgrade DowngradeErrorMessage='A newer version of [ProductName] is installed.' />

所以,答案是是".:)

So, the answer is, "Yes". :)

这篇关于在组件标签上使用自动生成的 GUID 是否安全的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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