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

查看:34
本文介绍了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="SoftwareCompNameAppName" 
                 Type="string" Value="" KeyPath="yes" />
</Component>

推荐答案

As 由 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 决定是否安装您的组件时,它会首先查看 keypath 资源是否已经存在.如果是,则不会安装组件中的任何资源.

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.

keypath 资源的存在还决定了当您修复"MSI 时组件是否已损坏或丢失.

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

当 keypath 资源是版本化文件时,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天全站免登陆