WiX 在卸载时不会删除注册表项
我创建了一个带有条件 DISABLEMSIUPGRADE 的组件,当我使用我们的ExternalUI 安装 MSI 时会设置该组件。但是,MSI 不会删除卸载中的条目。我认为问题是由条件引起的,但我无法修复它。
<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>
我什至将RemoveRegistryKey Elements 放置在其他组件中以确保密钥被删除,但这也没有完成任务...
我还尝试存储和读取密钥中的DISABLEMSIUPGRADE 属性。
//edit: 我做了一些实验,发现 CONDITION 元素不是原因。我看起来如果我安装了另一个版本的安装程序,注册表项不会被删除。什么可能导致这种情况?
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>
I even placed RemoveRegistryKey Elements in other components to ensure the keys gets removed, but that also didnt do the job...
I also tried to store and read DISABLEMSIUPGRADE property in the Key.
//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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Windows Installer 按组件/@Guid 引用对组件进行计数。如果您有跨 MSI 文件共享的组件(即具有相同 @Guid 的组件),则只有在卸载两个 MSI 时才会删除该组件的内容。
我强烈建议您阅读组件规则。他们控制着这一切: https://robmensching.com/博客/posts/2003/10/18/component-rules-101
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.
I highly recommend reading about the Component Rules. They control all of this: https://robmensching.com/blog/posts/2003/10/18/component-rules-101