Lesson 4: Supporting Applications

Windows Vista alone isn’t enough for most users—they need applications as well. Although every application has unique support requirements, all applications have some things in common. This lesson describes the most common way to deploy, install, and uninstall applications and explains how to configure multiple monitors to give users more desktop space and how to configure the Windows Sidebar.

After this lesson, you will be able to:

  • Deploy and install applications.
  • Configure and maintain applications.
  • Run the Microsoft Support Diagnostic Tool.

Estimated lesson time: 15 minutes

Deploying Applications

Before users can run most applications, they must be installed. To simplify installation, Windows Vista (as well as earlier versions of Windows) includes Windows Installer. Windows Installer allows you to install programs manually, from a script, or using Group Policy software distribution. The sections that follow provide an overview of Windows Installer and instructions for installing Windows Installer packages.

Windows Installer

Windows Installer is a Windows component that makes it easy to install, update, and unin-stall programs. Windows Installer relies on a special file format with an .MSI file extension that contains all the files and settings required to install an application. Almost all applications developed in recent years include an .MSI file to allow the application to be deployed with Windows Installer.

If an application provides a Windows Installer package, you can deploy it in several ways:

  • Manually, using a wizard interface. You can start the manual setup simply by double-clicking the .MSI file from the computer you want to install the program on. This technique resembles running the Setup.exe file included with most software installer’s programs.
  • Automatically, from a script using the MsiExec.exe tool. All Windows Installer packages can be automatically installed without prompting the user.
  • Using Group Policy Software Distribution. Group Policy only supports distributing .MSI files, so many organizations often repackage an application in an .MSI file if it does not already include one.

MORE INFO Repackaging programs

For more information about repackaging programs, refer to the Microsoft Solution Accelerator for Business Desktop Deployment 2007 at https://www.microsoft.com/technet/desktopdeploy-ment/bdd/2007/.

  • Using Microsoft Systems Management Server (SMS).

MORE INFO SMS

For more information about SMS, visit https://www.microsoft.com/sms.

Using the MsiExec.exe Tool

You can use MsiExec.exe to install Windows Installer packages automatically. For example, to install a Windows Installer package named Update.MSI without prompting the user, you would run the following command:

Msiexec /package Update.msi /quiet

Similarly, to uninstall the same file, you would run the following command:

Msiexec /uninstall Update.msi /quiet

MsiExec.exe also supports the following useful parameters:

  • /norestart Prevents Windows from restarting, even if the application requires it. Use this parameter when you will be installing several programs in sequence and you don’t want Windows to restart until after all programs have been installed.
  • /promptrestart Prompts the user to restart the computer only if a restart is necessary.
  • /forcerestart Always restarts the computer after installation, even if it is not required. You might use this if you previously used /norestart to install another program.

If you experience a problem during an automatic installation with the /quiet parameter, MsiExec does not inform the user of the problem; it just fails quietly. By default, MsiExec adds events to the Application event log with a source of MsiInstaller after any successful installation or unsuccessful installation attempt. For example, event ID 11925 indicates that an installation failed because the package requires administrative privileges to install, and the user lacked those privileges, and it would include a description resembling the following:

Product: Microsoft Baseline Security Analyzer 2.1 -- Error 1925. 
You do not have sufficient privileges to complete this installation 
for all users of the machine. Log on as administrator and then 
retry this installation. 

Similarly, Event ID 11730 indicates that an uninstallation failed because the user lacked sufficient privileges, and it includes a description resembling the following:

Product: Microsoft Baseline Security Analyzer 2.1 -- Error 1730. 
You must be an Administrator to remove this application. To remove 
this application, you can log on as an Administrator, or contact your technical support group 
for assistance.

A successful installation generates a message with Event ID 11707, with a description resembling the following:

Product: Microsoft Baseline Security Analyzer 2.1 –
Installation completed successfully.

The Application event log provides most of the troubleshooting information you will need. However, you can use the /l <log_file_name> parameter with MsiExec to create a detailed text log file, as the following example demonstrates. Typically, this information contains the same information as the events in the Application event log.

Msiexec /uninstall Update.msi /quiet /l install_log.txt

For complete usage information, click Start, type Msiexec, and then press Enter.

Using Group Policy Software Distribution

