WiX不会在卸载时删除注册表项

编程入门 行业动态 更新时间:2024-10-27 16:27:26
本文介绍了WiX不会在卸载时删除注册表项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我创建了一个条件为DISABLEMSIUPGRADE的组件,该组件是在使用ExternalUI安装MSI时设置的.但是,MSI不会删除卸载"上的条目.我认为问题是由条件引起的,但我无法解决.

I've created an Component with an Condition DISABLEMSIUPGRADE, which get's set when I install the MSI using our ExternalUI. However, MSI doesn't remove the entry on UnInstall. I think the problem is caused by the Condition, but I can't fix it.

<Component Id="compMSI" Guid="5f18af6a-b839-4b4d-9d4f-79cf7826f749"> <Condition>DISABLEMSIUPGRADE</Condition> <RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(var.PGuid)" Action="createAndRemoveOnUninstall"> <RegistryValue Name="DisplayName" Type="string" Value="$(var.ProductTitle)" /> <!-- ... --> </RegistryKey> </Component>

我什至将RemoveRegistryKeyElement元素放置在其他组件中,以确保删除键,但这也没有完成工作...

I even placed RemoveRegistryKey Elements in other components to ensure the keys gets removed, but that also didnt do the job...

我还尝试存储和读取Key中的DISABLEMSIUPGRADE属性.

I also tried to store and read DISABLEMSIUPGRADE property in the Key.

//我做了一些实验,发现CONDITION元素不是原因.我看起来如果安装了另一个版本的安装程序,则不会删除注册表项.是什么原因造成的?

//edit: I've experimented a bit and found out, that the CONDITION Element isn't the cause. I looks like if I have another version of my setup installed, the registry key doesn't get removed. What could cause that?

推荐答案

Windows Installer参考按组件/@ Guid对组件进行计数.如果您在MSI文件之间共享了一个组件(即,具有相同@Guid的组件),则只有在两个MSI都卸载后,该组件的内容才会被删除.

The Windows Installer reference counts Components by their Component/@Guid. If you have a Component shared (i.e. Components that have the same @Guid) across MSI files then the contents of the Component will only be removed when both MSIs are uninstalled.

我强烈建议您阅读有关组件规则的内容.他们控制所有这些: robmensching/blog /posts/2003/10/18/Component-Rules-101

I highly recommend reading about the Component Rules. They control all of this: robmensching/blog/posts/2003/10/18/Component-Rules-101

更多推荐

WiX不会在卸载时删除注册表项

本文发布于:2023-11-03 14:32:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1555368.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:会在   注册表   WiX

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!