Using Streamed applications is a very flexible way of deploying applications to your end users. Sometimes you come across an application that you need to provide to your users more then once, with different configurations. You can do this by profiling the application multiple times, each time with a different configuration. But a big disadvantage of this method is that when your application needs an update, you must install this update to all created profiles.

 

Luckily there’s a more effective way of solving this “problem” for many applications out there. For this method the application only needs to be profiled once but can still be published multiple times with a different configuration. To do this I use a bacthfile that writes the configuration to the application "on the fly". Most of the time the application configuration is held in the registry or in a configuration file, so this can easily be modified. In this batchfile I'm not using the actual configuration parameters, but instead I use variables. This variables can later on be specified in the properties of the published application. 

 

Let’s take a look how this works by using an example application TOPdesk Settings Management. 

 

This application uses a configuration file stored in “C:\Program Files\TOPdesk\Settings Management”, the file looks like this:

 

Specified in the configuration file is the servername of the server to which the application must connect. As you can see in this example the file points to the TOPdesk test server. Next to that there’s also an acceptance server and a production server. So to use the same streaming profile for these different configurations I first create the batchfile.

 

ECHO OFF

ECHO tas.hostname=%1> "C:\Program Files\TOPdesk\ Settings Management \host.properties"
ECHO tas.tcpport=%2>> "C:\Program Files\TOPdesk\ Settings Management\host.properties"
ECHO tas.username=ADMIN>> "C:\Program Files\TOPdesk\ Settings Management \host.properties"
START dedicatedclient.exe

 

As you can see the batchfile creates the TOPdesk configuration file and uses the %1 and %2 parameters instead of the actual servername and portnumber of the TOPdesk server. After that it starts the application executable.

 

Next thing I need to do is adding the batchfile to the streamed application. I do this by using the Citrix Streaming Profiler.

 

In the profiled application you choose Update / Install Application.

Choose Advanced Install.

Choose Select files and folder.

I created the batchfile on C:\. So from there I can upload the file to the applications program files folder in the streamed application.

After that choose Finish installations.

Now all I need to do is adding a shortcut to the batchfile by adding an application in the profile. Important here is that I add two asterisks in the command line parameters field.

After that I finish and save the profile.

Next I need to publish the application.

In the following screen is the location where I can specify the value of the parameters used in the batchfile. Here I add the configuration parameters that I want my published application to use. When specifying more then one parameter don’t use a separator.

When I now start the application I can see that the parameters I specified in the published application are now passed through to my application!

 

Comments (0)