In Active Directory environments, you can use Group Policy Software Distribution to deploy Windows Installer packages to member computers. To deploy a package using Group Policy, follow these steps:

  1. Open the Group Policy Object Editor for the Group Policy Object you want to use to distribute the software.
  2. Expand either Computer Configuration or User Configuration, and then select Software Settings.
  3. Right-click Software Installation, click New, and then click Package.
  4. In the Open dialog box, type the UNC path to the .MSI package you want to deploy, and then click Open. It’s important that you specify the location with a UNC path (such as \\server\share\package.msi) that all clients can also use to access the .MSI file.
  5. In the Deploy Software dialog box, select one of the following options:
    • Published Make the application available to users from the Control Panel. Publishing is an option only when deploying the package using the User Configuration node of the Group Policy object.
    • Assigned Automatically install the application with the default settings the next time Group Policy is applied. If you added the package under Computer Configuration, it will be installed regardless of which user logs on. If you install the package under User Configuration, it will be installed only when that user logs on.
    • Advanced Configure additional options by immediately viewing the package properties. You can also configure settings by viewing the package properties later.
  6. Click OK.
  7. In the left pane of the Group Policy Object Editor, click Software Installation. You will see your Windows Installer package in the right pane.

To edit the settings of a package after adding it to Group Policy, click the Software Installation node in the Group Policy Object Editor. In the right pane, right-click the package, and then click Properties.

One of the most useful settings is found on the Deployment tab; by selecting the Uninstall This Application When It Falls Out Of The Scope Of Management check box, you configure Group Policy to automatically remove the program if the Group Policy object no longer applies to a user or computer. For example, you could use this to automatically uninstall accounting software if a member of the Accounting organizational unit (OU) moved to the Human Resources OU.

Configuring Applications and the Desktop Environment

Some applications and environments require special configuration, such as changing environment variables. Another common configuration request is using multiple monitors, enabling users to maximize two or more windows on different displays. Additionally, Windows Vista includes a new application platform called Windows Sidebar that you need to know how to disable or configure. The sections that follow describe each of these features.

Configuring Environment Variables

Environment variables are settings that are universal to Windows or to a user that applications reference to identify the location of system files, user documents, temporary files, and many other settings. Typically, you should leave environment variables at their default settings to provide the greatest application compatibility because some applications simply assume that the user has environment variables set to the default values.

You can view environment variables from a command prompt by running the Set command, as the following example shows:

C:\>Set
ALLUSERSPROFILE=C:\ProgramData 
APPDATA=C:\Users\user1\AppData\Roaming 
CommonProgramFiles=C:\Program Files\Common Files 
COMPUTERNAME=D820 
ComSpec=C:\Windows\system32\cmd.exe 
HOMEDRIVE=C: 
HOMEPATH=\Users\user1 
LOCALAPPDATA=C:\Users\user1\AppData\Local 
LOGONSERVER=\\D820 
NUMBER_OF_PROCESSORS=2 
Path=C:\Windows\system32;C:\Windows;C:\Program Files\Microsoft SQL Server\90\DTS\Binn\; 
ProgramData=C:\ProgramData 
ProgramFiles=C:\Program Files PUBLIC=C:\Users\Public 
SystemDrive=C: SystemRoot=C:\Windows 
TEMP=C:\Users\user1\AppData\Local\Temp 
TMP=C:\Users\user1\AppData\Local\Temp 
USERDOMAIN=D820 
USERNAME=user1 
USERPROFILE=C:\Users\user1 
windir=C:\Windows

You can also use the Set command to change environment variables. For example, to change the temporary folder to C:\Temp for the current user, you could run the following command:

set TEMP=C:\temp

You can also change environment variables using the System Properties dialog box by following these steps:

  1. Click Start, right-click Computer, and then click Properties.

  2. Click the Advanced System Settings link, and then respond to the UAC prompt that appears.

  3. Click the Advanced tab, and then click the Environment Variables button.

  4. The Environment Variables dialog box appears, as shown in Figure 5-14.

    Cc505867.Figure_C05624085_14(en-us,TechNet.10).png

    Figure 5-14 The Environment Variables dialog box

  5. Select the environment variable you want to change, and then click Edit.

  6. Type the new value, and then click OK.

  7. Click OK again to close the Environment Variables dialog box, and then click OK again to close the System Properties dialog box.

You can reference environment variables in scripts by surrounding the environment variable name with percent symbols. For example, running the following command at a command prompt would display the name of the current domain:

echo %userdomain%

