Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


September 1999

Tweaking Applications for a Multiuser Environment


RSS
Subscribe to Windows IT Pro | See More Performance Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!
SideBar    Performance Tuning for DOS Applications

Improve the Way Single-User Applications Work with Terminal Server

One tricky part of setting up server-based (i.e., thin-client) computing is making applications designed for one user work for multiple users. If you're using Windows NT Server 4.0, Terminal Server Edition, you might have trouble with some applications. As I wrote in "Can a Hybrid Network Work for Your Enterprise?" October 1998, not all applications work well in a thin-client environment. Some use up too many CPU cycles or too much memory, some can't tell whether to apply settings to a user or a computer, and some store information in locations inappropriate to a multiuser OS. Sometimes you're stuck with these problems; if you use such applications, you need to run them from the client desktop. However, some problems are fixable if you take a little time.

Not every application works with Terminal Server, but the following tips will help you tweak those that do. (For information about tweaking DOS applications, see the sidebar "Performance Tuning for DOS Applications," page 72.)

How Applications Install into Terminal Server
To work properly in a multiuser environment, applications need to edit the HKEY_CURRENT_USER branch of the Registry rather than the HKEY_LOCAL_MACHINE branch. Otherwise, per-user settings apply to everyone using the application. Sometimes this condition is merely annoying, and sometimes it's a security violation because users can see or overwrite one another's personal settings. Well-behaved Terminal Server applications make their settings apply to users, not to machines.

However, you can't install applications into HKEY_CURRENT_USER. This key applies to only the current user, and the identity of the current user changes. Thus, you can install applications on Terminal Server in one of two ways: globally, for everyone who logs on to the server, or singly, for the exclusive use of the person logged on during the application's installation. Unfortunately, you can't install an application for a user while you're logged on with another account. Nor can you specify a subset of users who have access to a particular application. If you want only a couple of people to have access to an application, you need to install it for each user separately. After you've installed the application, you can use NTFS permissions to lock it down, and you can create custom profiles that don't provide shortcuts or Start Menu options for the application.

Installing Applications for Multiple Users
How does Terminal Server know how to install an application? Each Terminal Server session has two operating modes: Execute and Install. The names are descriptive of each mode's purpose—Execute mode is for running applications, and Install mode is for installing applications. The mechanics of installing an application depend on which mode you're in when you're running the application's Setup program.

When a session is in Install mode, it creates Registry entries and Terminal Server copies all those Registry entries under the HKEY_LOCAL_MACHINE\SOFTWARE\ Microsoft\WindowsNTCurrentVersion\TerminalServer\ Install Registry key. Whenever an application adds keys, Terminal Server copies those keys to HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE under the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ Windows NT\CurrentVersion\Terminal Server\Install\Machine Registry key.

You don't have to know all this in regard to Win32 applications. What you do have to know is that when the session is in Execute mode (the usual mode unless you specify otherwise), if an application attempts to read an HKEY_ CURRENT_USER Registry entry that doesn't exist, Terminal Server looks under HKEY_LOCAL_MACHINE\SOFTWARE\ Microsoft\WindowsNT\CurrentVersion\ Terminal Server\Install for the missing key. If it finds the key, Terminal Server copies the key and its subkeys to the appropriate location under HKEY_ CURRENT_USER and copies any .ini files or user-specific .dll files to the user's home directory. If the user doesn't have a home directory, the files go to the user's personal folder in \%systemroot%\profiles.

You can put Terminal Server into Install mode with either the Change User command-line utility (if you're installing applications with Run or with the installation program that comes with the application) or a switch in the Add/Remove Programs applet in Control Panel. Change User lets you choose from three options:

  • /execute (the default option), in which applications install in single-user mode
  • /install, which puts Terminal Server into Install mode
  • /query, which reports the mode that the session is in

Before running a setup program, open a command prompt and run Change User/install. The system will copy all entries to the appropriate Registry key for later copying to each user's Registry settings when the users run the application within their sessions.

If you put a Terminal Server session into Install mode with Change User, the session will stay that way until you run Change User again to revert the session to Execute mode. Therefore, if you want to be sure that Terminal Server goes into Execute mode when you're finished installing an application, the best way is to use the Add/Remove Programs applet.

Add/Remove Programs will put the session into Install mode for the duration of the setup procedure, then automatically revert to Execute mode when setup completes. After prompting you for the location of the installation files, the installation wizard will ask whether you want to give all users the same initial settings (the default option) or whether you want the application settings to apply to only the user from whose workstation you're installing the application. If you choose the default option, you'll put Terminal Server into Install mode. When the application's Setup program finishes running, you'll go back to the wizard, which will prompt you to click Next. Finally, you'll see a dire-looking dialog box telling you to click Finish or Cancel when the installation process is complete but warning you in capital letters not to click before the process is finished. Clicking Finish or Cancel returns the session to Execute mode.

   Previous  [1]  2  Next 


Reader Comments
I read Christa Anderson's "Tweaking Applications for a Multiuser Environment" (September 1999). The author mentions that Windows NT stores all user settings per application in the HKEY_
CURRENT_USER branch of the Registry. If an update to an application requires subsequent updates to user settings, how do you enact these changes? I've tried installing the update via the Control Panel Add/Remove Programs applet, and through the command-line change user /install mode. Although the HKEY_LOCAL_MACHINE and the HKEY_
CURRENT_USER settings get updated, not all the other user settings do. Is there a way to see and edit each user's Registry without signing on as that user? Or is there a way to make sure each user gets updated?

Heidi DeRosa December 13, 1999


<i>Changes to application-specific entries in the Registry apply to only those settings that don't appear in the per-user application Registry settings. If the entry already exists in the user's application settings, it's not updated when the user next logs on to the application. An application looks in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\Install for application settings only if the settings don't already exist in the application's Registry settings.
Suppose you've set up the home directory to be at drive H. You make this change while the computer is in install mode, so the change is put in the Registry key that edits per-user settings. User Christa logs on in Execute mode and runs the application, and her home directory is drive H. However, if you go back later and make drive W the home directory, then Christa's settings won't be updated because a home directory entry already exists. If you want to update this change for Christa, you need to delete any Christa-specific home directory settings that already exist for that application, make your changes in install mode, then make Christa run the application again.<br><br>

--Christa Anderson</i>

Christa Anderson December 13, 1999


I needed what was on page 74 of this article

Jim Cahill December 05, 2003


I needed what was on page 72 of this article

Jim Cahill December 05, 2003


You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

PsExec

This freeware utility lets you execute processes on a remote system and redirect output to the local system. ...

How can I stop and start services from the command line?

...


Windows OSs Whitepapers Why SaaS is the Right Solution for Log Management

Related Events Virtualization Management

Virtualization for Mission-Critical BI with SQL Server

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing