<util:RegistrySearch
变量时, yes/no
找不到注册表项,例如:Win64="$(var.Win64)"
。
如果我使用字符串yes/no
而不是变量,它会按预期工作,例如:Win64="yes"
。
var.Win64
通过构建脚本设置为yes/no
,该脚本会提示我们构建哪个操作系统。日志显示它在yes
之前正确设置为DetectBegin
。
<!-- Variables.wxi: -->
<?define Win64 = "yes" ?>
<!-- Product.wxs -->
<?xml version="1.0" encoding="UTF-8"?>
<?include ..\Setup\Variables.wxi ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Fragment>
<Variable Name="MyAppVersion" Type="version" Value="$(var.ProductVersion)" />
<Variable Name="RegMyAppVersion" Type="version" Value="0.0.0.0" />
<Variable Name="Win64Version" Type="string" Value="$(var.Win64)" />
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\$(var.Manufacturer)\$(var.ProductName)"
Result="exists"
Value="Version"
Variable="RegMyAppExists"
Win64="$(var.Win64)"/>
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\$(var.Manufacturer)\$(var.ProductName)"
Result="value"
Value="Version"
Variable="RegMyAppVersion"
Win64="$(var.Win64)"/>
<util:RegistrySearch Root="HKLM" Key="SOFTWARE\$(var.Manufacturer)\$(var.ProductName)"
Result="value"
Value="LicenseKey"
Variable="RegMyAppLicenseKey"
Win64="$(var.Win64)"/>
[0D30:2BAC][2014-03-21T08:32:03]i001: Burn v3.8.1021.0, Windows v6.1 (Build 7601: Service Pack 1)
[0D30:2BAC][2014-03-21T08:32:03]i000: Initializing version variable 'ROIPOSVersion' to value '1.9.26.0'
[0D30:2BAC][2014-03-21T08:32:03]i000: Initializing version variable 'RegROIPOSVersion' to value '0.0.0.0'
[0D30:2BAC][2014-03-21T08:32:03]i000: Initializing string variable 'Win64Version' to value 'yes'
[0D30:2BAC][2014-03-21T08:32:04]i000: Registry key not found. Key = 'SOFTWARE\MyMan\MyProd'
[0D30:2BAC][2014-03-21T08:32:04]i000: Registry key not found. Key = 'SOFTWARE\MyMan\MyProd'
[0D30:2BAC][2014-03-21T08:32:04]i000: Registry key not found. Key = 'SOFTWARE\MyMan\MyProd'
[0D30:2BAC][2014-03-21T08:32:04]i000: Setting numeric variable 'RegMyAppExists' to value 0
编辑:我也在Visual Studio found in this post中收到此警告:
警告1&#39; Win64&#39;属性无效 - 值&#39; $(var.Win64)&#39;根据其数据类型&#39; http://schemas.microsoft.com/wix/2006/wi:YesNoType&#39; - &#39; $&#39;字符,十六进制值0x24,不能包含在名称中。
此外,&#34;只需删除Win64,它就会自动将其弄清楚&#34;没有在64位上工作,仍然没有找到密钥。