wix的"KeyPath"属性是什么? [英] What is the wix 'KeyPath' attribute?

查看:132
本文介绍了wix的"KeyPath"属性是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Wix的 KeyPath 属性是什么?特别是,它如何适用于以下内容:

What is the Wix 'KeyPath' attribute? In particular, how does it apply to the following:

<Component Id="ProgramMenuDir" Guid="*">
  <RemoveFolder Id="ProgramMenuDir" On="uninstall" />
  <RegistryValue Root="HKCU" Key="Software\CompName\AppName" 
                 Type="string" Value="" KeyPath="yes" />
</Component>

推荐答案

作为 Rob Mensching解释:

组件的KeyPath是 Windows的单一资源 安装程序用来确定是否 组件存在"在机器上.

The KeyPath for a Component is a single resource that the Windows Installer uses to determine if a Component "exists" on a machine.

这意味着Windows Installer决定是否安装组件时,它将首先查看密钥路径资源是否已经存在.如果是,则不安装该组件中的所有资源.

This means that when Windows Installer decides whether to install your component, it will first look whether the keypath resource is already present. If it is, none of the resources in the component are installed.

密钥路径资源的存在还决定了修复" MSI时组件是否已损坏或丢失.

The presence of the keypath resource also determines whether a component has been damaged or has gone missing when you "repair" an MSI.

当密钥路径资源是版本文件时,Windows Installer仅在找到具有相同或更高版本的文件时才认为它存在.

When the keypath resource is a versioned file, Windows Installer will consider it to exist only if it finds a file with an equal or higher version.

在您的特定示例中,您有一个组件,该组件可在卸载时删除文件夹.如果给定的注册表项尚不存在,则将仅安装该组件.当您需要组件的密钥路径来安装本身无法用作密钥路径的资源时,例如

In your specific example, you have a component which removes a folder on uninstallation. This component will only be installed if the given registry key does not yet exists. Adding a registry key to use as the key path is a common trick when you need a keypath for a component that installs resources that cannot be used as a keypath themselves, like a shortcut.

这篇关于wix的"KeyPath"属性是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