Configuring Multiple Monitors

One of the best ways to increase the usefulness of Windows is to double the desktop space by adding a second monitor. If you do add a second monitor, you have two options for configuring it:

  • Mirrored The same desktop shows on both monitors. This is primarily useful for putting on a presentation when a mobile computer is connected to a projector. By mirroring both screens, the presenter can face the audience and look at the built-in display while being assured that the display on the projector matches exactly. To configure an extended desktop, open the Display Properties dialog box, select the new monitor, and then clear the Extend The Desktop Onto This Monitor check box.
  • Extended desktop Windows Vista extends the desktop across two monitors, allowing the user to move windows between the displays. For example, a user could keep e-mail open on one screen and Microsoft Word on another, or a developer could keep his or her development open on one screen and reference files on the other. To configure an extended desktop, open the Display Properties dialog box, select the new monitor, and then select the Extend The Desktop Onto This Monitor check box. Then, click the monitor that you want to have the taskbar and Start menu and select the This Is My Main Monitor check box.

To open the Display Properties dialog box, follow these steps:

  1. Click Start, and then click Control Panel.
  2. Under Appearance And Personalization, click the Adjust Screen Resolution link.
  3. Make your configuration changes, and then click OK.

Configuring Windows Sidebar

Windows Sidebar provides a platform for Windows Sidebar Gadgets, as shown in Figure 5-15. Gadgets are visually small applications that reside on the Sidebar or that you can remove to float on the desktop. Windows Vista includes several gadgets, and you can download others from https://gallery.live.com/results.aspx?l=1.

Cc505867.Figure_C05624085_15(en-us,TechNet.10).png

Figure 5-15 Windows Sidebar Gadgets

You can control the Sidebar by using Group Policy. Sidebar Group Policy settings are located in both Computer Configuration and User Configuration at Administrative Tem-plates\Windows Components\Windows Sidebar. You can configure the following settings:

  • Override The More Gadgets Link By right-clicking the Sidebar, clicking Add Gadgets, and then clicking Get More Gadgets Online, users visit a Microsoft site where they can download new gadgets. Enable this setting to provide your own link for more gadgets (for example, to allow users to download gadgets from an intranet website).
  • Turn Off Windows Sidebar Enable this setting to prevent Windows Sidebar from running.
  • Disable Unpacking And Installation Of Gadgets That Are Not Digitally Signed Enable this setting to prevent Windows Sidebar from running gadgets that are not digitally signed. If you leave this setting at the default (disabled), Sidebar will warn users that a gadget is not digitally signed but still allow it to be installed.
  • Turn Off User Installed Windows Sidebar Gadgets Enable this setting to prevent users from installing their own gadgets.

The Microsoft Support Diagnostic Tool

The Microsoft Support Diagnostic Tool (MSDT) is a Windows Vista feature that Microsoft Support might instruct you to use to gather information about a problem. This can speed the troubleshooting process by decreasing the amount of information users must convey using the phone or e-mail. The tool collects some information by prompting the user and also gathers other information automatically based on computer settings and recorded events. Microsoft Support will provide a pass key and incident number for the user to enter into the tool to allow the tool to retrieve problem-specific configuration settings.

If configured by Microsoft Support, MSDT will download and run other diagnostic tools. After gathering the required information, MSDT can send the information to Microsoft across the Internet. If the computer with the problem isn’t connected to the Internet, you can save the data to removable storage, such as a universal serial bus (USB) flash drive, and then send the data to Microsoft using a different computer.

You need to start MSDT only when instructed by Microsoft Support. In that case, they will direct you to the MSDT webpage, which will allow you to launch the tool. You must have administrative privileges to launch MSDT (you will receive a User Account Control prompt). To manually run MSDT, follow these steps:

  1. Click Start, type MSDT, and then press Enter.
  2. Respond to the UAC prompt that appears. MSDT appears.
  3. On the Which Computer Has A Problem page, click This Computer or A Different Computer.
  4. On the Type Your Pass Key page, type the pass key provided by Microsoft support. MSDT will connect to Microsoft to retrieve problem-specific information and diagnostic tools.
  5. Follow the prompts that appear (the specific steps will vary depending on the nature of the problem).

Practice: Automating Software Installations

In this practice, you automate a software installation using a batch file, which you might do in a production environment to automatically install a program using a logon script.

Practice 1: Automatically Installing a Windows Installer Package

