我创建了一个条件为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不会在卸载时删除注册表项
发布评论