How to Configure a Cloudhouse Compatibility Container for Out of Process COM

14/07/2019 Cliff Hobbs   ID: 343458

Purpose

The purpose of this article is to details how to configure Out of Process COM virtualisation for a Cloudhouse Compatibility Container™.

Overview

The Cloudhouse Auto Packager will detect applications that use Out of Process COM and create the configuration required to deploy the Container with COM Virtualisation. 

The following article explains the configuration, and provides useful logging and troubleshooting information.

ComRegistryKeys.xml

Contains the configuration that describes the registry that will be deployed by the Container.

<RegistryOperations NeedToBeDecoded="true">
  <Write>
    <KeyName>HKEY_CURRENT_USER\Software\Cloudhouse\AppAccelerator\%GUID%\HKLM\SOFTWARE\Classes\CLSID\{B2C6CB58-C076-425C-ACB7-6D19D64428CD}\LocalServer32</KeyName>
    <ValueName></ValueName>
    <Value ValueType="String">%DefaultDir%\ProgData\Program Files\Com.exe /arg1</Value>
  </Write>
</RegistryOperations>

If the LocalServer32 key exists and the ServerExecutable value is “C:\temp\comserver.exe arg1“ then the ComRegistryKeys.xml is created with the value converted to local path in the Container “%DefaultDir%\ProgData\temp\comserver.exe arg1”.

If the LocalServer32 key exists and the default value is “C:\temp\comserver.exe arg1“, then the ComRegistryKeys.xml is created with the value converted to the local storage path "%DefaultDir%\ProgData\temp\comserver.exe arg1”

If LocalServer32 contains a default value of “do not change me“, when comRegistryKeys.xml is created then the value will be set to “do not change me”.

ComDeployment.xml

Provides the configuration for AppAcceleratorV to virtualize and deploy Out of Process COM Servers when Enabled="True" and the Container is deployed. If the Container is updated, then the original ones are removed, and the new COM servers are deployed.

<COMEnabled="True">
  <OutOfProcServers>
    <OutOfProcServer>
      <Path>%DefaultDir%\ProgData\Program Files\Com.exe /arg1</Path>
    </OutOfProcServer>
  </OutOfProcServers>
</COM>

When a Container with COM is deployed then the following messages will be logged 

"Com deployment starting"
"Deployed %defaultdir%\progdata\server.exe under {registryHive}"
"Com deployment finished"
When a Container with COM is deployed and ComRegistryKeys.xml has no keys then the following Info messages will be logged
"Com deployment starting"
"Com server %defaultdir%\progdata\server.exe not found ComRegistryKeys.xml"
"Com deployment finished"

If COM Server is set to Enabled="False", when the container is deployed then com servers in configuration are not deployed, the Info level message "Com deployment disabled" is logged. If the Container is updated, then existing COM servers are uninstalled and no new com servers are deployed.

Result

Assuming the virtualID is "somevid", when container is deployed in user mode, then the following registry keys are created:

HKCU\Software\Classes\CLSID\somevid\LocalServer32
(DefaultValue) = “{AAVLauncher} com.exe /arg1"

Assuming the virtualID is "somevid", when container is deployed in machine mode, then the following registry keys are created:

HKLM\Software\Classes\CLSID\somevid\LocalServer32
(DefaultValue) = “{AAVLauncher} com.exe /arg1”

Uninstall

During uninstall all COM configuration is removed, and the following messages are logged

"Com uninstall starting"
"Uninstalled %defaultdir%\progdata\server.exe"
"Com uninstall finished"

Example 2

ComRegistryKeys.xml 

<RegistryOperations NeedToBeDecoded="true">
 <Write>
    <KeyName>HKEY_CURRENT_USER\Software\Cloudhouse\AppAccelerator\%GUID%\HKLM\SOFTWARE\Classes\CLSID\{B2C6CB58-C076-425C-ACB7-6D19D64428CD}\LocalServer32</KeyName>
    <ValueName></ValueName>
    <Value ValueType="String">%DefaultDir%\ProgData\Program Files\Com.exe /arg1</Value>
  </Write>
  <Write>
    <KeyName>HKEY_CURRENT_USER\Software\Cloudhouse\AppAccelerator\%GUID%\HKLM\SOFTWARE\Classes\CLSID\{B2C6CB58-C076-425C-ACB7-6D19D64428CD}\Bob</KeyName>
    <ValueName></ValueName>
    <Value ValueType="String">Any value</Value>
  </Write>
  <Write>
    <KeyName>HKEY_CURRENT_USER\Software\Cloudhouse\AppAccelerator\%GUID%\HKLM\SOFTWARE\Classes\CLSID\{B2C6CB58-C076-425C-ACB7-6D19D64428CD}</KeyName>
    <ValueName></ValueName>
    <Value ValueType="String">Any value</Value>
  </Write>
</RegistryOperations>

ComDeployment.xml 

<COM>
 <OutOfProcServers>
   <OutOfProcServer>
     <Path>%DefaultDir%\ProgData\Program Files\Com.exe /arg1</Path>
   </OutOfProcServer>
 </OutOfProcServers>
</COM>

Result

Assuming the virtualID is "somevid", when container is deployed in user mode, then the following registry keys are created:

HKCU\Software\Classes\CLSID\somevid
(DefaultValue) = “Any value“
HKCU\Software\Classes\CLSID\somevid\LocalServer32
(DefaultValue) = “{AAVLauncher} com.exe /arg1”
HKCU\Software\Classes\CLSID\somevid\LocalServer32\bob
 (DefaultValue) = “Any value"

Assuming the virtualID is "somevid", when container is deployed in machine mode, then the following registry keys are created:

HKLM\Software\Classes\CLSID\somevid
(DefaultValue) = “Any value“
HKLM\Software\Classes\CLSID\somevid\LocalServer32
(DefaultValue) = “{AAVLauncher} com.exe /arg1”
HKLM\Software\Classes\CLSID\somevid\LocalServer32\bob
 (DefaultValue) = “Any value"

This completes how to configure a Cloudhouse Compatibility Container for Out of Process COM.

Source:
Was this article helpful?

Table of Contents

    Can't find what you're looking for?

    Contact Support