Summary
The
Allow only one instance of application for each user option doesn’t work if the application is run from a published batch file.
Background
After Citrix MetaFrame XP Feature Release 3, there has been a design change that prevents Presentation Server from tracking applications that aren’t launched from the ICA Client.
Any application launched through another (through a published command line or a Visual Basic script or another method) is not tracked. This prevents the published application from appearing in the Presentation Server Console. It also prevents application limits from working.
Reason for the Design Change
Before Presentation Server 3.0, MetaFrame 1.0 kept track of all processes opened by the published application. This meant that the
Allow only one instance of application for each use option also prevented any other instances if a process called by the published application was still running.
This meant published applications that needed to open instances of another application could not be restarted after being shut down unless the other application was closed first.
An example of this would be if a document attachment in Microsoft Outlook was opened, then Outlook was closed with the attachment still open. MetaFrame would not allow another instance of Outlook to be run until the attachment was closed.
Effects of the Design Change
This design change means that if you run an application by calling it from a published batch file, the actual initial process is cmd.exe instead of the executable of the application. Once the application is called by the batch file, cmd.exe closes. This also could happen with other executables or Visual Basic scripts.
Because Presentation Server only tracks an application opened by the ICA Client, it regards the instance of the published batch file as closed. Unless a command is added to keep the cmd.exe process held open, there is no limit on the application's instances.
Resolution
WARNING! Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Citrix cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk.
This fix provides a way to configure those published applications to use the JOB object so that additional processes created by the initial process are considered as published applications.
If the command line of the published application is <
Application Path>, go to the following registry key and make the following changes as necessary:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Citrix\wfshell\TWI\StartInJobObject
Key Value: <
Application Path>
Type: DWORD
Value: 0
For example:
If the command line specified for the published application is
c:\notepad.cmd, go to the
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Citrix\wfshell\TWI\StartInJobObject registry key and make the following changes as necessary:
Key Value: c:\notepad.cmd
Type: DWORD
Value: 0
Note: For an application with a command line specified in the
StartInJobObject key, the published application does not disappear from the Citrix Management Console until all of the processes created by the process are terminated.
[From Hotfix XE103W2K056][#63894]
Also,if the path to the script that launches the application contains spaces, such as
c:\program files\test.cmd, add quotation marks around the key value. For example:
Key Value: “c:\program files\test.cmd”
Enhancement
Wildcard character support for this solution wild be included in Hotfix Rollup Pack 3 for Presentation Server 4.0 and Hotfix Rollup Pack 6 for MetaFrame Presentation Server 3.0.
Prior to this change, with three tree applications (appA, appB, and appC), you would have to create tree registry key values, as shown below:
Key Value: “c:\windows\system32\wscript.exe c:\path\appA.vbs”
Key Value: “c:\windows\system32\wscript.exe c:\path\appB.vbs”
Key Value: “c:\windows\system32\wscript.exe c:\path\appC.vbs”
Now you need to create only one, as shown below:
Key Value: “c:\windows\system32\wscript.exe*”
-Or-
Key Value: “c:\windows\system32\wscript.exe c:\path\app*”
More Information
CTX102683 –
Published Applications Do Not Appear in the Citrix Management Console