1

在我的 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

4

1 回答 1

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 ?>
于 2012-09-12T14:30:36.400 回答