TARGETDIR 在卸载时损坏
我有一个 WiX 安装包。我使用 TARGETDIR 属性在卸载自定义操作中执行一些操作。 TARGETDIR 曾经工作正常,但后来我进行了更改(我不记得是哪一个),现在我总是有 TARGETDIR = "C:\" ,而其他文件夹路径属性在卸载时具有正确的值。我没有在代码或 WiX 安装文件中的任何位置设置它,所以我认为它已损坏,因为我在安装包中添加了一些新文件或目录。请注意,安装时 TARGETDIR 属性包含正确的值。有什么想法为什么 TARGETDIR 属性可能会损坏吗?
I have a WiX install package. I use the TARGETDIR property to do some stuff in my uninstall custom actions. The TARGETDIR used to work fine, but then I made a change (I don't remember which one), and now I always have TARGETDIR = "C:\" , while other folder path properties have correct values on uninstall. I don't set it anywhere in the code or in the WiX install file, so I think it got corrupt because I've added some new files or directories to the installation package. Note that on install the TARGETDIR property contains a correct value. Any ideas why the TARGETDIR property could get corrupt?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
TARGETDIR 通常会设置为与 ROOTDRIVE 相同(具有最多可用空间的驱动器,无论是本地驱动器、网络驱动器还是 USB 驱动器)。因此,您不能真正相信它在安装和删除过程中是相同的,特别是如果您插入的 USB 磁盘的可用空间比您的
"C:\"
更多,那么您可以不要将其硬编码到C:\
,因为计算机的本地磁盘配置可能有所不同 - 有些甚至可能没有C:\
TARGETDIR will usually be set to the same a ROOTDRIVE (The Drive with the most amount of free space, be it a local, network or USB drive). For this reason you can't really rely on it to be the same during installation and removal, especially if you plug in a USB disk with more space free than your
"C:\"
, and you can't hardcode it toC:\
as computers may differ in their local disk configuration - some may not even have aC:\
如果安装包中的 TARGETDIR 目录内没有文件,则该属性的评估不正确。我花了一个小时才弄清楚。创建安装包是非常痛苦的。
If the TARGETDIR directory has no files inside of it in the install package, then the property is evaluated incorrectly. It took an hour for me to figure it out. Creating install packages is very painful.