You don’t need a wizard or a Control Panel applet to install an application in Windows 7. Setting up a new program from a CD or DVD is typically a straightforward matter of inserting a disc and following the instructions that appear courtesy of your AutoRun settings. Setting up a program that you download is usually a matter of clicking Run or Open after the download has finished. In neither scenario do you need a wizard to hold your hand.

That’s the theory, at any rate. In practice, there might be hurdles to surmount or hoops to jump through when it comes to installing programs. Potential complications come in two flavors:

User Account Control (UAC)

Compatibility issues

The first of these is usually no more than a minor annoyance. The second can be vexatious, but it usually arises only with programs designed for an earlier generation of operating system.

In this chapter, we’ll survey the hoops and hurdles and everything else having to do with the addition, removal, updating, and management of applications in Windows 7. We’ll also look at Windows XP Mode, a free download for Windows 7 (Professional, Enterprise, and Ultimate) that can let you run legacy applications that can’t run directly in Windows 7.

What’s in Your Edition?

With the exception of Windows XP Mode, all of the tools and techniques described in this chapter are available in all editions of Windows 7. Windows XP Mode requires Windows 7 Professional or Windows 7 Ultimate/Enterprise.

Dealing with User Account Control

Rare exceptions aside, the rule in Windows 7 is this: To install a program, you need administrative credentials. Software installers—the programs that install programs—typically create files in system folders (subfolders of %ProgramFiles%) and keys in protected registry locations, and these are actions that require elevated privileges.

Installing the program files and registry keys in protected locations protects your programs (hence, you) from tampering by malicious parties, but unless you have disabled User Account Control altogether, you need to deal with UAC prompts to complete the process. If you install a program while running under an administrative account, a UAC prompt will request your consent for the actions the installer is about to undertake. If you install while running under a standard account, you will be asked to supply the name and password of an administrative user.

For more information about User Account Control, see “Preventing Unsafe Actions with User Account Control” on page 531.

Windows 7 employs installer-detection technology to determine when you have launched an installation process. This technology enables the operating system to request credentials at the time the process is launched, rather than waiting until the installer actually attempts to write to a protected location.

The system presumes that any process with a file name containing particular keywords (such as install, setup, or update) or any process whose data includes particular keywords or byte sequences is going to need elevated privileges to complete its work, so the UAC prompt appears as soon as the installer process begins. After you have satisfied the UAC mechanism, the process runs in the security context of TrustedInstaller, a system—generated account that has access to the appropriate secure locations.

The same technology that detects an installation process also recognizes when you’re about to update or remove a program. So you can expect to see UAC prompts for these activities as well.

TROUBLESHOOTING

No UAC prompt appears, and the install fails

If installer-detection technology fails to detect your installer, and if your installer tries to write to a protected area (in file storage or the registry), your setup will fail—typically with an error message like this:

To solve this problem, first do whatever is necessary to back out of the failed installation (click OK, Exit, Cancel, or whatever else seems appropriate). Then try to find the executable file for the installer. It will not be named Setup or Install (because if it were, it would not have evaded the detector), but it will be an .exe file. When you find it, right-click it in Windows Explorer and choose Run As Administrator. Supply your administrative credentials, and let the installer run.

INSIDE OUT: Turn off Start menu notifications

After you install a program, Windows announces additions to the Start menu by highlighting the changes on the menu itself. It’s reasonably intelligent about this; it doesn’t highlight additions that aren’t programs (shortcuts to documents, for example), it removes the highlight for items that you ignore for at least a week, and it doesn’t highlight anything that you install within an hour of installing Windows itself. Nevertheless, some users would rather it didn’t highlight any Start-menu changes. If you’re in that camp, right-click the Start button and choose Properties. On the Start Menu tab of the Taskbar And Start Menu Properties dialog box, click Customize. Then, in the Customize Start Menu dialog box, clear Highlight Newly Installed Programs.

TROUBLESHOOTING

The setup process hangs on reboot

If you launch a setup program as a standard user and supply the name and password of an administrative account, and if the setup program requires a system reboot to complete, you might not be able to complete the installation unless you log back on (after the reboot) as that administrative user, rather than under your own standard-user account. Installer routines that include a reboot typically record post-reboot instructions in the registry key HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce. The value of the RunOnce key is, as the key name suggests, run one time—and then discarded. The hitch is that RunOnce values are executed only when an administrator logs on. If you log on as a standard user, the RunOnce instructions are ignored, and your setup process might appear to hang. The solution is to log off and log back on as an administrator. To forestall problems of this kind, you might want to adopt the practice of elevating your own account to administrative status, using the User Accounts section of Control Panel, before you begin installing applications. Afterward, if you’re more comfortable running as a standard user, you can return to Control Panel and demote yourself.