Installing Applications for Windows Server 2008 Terminal Services

From Techotopia
Revision as of 15:18, 29 July 2008 by Neil (Talk | contribs) (Terminal Server Application Compatibility Scripts)

Jump to: navigation, search

The previous chapter covered the basic installation and configuration of Terminal Services on Windows Server 2008. Once this task has been completed the next step is to install applications on the Windows Server 2008 system for use by multiple remote users. It is important to note that, firstly, applications must be installed specifically for use by Terminal Services users and, secondly, that not all applications are designed to be run by multiple concurrent users. With these constraints in mind, this chapter will cover the basics of safely installing applications on Windows Server 2008 for use by remote users via Terminal Services.

This chapter will focus on installing applications in the contexts of remote desktop access (where a remote user accesses a fuill desktop session on the remote server to launch applications). To have each remote application run within its own window on the local client it will be necessary to configure the applications as RemoteApps, a topic which is covered in detail in the Configuring RemoteApps on Windows Server 2008 chapter of this book.

Understanding Terminal Services Operating Modes

Terminal Services on Windows Server 2008 function in two different operating modes known as Execute mode and Install mode. Terminal Services are in Execute mode when a clients are connected and applications are being executed by users. Install mode is entered when applications are being installed for use by client users. Essentially, when in Install mode Windows ensures that the appropaiet registry entries and .ini file settings are configured are made for the application to function in multi-user mode.

If applications are being installed using the Install Application on Terminal Server wizard via the Control Panel then the operating mode is automatically switch to Install mode during installation and then back to Execute mode on completion. If an installed needs to be performed from the command prompt the mode can be changed using the 'switch user command. The following example switches to Install mode, performs the installation and then reverts to Execute mode:

C:\Users\Administrator>change user /install
User session is ready to install applications.

C:\Users\Administrator>setup.exe

C:\Users\Administrator>change user /execute
User session is ready to execute applications.

In addition, the current mode may be queried using the /query otpion:

C:\Users\Administrator>change user /query
Application EXECUTE mode is enabled.

Installing Terminal Server Applications using Control Panel

Once Terminal Services are installed on Windows Server 2008, an Install Application on Terminal Server will appear in the Programs section of the Control Panel. To install an application for Terminal Services invoke this tool by clicking on the icon. If the application to be installed is contained on CDROM or DVD media, insert the media into the appropriate drive and click on Next. If the installation executable is on a disk drive or network location click on next and wait while the tool searches for the installation media. When none is found the tool will provide the option to browse for the installer:


Installing an application on Windows Server 2008 Terminal Server


Click on the Browse... button and navigate to the installer. Once selected click on Next to begin the installation. the installer will then run as usual. Once installation is complete, click on the Finish button in the Install Application on Terminal Server wizard.

If the application is designed for multi-user use it is now ready for use by remote users via Terminal Services. Applications which are not multi-user compatible may need to use compatibility scripts.


Terminal Server Application Compatibility Scripts

For applications not designed to work in mutli-user environments there a number of tricks that can be performed.

If the application uses a fixed path name for user files that will cause problems when there are multiple users a useful trick is to map these paths to a drive letter and then set the drive to point to different paths for each user. For example, user Bill might have drive letter E: mapped to C:\users\bill\data while user Joe would have E: mapped to C:\users\joe\data.

Another option is to use compatibility scripts which get executed each time a remote user launches an application. Windows Server 2008 provides two sample scripts located in %SystemRoot%\Application Compatibility Scripts. RootDrv.cmd maps a drive letter to the home directory of the user executing the script enabling the trick outlined above to be peformed automitcally.

The SetPaths.cmd script converts common paths (such as My Documents) into environment variables thereby avoiding the use of hardcoded path names. By default the script converts the following paths to the corresponding environment variables:

All Users:Startup COMMON_STARTUP All Users:Start Menu COMMON_START_MENU All Users:Start Menu\Programs COMMON_PROGRAMS Current User:Start Menu USER_START_MENU Current User:Startup USER_STARTUP Current User:Start Menu\Programs USER_PROGRAMS Current User:My Documents MY_DOCUMENTS Current User:Templates TEMPLATES Current User:Application Data APP_DATA