Exposing Programs and Installing Drivers Using AutoPlay in Microsoft Windows - 1

Exposing Programs and Installing DriversUsing AutoPlay in Microsoft Windows

July 7, 2009

Abstract

This paper provides information about recommended methods of exposing programs in the Microsoft®Windows®7, Windows Vista®, and Windows XP operating systems. It provides guidelines for driver developers, application developers, and software developers to understand the preferred methods and benefits of exposing programs to endusers throughAutoPlay using removable storage such as Universal Serial Bus (USB)flash drives, external USB hard drives, and flash cards.

This information applies to the following operating systems:

Windows7
Windows Vista
Windows XP

References and resources discussed here are listed at the end of this paper.

The current version of this paper is maintained on the Web at:

The information contained in this document represents the current view of Microsoft Corporation on the issues discussed as of the date of publication. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication.

This White Paper is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT.

Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.

Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property.

Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos, people, places and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, email address, logo, person, place or event is intended or should be inferred.

© 2009 Microsoft Corporation. All rights reserved.

Microsoft, Windows, Windows Server, and Windows Vista are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.

The names of actual companies and products mentioned herein may be the trademarks of their respective owners.

Document History

Date / Change
July 7, 2009 / First publication

Contents

Introduction

AutoPlay and AutoRun.inf

How to Present Programs and Drivers to Users from Removable Devices

Call to Action

Resources

Introduction

In order to ensure that customers are able to make a considered decision before running software from removable media and that they take into account their level of trust of that software and device, Microsoft is making a change to disable AutoRun.inf entries on non-optical removable storage. Worms such as Confickr use AutoRun.inf files as a vehicle to trick a user into clicking an option that can install malicious software onto the computer. This change in AutpPlay behavior ensures that customers who are merely browsing an infected device for content will not be inadvertently exposed to Confickr-like attacks.

Currently, corporations and end users who want to protect themselves from this growing set of attacks have the option of turning off AutoPlay completely. For information on how to turn off AutoPlay, see “Enabling and Disabling AutoRun” in “Resources” later in this document.

CDs and DVDs, which are not subject to worm injection after manufacturing, will continue to expose AutoRun.inf choices to enable users to start programs. However, manufacturers of Mass Storage Class (MSC) USB flash devices or other removable storage devices should expect that users will need to browse the contents of a device to start any programs. Thisnew behavior will enable users to continue to use AutoPlay to access media and devices (including all system-installed and independent software vendor (ISV)–installed tasks) without being exposed to malicious software that uses AutoPlay to propagate.

This change in AutoPlay behavior appears in the Windows7 RC build and future versions of Windows7 and will be made available later for Windows Vista and Windows XP.

AutoPlay and AutoRun.inf

Microsoft introduced AutoPlayin Windows 95 and improved it in Windows 2000, Windows XP, Windows Vista, and Windows7. Initially this feature was used as an interface for media companies to force media content (music, videos,and so on) to use particular media players automatically; if users did not pick the AutoPlay option, they were presented with multiple options to choose from depending on what they had installed on their computer. This kind of functionality was typical for CD-ROMs containing media files.

This functionality was extended by software vendors, hardware vendors, and driver developers to make it easy to install drivers using the AutoPlay interface when devices were connected to the personal computer. In releases of Windows prior to Windows Vista, this interface was used to automatically run programs when certain devices where connected to the computer.

In Windows Vista, the AutoPlayfeature was limited to display the program in the AutoPlay window when the device was connected to the computer.

Several devices use this method to make installation easier by presenting the user with drivers for their device. This interface has also been misused by certain viruses or malicious software that usesAutoPlay as a vehicle to trick a user into clicking on an option that can install malware onto the computer.

In Windows7, and extended back to Windows Vista and Windows XP through an update patch, unless the device is a CD-ROM or emulating a CD-ROM, the AutoRun.inf-directed files are no longer presented to the user. The new behavior will enable users to continue to use AutoPlay to access media and devices (including all system-installed and ISV-installed tasks) without being exposed to malicious software that uses AutoPlay to propagate.

In Windows7, users have the option of selecting and setting a default behavior they want when certain classes of devices are connected.

Figure 1. AutoPlay window in Windows7

How to Present Programs and Drivers to Users from Removable Devices

Developers can continue to ship programs and driver installation packages in removable data devices. Users will still be able to browse the folder and click the program or driver installation. Microsoft recommends bright and interpretive icons to indicate that users need to click the icon to get the program to run or the driver to install.

When the non-CD-ROM and non-CD-ROM-emulating device is connected to the computer, the user will be presented with the AutoPlay window that will provide the option to Open folder to view files. Users can either click this option or use Windows Explorer to browse to the folder and select the driver installation or program they want to run.

Figure 2. Removable device AutoPlay window

Driver installations for most devices can be submitted to the Windows Update driver-publishing program from Microsoft; this will enable automatic installation and updates for drivers via the Microsoft Update interface from Windows. For more information, see“Windows Update Driver Publishing” in “Resources” later in this document.

To protect programs from being manipulated by third parties, developers can opt to put their programs in read-only partitions of the mass storage device. Developers also have the option of presenting their device to the user as a CD-ROM-emulating device. Note that this could entail partitioning your storage device into two partitions – one emulating CD-ROMs and the other used as a read/write mass storage class data partition.

When a CD-ROM or CD-ROM-emulating device is connected to the computer, the users will be presented with a direct link to the program or driver installation via the AutoPlay window if specified in an Autorun.inf file in the media.

Note that in this implementation of CD-ROM, Microsoft Windows does not require (or encourage) the media to be removed and re-enumerated for the Autorun.inf information to be displayed in the AutoPlay window.

Figure 3. CD-ROM AutoPlay window

For more information, see the following links in “Resources” later in this document:

  • Preparing Hardware and Software for Use with AutoPlay
  • USB Website for Mass Storage Class Specification
  • T10 Website for Optical Storage Command Set
  • Information on AutoPlay dynamic handlers

Call to Action

If you ship an AutoRun.inf file that uses a CD-ROM emulation partition only, no change is required.

If you ship an AutoRun.inf file with Mass Storage Class (MSC) USB flash devices or other removable storage devices you should do one of the following:

  • For products currently in the market: Inform customers that they will no longer see your program in AutoPlay and they will need to browse to the folder in Windows Explorer to start the program. Inform users where to find the driver installation packages or programs that they need to run from the removable device.
  • For any products coming out in the future: Inform customers that they need to browse to the folder to start the program, or modify the device to emulate CD-ROM behavior with AutoRun.inf in order to present customers with the direct link to the program through the AutoPlay interface.

For information about Windows Logo Program requirements for removable devices, see the link to the Windows Hardware Developer Central Web site in “Resource” later in this document.

Resources

End User Resources

How to disable the Autorun functionality in Windows

Security support from Microsoft

Microsoft Help and Support


Developer Resources

Enabling and Disabling AutoRun

Creating an Autorun-enabled CD-ROM application

Windows Hardware Developer Central Web site

Windows Update Driver Publishing

Windows Portable Device Enabling Kit

Preparing Hardware and Software for Use with AutoPlay

Information on AutoPlay dynamic handlers


T10 Standards Organization Website

USB Website

July 7, 2009
© 2009 Microsoft Corporation. All rights reserved.