使用 Wix 在注册表值中引用目录安装路径 [英] Reference directory install path in registry value using Wix
问题描述
我想将使用 wix 安装的应用程序的路径保存在 Windows 注册表中.我尝试了以下方法:
I want to save the path of my application, installed with wix, in the windows registry. I tried the following:
<RegistryValue Root="HKLM" Key="SoftwarecompanyInstallLocation" Value="[#INSTALLLOCATION]" Type="string" Action="write" />
其中 INSTALLLOCATION
是 Wix 中文件夹的目录 ID,但这不起作用.似乎 [#id] 语法仅适用于文件...
where INSTALLLOCATION
is the Directory Id of the folder in Wix, but this doesn't work. It seems that the [#id] syntax is only for files...
我看到了以下问题,但他引用的博客似乎已不复存在:
I saw the following question but the blog he references seemingly is no more:
https://stackoverflow.com/questions/521825/saving-install-path-to-注册表
推荐答案
只要去掉 #
符号,只留下 [INSTALLLOCATION]
就可以了.#
符号是指文件键.没有 #
它指的是一个属性和 所有目录都成为属性.有关详细信息,请参阅有关格式化数据类型的文章.
Just remove the #
sign, leave only [INSTALLLOCATION]
and it should work. The #
symbol referes to file keys. Without the #
it refers to a property and all directories become properties. See the article about Formatted data type for more details.
这篇关于使用 Wix 在注册表值中引用目录安装路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!