Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
WiX不';t卸载时删除注册表项_Wix_Windows Installer_Installation - Fatal编程技术网

WiX不';t卸载时删除注册表项

WiX不';t卸载时删除注册表项,wix,windows-installer,installation,Wix,Windows Installer,Installation,我已经创建了一个带有条件DisablesIupgrade的组件,当我使用我们的ExternalUI安装MSI时会设置该条件。但是,MSI不会在卸载时删除该条目。我认为问题是由这种情况引起的,但我不能解决它 <Component Id="compMSI" Guid="5f18af6a-b839-4b4d-9d4f-79cf7826f749"> <Condition>DISABLEMSIUPGRADE</Condition> <RegistryKe

我已经创建了一个带有条件DisablesIupgrade的组件,当我使用我们的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元素,以确保密钥被删除,但这也没有起到作用

我还尝试在密钥中存储和读取DisablesIUpgrade属性


//编辑:我做了一些实验,发现条件元素不是原因。如果安装了另一个版本的安装程序,则注册表项不会被删除。什么原因会导致这种情况?

Windows Installer引用按组件/@Guid对组件进行计数。如果在MSI文件中共享了一个组件(即具有相同@Guid的组件),则只有在卸载两个MSI时,才会删除该组件的内容


我强烈建议阅读有关组件规则的内容。他们控制着这一切:

非常感谢,现在它就像一个符咒一样有效;)。但是,在阅读了您的博客文章后,我想如果建议始终使用*作为组件guid?如果可能,我建议使用组件/@guid=“*”。WiX工具集将告诉您何时不能。如果您有一个跨产品共享的组件(请记住,组件是通过MSI文件之外的@Guid标识的),则只有在最后一个MSI卸载时才会删除该组件。同样,我在上面的链接解释了原因。最后,详细日志文件将显示所有组件的安装状态。