Managing Flash Applications in Citrix Environments

This article was written based on some research I completed in relation to the delivery of a Flash application over Citrix for a financial institution.

The financial institution has developed a prototype of a new sales tool that was completed before the Citrix Proof of Concept (PoC) project. This was tested within a Citrix (ICA) session during the test phase of the PoC. Whilst the application worked reasonably well when connected at LAN speed, when tested from a Branch over the WAN, the animated parts were visually poor and unacceptable.

All web applications can detect the browser they are running on by the userAgent property of the navigator object of JavaScript.

An example of a User-Agent header that a browser sends is:

Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)

We can add a value to this string, such as “Citrix”, by adding a new string value to the following registry key on the Citrix servers:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings\User Agent\Post Platform

The string value should not contain any data.

Note: After creating this value the browser needs to be restarted to initialise the new string.

Now the browser will send the following User-Agent header:

Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; Citrix; .NET CLR 1.1.4322; .NET CLR 2.0.50727)

So a web developer would simply just need to add code to search this string for the word Citrix and can then run different procedures/routines to basically slow down, dumb down, or completely remove animation.

You can then go one step further and test for the Presentation Server version number. We would do this because as Citrix advances in technology, the ability to run Flash within an ICA session will only improve, so it would be wiser to code your web applications to allow for this from the start.

Therefore, you would set the appropriate version in the registry so that the browser will also contain the Presentation Server version number in the User-Agent header:

For Example:

Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; Citrix PS 4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727)

To test this theory, copy the following code (watch out for any word wrap) to a blank html document and then open it in the browser:

<html>
<body>
<script type="text/javascript">
document.write("<strong>The User Agent is: "+ navigator.userAgent)
document.write("<br /><br />")
if (navigator.userAgent.toLowerCase().indexOf("citrix") != -1){
document.write("This browser is running on a Citrix Presentation Server.")
document.write("<br /><br />")
temp=navigator.userAgent.toLowerCase().split("citrix ps")
version=parseFloat(temp[1])
if (version>=4.0){
document.write("The version of Presentation Server is: "+ version)
}
else if (isNaN(version)){
document.write("The version of Presentation Server could not be determined, and will therefore be treated as unsupported.")
}
else
document.write("Version "+ version +" of Presentation Server is not supported.")
}
else
document.write("This browser is not running on a Citrix server.")
</script>
</body>
</html>

For this concept to work, nothing other than a registry value needs to be set on the Citrix servers, which provides ease of management/maintenance and a centralised configuration mechansim for the Flash application.

Select here to display the user agent header for your browser in a new browser window.

Alternatively, by pressing the following button, a Javascript function will be called. The function will display an alert message which contains information about the user agent header for your browser.

So in conclusion, a Flash solution over Citrix can still work. The business and project sponsors need to decide on the importance of the animation, and with the assistance from the string returned by the User-Agent header; the developers can manage this accordingly. This will leave the Flash application to be run as designed on customer facing Internet kiosk terminals.

 

 


    9th April 2007