在我的wix安装程序中,我有这些属性来获取sql数据路径
<Property Id="SQLSERVERINSTANCENAME" >
<RegistrySearch Id="SqlServerInstanceName" Root="HKLM" Key="SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL" Name="MSSQLSERVER" Type="raw"/>
</Property>
<Property Id="SQLSERVERDATAPATH" >
<RegistrySearch Id="SqlServerDataPath" Root="HKLM" Key="SOFTWARE\Microsoft\Microsoft SQL Server\[SQLSERVERINSTANCENAME]\Setup" Name="SQLDataRoot" Type="raw"/>
</Property>
但它不适用于64位Windows 2008 Server R2
答案 0 :(得分:0)
尝试添加Win64="yes"
,这将告诉RegistrySearch
查看注册表的64位。应该添加这将告诉搜索只查看64位部分,如果你需要它搜索两个然后使用Win64="$(var.Platform)"
并指定平台如下:
<!-- Define platform-specific names and locations -->
<?if $(var.Platform) = x64 ?>
<?define ProductName = "$(var.ProductName)" ?>
<?define Win64 = "yes" ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?define PlatformCommonFilesFolder = "CommonFiles64Folder" ?>
<?define UpgradeCode = "98CECA6F-D312-466E-B04F-088ECD9CFCA2" ?>
<?else ?>
<?define ProductName = "$(var.ProductName) (x86)" ?>
<?define Win64 = "no" ?>
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?define PlatformCommonFilesFolder = "CommonFilesFolder" ?>
<?define UpgradeCode = "6B968607-8D3E-45AF-A590-253E54EE4617" ?>
<?endif ?>