0
votes

I found a very strange but 100% reproducible problem installing a 32-bit custom BizTalk Adapter from a corresponding 32-bit .MSI package authored with Wix v3.5 on Windows Server 2008 R2 (Service Pack 1).

Basically, the installer runs fine and copies the appropriate files to the Program Files (x86) folder and writes the corresponding registry entries under HKCU\Wow6432Node\CLSID to register the adapter.

In the BizTalk Server Administration Console, when trying to add the adapter under the Platform Settings\Adapters folder, I invoke the Adapter Properties dialog box. There, I can successfully find the custom adapter in the Adapter list and give it a friendly name, but when I attempt to validate the dialog box, I get the following error:

Cannot read transport configuration. Verify if the adapter management component is installed on the local machine. Failed to read value for "CLSID{7823EF8C-0D1E-4BC4-B110-2C16A0B8A63F}\BizTalk" key while reading transport configuration from registry. The system cannot find the file specified.

Nonetheless, I can confirm the corresponding registry key is there. I can see it with the Windows Registry Editor (regedit.exe), the reg.exe command-line utility, from a x86 PowerShell command-prompt, with a C# program... whatever.

Now, here is the strange part.

If I export the registry key to a temporary .reg file, then delete the key and subsequently re-import the contents of the temporary file by double-clicking it in Windows Explorer, the adapter can now be added successfully to the BizTalk Server Administration Console.

I have performed the same steps with the reg.exe command-line utility (reg.exe /export; reg.exe /delete; reg.exe /import) with the same effect.

What might I be doing wrong ?

My WiX project file is authored so as to be able to target both 32bit and 64bit platforms from the same project file (albeit, with two successive compilations). Here is the appropriate portion of the script, for illustrative purposes:

<!-- 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>

I'm completely loosing my mind on this one!

1
What happens if you do a %systemroot%\SysWOW64\regsvr32 on the com object dll ?user957902
The custom adapter is authored in C# and is not exposed to COM...Maxime Labelle
In that case, is your target platform for the assembly ANY_CPU or x86?user957902
There is a section that says "other registry values" in the wix sources. Is one of the other values "CodeBase" ?user957902
Assemblies are AnyCPU. No "CodeBase" value. Other registry values are listed here bit.ly/qSqLHr.Maxime Labelle

1 Answers

1
votes

I could reproduce the same situation with another custom adapter. And the same trick with the registry also worked for me. I believe I found the reason: permissions on the registry key differ depending how I installed the adapter. When I installed it for "Just me", I got the same error message. When I installed it for "Everyone", I could add the adapter as expected. If you right clicked the registry key in both cases, you would see the difference in permissions.