如何获取64位wix安装程序中的SQLDataRoot注册表设置



在我的wix安装程序中,我有这些属性来获取sql数据路径

<Property Id="SQLSERVERINSTANCENAME" >
  <RegistrySearch Id="SqlServerInstanceName" Root="HKLM" Key="SOFTWAREMicrosoftMicrosoft SQL ServerInstance NamesSQL" Name="MSSQLSERVER" Type="raw"/>
</Property>
<Property Id="SQLSERVERDATAPATH" >
  <RegistrySearch Id="SqlServerDataPath" Root="HKLM" Key="SOFTWAREMicrosoftMicrosoft SQL Server[SQLSERVERINSTANCENAME]Setup" Name="SQLDataRoot" Type="raw"/>
</Property>

但它在64位Windows 2008 Server R2 上不起作用

尝试添加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 ?>

最新更新