Wix 安装路径注册表值分配 - 有什么问题? [英] Wix install path registry value assignment - what is wrong?
问题描述
我有一个 WIX 安装程序.我尝试根据安装路径(VS Installer Easy)添加一个注册表项,在这种情况下认为这将是小菜一碟......这是我用于 WIX 的 XML:
I have an WIX installer. I try to add a registry key depending on the installation path (VS Installer easy) in this case thought it would be a piece of cake ... This is my XML for WIX:
<Feature Id="ProductFeature" Title="ChessBarInfoSetup" Level="1">
<!--<ComponentGroupRef Id="ProductComponents" />-->
<ComponentRef Id='InstallRegistryComponent' />
<ComponentRef Id='ProductComponent' />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="ManufacturerFolder" Name="$(var.manufacturer)">
<Directory Id="INSTALLFOLDER" Name="$(var.productName)">
<!--<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">-->
<Component Id="InstallRegistryComponent" Guid="*">
<RegistryKey Id='ChessInfoBarInstallDir' Root='HKLM' Key='Software\[Manufacturer]\[ProductName]' Action='createAndRemoveOnUninstall'>
<RegistryValue Type='string' Name='InstallDir' Value="[INSTALLDIR]" Action="write" KeyPath="yes" />
<!--<RegistryValue Type='integer' Name='Flag' Value='0'/>-->
</RegistryKey>
</Component>
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<Component Id="ProductComponent" Guid="*">
<File Source="$(var.ChessInfoTaskBar.TargetPath)" />
</Component>
<!--</ComponentGroup>-->
</Directory>
</Directory>
</Directory>
</Directory>
</Fragment>
该值已创建但始终为空字符串.与 INSTALLLOCATION 和其他人一起尝试过……我做错了什么(在 wix 教程页面上看到了 Value=[INSTALLDIR])?
The value is created but is always an empty string. Tried it with INSTALLLOCATION and others... What am I doing wrong (saw the Value=[INSTALLDIR] on a wix tutorial page)?
推荐答案
它是空的,因为您使用的是 INSTALLDIR
而不是 INSTALLFOLDER
It is empty because you are using INSTALLDIR
instead of INSTALLFOLDER
<Directory Id="INSTALLFOLDER" Name="$(var.productName)">
<RegistryValue Type='string' Name='InstallDir' Value="[INSTALLFOLDER]" />
那应该会给你安装目录.
That should give you the installation directory.
这篇关于Wix 安装路径注册表值分配 - 有什么问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!