WiX - 如何为所有用户和单个用户获取不同的注册表项 [英] WiX - How do I get different registry keys for allusers and single user

查看:36
本文介绍了WiX - 如何为所有用户和单个用户获取不同的注册表项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序将安装到注册表中的一个路径,该路径对于单个用户和所有用户有两个不同的值.

My program will be installed to a path in registry, which has two different values for single user and all users.

所以我想要一些类似的东西:

So I'd like to have something like:

<Property Id="MYINSTALLDIR">
    if single user, then <RegistrySearch Id='MyRegistry' Type='raw' Root='HKCU' Key='Software\MyApp\Foo' Name='InstallDir' />
    else if ALLUSERS, then <RegistrySearch Id='MyRegistry' Type='raw' Root='HKLM' Key='Software\MyApp\Foo' Name='InstallDir' />
</Property>    

这可能吗?

推荐答案

对两个不同的属性执行两次注册表搜索,然后使用 SetProperty 自定义操作将两个属性中的一个分配给真实属性,基于哪个属性具有数据以及哪个优先级更高(使用条件驱动执行).

Perform the two registry searches to two different properties and then use a SetProperty custom action to assign one of the two properties to the real property based on which one has data and which one has a higher priority ( use conditions to drive the execution ).

这篇关于WiX - 如何为所有用户和单个用户获取不同的注册表项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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