0

我发现一个非常奇怪但 100% 可重现的问题,从 Windows Server 2008 R2(Service Pack 1)上使用 Wix v3.5 创作的相应 32 位 .MSI 包安装 32 位自定义 BizTalk 适配器。

基本上,安装程序运行良好并将适当的文件复制到 Program Files (x86) 文件夹,并在 HKCU\Wow6432Node\CLSID 下写入相应的注册表项以注册适配器。

在 BizTalk Server 管理控制台中,当尝试在Platform Settings\Adapters文件夹下添加适配器时,我调用了适配器属性对话框。在那里,我可以在适配器列表中成功找到自定义适配器并为其命名,但是当我尝试验证对话框时,我收到以下错误:

无法读取传输配置。验证适配器管理组件是否安装在本地机器上。从注册表读取传输配置时,无法读取“CLSID{7823EF8C-0D1E-4BC4-B110-2C16A0B8A63F}\BizTalk”键的值。该系统找不到指定的文件。

尽管如此,我可以确认相应的注册表项在那里。我可以使用 Windows 注册表编辑器 (regedit.exe)、reg.exe 命令行实用程序、从 x86 PowerShell 命令提示符和 C# 程序查看它......无论如何。

现在,这是奇怪的部分。

如果我将注册表项导出到临时 .reg 文件,然后删除该项并随后通过在 Windows 资源管理器中双击临时文件的内容来重新导入该临时文件的内容,现在可以将适配器成功添加到 BizTalk Server 管理控制台.

我使用 reg.exe 命令行实用程序(reg.exe /export;reg.exe /delete;reg.exe /import)执行了相同的步骤,效果相同。

我可能做错了什么?

我的 WiX 项目文件的编写是为了能够从同一个项目文件中同时针对 32 位和 64 位平台(尽管有两个连续的编译)。以下是脚本的适当部分,用于说明目的:

<!-- Platform-specific variables -->

<?if $(var.Platform) = x64 ?>
    <?define Win64 = "yes" ?>
    <?define ProductDisplayName = "$(var.ProductName) $(var.ProductVersion) (x64)" ?>
    <?define ProductId = "791dc40e-6536-47db-8046-2c819562d819" ?>
    <?define ProductUpgradeCode = "7a9af2a5-4f90-43fe-94cc-faeafb1bc2ef" ?>
    <?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?else ?>
    <?define Win64 = "no" ?>
    <?define ProductDisplayName = "$(var.ProductName) $(var.ProductVersion)" ?>
    <?define ProductId = "3e6b25ab-5ab8-46ff-9ad8-fa2b1d387a31" ?>
    <?define ProductUpgradeCode = "da1ab3c5-64d5-4827-9287-4d3939fe51b1" ?>
    <?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
<?endif ?>

<!-- Windows Installer package -->

<Product Id="$(var.ProductId)"
       Name="$(var.ProductDisplayName)"
       Language="1033"
       Version="$(var.ProductFullVersion)"
       Manufacturer="BizTalkFactory.AdapterPack.Setup"
       UpgradeCode="$(var.ProductUpgradeCode)"
       >

<Package InstallerVersion="200" Compressed="yes" Platform="$(var.Platform)" />
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />

<!-- Internal components here -->

<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="$(var.PlatformProgramFilesFolder)">
    <Directory Id="INSTALLLOCATION" Name="$(var.ProductName) $(var.ProductVersion)">

      <!-- Microsoft BizTalk Base Adapter Framework -->

      <Component Id="Component.Microsoft.Samples.BizTalk.Adapter.Common" Guid="6803e9aa-4e8a-4b90-b96b-9c9eb482a415" Win64="$(var.Win64)">
        <File Id="File.Microsoft.Samples.BizTalk.Adapter.Common.dll"
            Name="Microsoft.Samples.BizTalk.Adapter.Common.dll"
            Source="$(var.SolutionDir)References\Microsoft.Samples.BizTalk.Adapter.Common.dll"
            KeyPath="yes"
            />
      </Component>

      <!-- BizTalk Custom Adapter -->

      ...

      <!-- Custom BizTalk Adapter registration -->

      <Component Id="Component.CustomAdapterManagement.Registry" Guid="bcf232d5-7ab2-4905-a59a-89a72f94ffd5" Win64="$(var.Win64)">
        <RegistryKey Root="HKCR" Key="CLSID\{7823EF8C-0D1E-4BC4-B110-2C16A0B8A63F}" Action="createAndRemoveOnUninstall">
          <RegistryValue Type="string" Value="Name of the Custom BizTalk Adapter" />

          <RegistryKey Key="Implemented Categories\{7F46FC3E-3C2C-405B-A47F-8D17942BA8F9}" Action="createAndRemoveOnUninstall" />

          <RegistryKey Key="BizTalk" Action="createAndRemoveOnUninstall">

            <RegistryValue Type="string" Value="BizTalk" />
            <!-- other registry values here -->

          </RegistryKey>
        </RegistryKey>
      </Component>

    </Directory>
  </Directory>
</Directory>

<!-- Features -->

<Feature Id="F_0CA4329B_BA7F_462E_91EB_EEEA6FF7525E" Title="Custom Adapter" Level="1" TypicalDefault="install" InstallDefault="local" AllowAdvertise="no" Absent="allow">
  <ComponentRef Id="Component.Microsoft.Samples.BizTalk.Adapter.Common" />
  <ComponentRef Id="Component.CustomAdapter" />
  <ComponentRef Id="Component.CustomAdapterManagement" />
  <ComponentRef Id="Component.CustomAdapterManagement.Registry" />
</Feature>

我对这个完全失去了理智!

4

1 回答 1

1

我可以使用另一个自定义适配器重现相同的情况。注册表的相同技巧也对我有用。我相信我找到了原因:注册表项的权限因我安装适配器的方式而异。当我为“Just me”安装它时,我收到了相同的错误消息。当我为“所有人”安装它时,我可以按预期添加适配器。如果您在这两种情况下都右键单击注册表项,您会看到权限的差异。

于 2012-07-05T13:06:15.753 回答