Auto-Closing Applications Running from a Layer
SVS developer Jeremy Hurren tells us how to tune a few settings to help applications shut down gracefully -- especially useful in a virtualized world where "deactivate" does more than simply close an app.
It's possible with SVS to deactivate a layer that is home to an application that is currently running. When you do this (deactivate the layer) the running application, by default, displays an error message that informs you that an application is running and asks if you want to (forcefully) shut it down. If you say "yes", the application process is terminated. This can leave undesirable results such as unsaved documents and icons remaining in the system tray.
You can specify a registry key that will cause the Software Virtualization Agent to automatically (and gracefully) shut down an application when a layer is deactivated. If, for example, you are running Microsoft Word and have made the registry changes noted below, when you attempt to deactivate the Word layer you will be prompted to save any open Word documents before the application is closed. By default, the agent will wait for 30 seconds for a user response before terminating the application. This time out value can be configured.
To configure Software Virtualization Agent to automatically (and gracefully) shut down an application, follow these steps:
Configure the appropriate FSL registry key by using a registry editor to browse to HKEY_LOCAL_MACHINE\SYSTEM\Altiris\FSL\ in your Windows registry.
The FSL folder contains numbered keys that represent each of your virtualized layers.
Find the key you want to modify by opening each and looking for the name value that matches the name of your layer.
In this example, "Adobe_7" is a key in in folder #1. This is the key we want to modify.
Avoid keys that end with names ending with "_FSLPEERFSL". In this example, the "2" key has a name attribute of Adobe_7_FSLPEERFSL. Stay away from this one.
So, to add the shutdown functionality, add a DWORD value AutoCloseApps with a data value of 1. Here's how:
Once you've renamed the value, right-click the new name, select "modify" from the flyout menu, and use the dialog that opens to change the "Value data:" from 0 to 1.
The default timeout amount is 30 seconds, to change this go to FSL folder at HKEY_LOCAL_MACHINE\SYSTEM\Altiris\FSL\ and add DWORD Value AutoCloseTimeout and then modify the value to the number of milliseconds (so a value of 5000 in decimal is 5 seconds) you want your applications to auto close at. This will only affect the applications that have the AutoCloseApps value set.