在组件标签上使用自动生成的GUID是否安全

在组件标签上使用自动生成的GUID是否安全

本文介绍了在组件标签上使用自动生成的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!

推荐答案

是的,自动导航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是否安全?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 16:34