Dual Purpose Citrix InitStrings

The previous section describes Citrix initStrings in general terms. The following is an example of a more complete initString.


                  <initstring>
  <assemblyInfo>
    <type>Microsoft.Ccf.Csr.CitrixIntegration.CitrixApplicationHostedControl, Microsoft.Ccf.Csr.CitrixIntegration</type>
  </assemblyInfo>
  <CitrixIntegration>
    <ICAFileName>%userprofile%\Desktop\Citrix Testing\calc.ica</ICAFileName>
    <ProcessAcquisition attempts="50" delay="100" filename="%windir%\system32\calc.exe" />
  </CitrixIntegration>
  <interopAssembly>
    <URL>%windir%\system32\calc.exe</URL>
    <WorkingDirectory>%windir%\system32</WorkingDirectory>
    <hostInside />
  </interopAssembly>
  <minimumSize x="123" y="456" />
  <optimumSize x="654" y="321" />
  <adapter>
    <type>Microsoft.Ccf.HostedApplicationToolkit.DataDrivenAdapter.DdaAutomationAdapter, Microsoft.Ccf.HostedApplicationToolkit.DataDrivenAdapter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=4f00c1aa5320a4d9</type>
  </adapter>
  <DataDrivenAdapterBindings>
    <Type>Microsoft.Ccf.HostedApplicationToolkit.DataDrivenAdapter.WinDataDrivenAdapter, Microsoft.Ccf.HostedApplicationToolkit.DataDrivenAdapter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=4f00c1aa5320a4d9</Type>
    <Controls/>
  </DataDrivenAdapterBindings>
</initstring>

                

If you examine this initString example closely, you will see that it has a dual purpose. It specifies the hosting of the calc.exe application as either an external application or a Citrix-published application.

The following are the two run scenarios:

  • External Application When this initString runs an external application, the assemblyInfo and CitrixIntegration tags are not consumed and are ignored.

The specified DataDrivenAdapterBindings tag and the tags it encloses deliver the Hosted Application Toolkit functionality.

Dd632093.note(en-us,MSDN.10).gifNote:
The DdaAutomationAdapter is a light-weight version of the AutomationAdapter, and does not support interfacing to the Automation Manager.

  • Hosted ControlWhen this initString runs as a hosted control, the assemblyInfo is used to instantiate the Citrix application hosted control. This in turn consumes the CitrixIntegration tag that drives the startup and hosting of the remote Citrix-published application. The entire initString is sent to the server-side GenericStub, where the adapter tag drives the instantiation of the DdaAutomationAdapter. The DdaAutomationAdapter instantiates the specified WinDataDrivenAdapter, which consumes the specified DataDrivenAdapterBindings. In this scenario, the interop assembly is ignored.

A useful consequence of this dual-purpose feature is that you can develop DDA bindings while you are running the application locally during development. Then, after the bindings have been verified as correct and reliable, you can use them to drive the same application—except that it is published on a Citrix server—by merely switching the application type. Any Hosted Application Toolkit automations developed for this application do not notice whether the application is running locally or as a Citrix-published application. However, interaction will be slower because of the network round trips involved.

This dual purposing is not limited to DDAs. You can develop and test custom adapters on a local application instance. You can then deploy the custom adapter on the Citrix server, and switch the application type from External Application to Hosted Control.


Show: