参考目录安装路径在注册表值使用Wix [英] Reference directory install path in registry value using Wix
问题描述
我想在Windows注册表中保存我的应用程序的路径,并安装了wix。我尝试了以下内容:
I want to save the path of my application, installed with wix, in the windows registry. I tried the following:
<RegistryValue Root="HKLM" Key="Software\company\InstallLocation" Value="[#INSTALLLOCATION]" Type="string" Action="write" />
其中 INSTALLLOCATION
是文件夹在Wix,但这不工作。似乎[#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 / save-install-path-to-registry
推荐答案
只需删除#
sign,只留下 [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屋!