So you publish an application from your Citrix Presentation Server/XenApp server, a user fires up the app, everything works fine. User closes the app. Some time later the user opens the app again and none of their settings withing the application have been saved. But maybe sometimes they have. You suspect that this is because their roaming profile isn’t being unloaded. You look at the sessions on the server and see that there are people with sessions running but no application executable running.
This is caused because XenApp makes an educated guess as to which executables are part of a published application and which are part of either itself or the OS. Those exes that are running in a user session because they are part of XenApp or the OS can be killed when the main published application exe is closed. XenApp has a hard coded list of these, including things like proquota.exe, wfshell.exe, ssonsvr.exe.
Most of the time I’ve found that the built-in list works fine, but I now have two additional executables that I need to add. One is sftdcc.exe (Microsoft App-V client) and the other is PDAgentS1.exe (which is part of PerfectDisk defragmenter).
Luckily Citrix have a KB article about all this. There’s a reg value that you can put a comma separated list of executables into to add them to the “ignore these when trying to decide if the published app session still has any application executables running” list.
So my LogoffCheckSysModules now contains:
And we’re back to sessions ending correctly when published applications are closed, and roaming profiles loading and unloading correctly.
Update September 2015: Note that there is an equivalent way of doing this if you’re running Remote Desktop Services or Session Host in Server 2008 or 2012.