In this practice, you use MsiExec to automatically install and then uninstall a Windows Installer package using a script.

  1. Visit https://www.microsoft.com/mbsa/ and download the latest version of the Microsoft Baseline Security Advisor (MBSA) from Microsoft. Save it to your Windows Vista computer without running it. Make note of the name and the path of the .MSI file.

  2. Open Notepad and create a new batch file named InstallApp.bat. Save the file in your Documents folder.

  3. Use Notepad to add the following line to your batch file and save the file: msiexec /package <path>\<filename>.msi /passive

    For example, if you saved the MBSA .MSI file as mbsasetup-en.msi in the root of your C drive, you would add the following line to your batch file:

    msiexec /package C:\mbsasetup-en.msi /passive
    
  4. Now, double-click the InstallApp.bat file from Explorer. Wait a few moments while Windows Installer begins to install MBSA. Respond to the UAC prompt that appears. Because you used the /passive parameter, Windows Installer will display a progress bar and a UAC prompt, but it will not prompt you for any configuration information. Instead, Windows Installer will use the default settings.

  5. After several minutes, verify that MBSA is installed correctly by clicking Start, All Programs, and then clicking Microsoft Baseline Security Advisor to launch the tool. Close the tool after you verify that it runs correctly.

  6. Use Notepad to add the replace the current command in your batch file with the following command: msiexec /uninstall <path>\<filename>.msi /quiet

  7. Now, right-click the InstallApp.bat file in Explorer, and then click Run As Administrator. Respond to the UAC prompt that appears. Because you are using /quiet this time, Windows Installer cannot provide a UAC prompt to gain administrative credentials, and you must run it with sufficient privileges.

    The batch file starts Windows Installer, which uninstalls MBSA without prompting you.

  8. Wait several minutes, and then verify that MBSA was uninstalled correctly by looking for the shortcut on the Start menu.

Lesson Summary

  • Windows Installer simplifies the installation and management of Windows applications. Applications are distributed in Windows Installer packages, which are files that use an .MSI file extension. Although you can install a Windows Installer package by simply double-clicking it, you can also automate the installation using the MsiExec command-line tool or by using Group Policy software distribution.
  • Windows Vista stores some computer-wide and user-wide settings in environment variables. For example, applications can determine the current temporary directory by accessing the %TEMP% environment variable. You can change environment variables using the Set command-line utility or using the System Properties dialog box. If you need to configure a user for multiple monitors side-by-side, view the Desktop Properties dialog box, select the new monitor, and then select the Extend The Desktop Onto This Monitor check box. If a user wants to mirror the display on a projector, clear that check box.
  • If you need to escalate a problem to Microsoft Support, they might request that you run the Microsoft Support Diagnostic Tool. Although the specific steps are problem-specific, you can start the tool by clicking Start, typing MSDT, and then pressing Enter.

Lesson Review

You can use the following questions to test your knowledge of the information in Lesson 4, “Supporting Applications.” The questions are also available on the companion CD if you prefer to review them in electronic form.

NOTE Answers

Answers to these questions and explanations of why each answer choice is right or wrong are located in the “Answers” section at the end of the book.

  1. You are a desktop support engineer. You need to distribute a Windows Installer package to the mobile computer user’s OU in your Active Directory domain. To prevent the large download from occurring when users are connected to the internal network using a low-bandwidth connection, you want users to manually initiate the installation. Which of the following software distribution options should you choose?
    1. Published under Computer Configuration
    2. Published under User Configuration
    3. Assigned under Computer Configuration
    4. Assigned under User Configuration
  2. You are a Windows Vista systems administrator. You need to create a logon script that installs a Windows Installer package without prompting the user. Which of the following tools would you use to install the package?
    1. FC
    2. RACAgent
    3. WUAgent
    4. MSIExec
  3. Your chief security officer has decided that users should not be able to run any Windows Sidebar Gadgets. Which is the most effective way to implement this?
    1. In the Default Domain Group Policy Object, disable the Turn Off User Installed Windows Sidebar Gadgets policy.
    2. In the Default Domain Group Policy Object, enable the Turn Off User Installed Windows Sidebar Gadgets policy.
    3. In the Default Domain Group Policy Object, enable the Turn Off Windows Sidebar policy.
    4. Use a software restriction to block all *.gadget programs.

< Back      Next >

 

 

© Microsoft. All Rights Reserved.