cloanto.comProductsDownloadShopSupportContact

Knowledge Base
Previous Page
End of Page
TITLE

Tutorial: Using MenuBox on AutoRun CDs and DVDs

 

TOPIC

Q: How does an AutoRun CD work? How is MenuBox used in this context?

 

DISCUSSION

Overview

AutoRun is a feature of the Microsoft Windows operating system which makes it possible to automatically run a program (e.g. a menu window, a setup procedure, etc.) when a medium is inserted in the drive. Originally designed to launch CD-ROM-based applications, AutoRun also works on DVD-ROMs and other media. Support for AutoRun is a requirement of "Windows Logo" programs since Windows 95. MenuBox can not only be used as the application which opens a menu when the medium is inserted in the drive, but it also extends the original AutoRun specification (which covers the running of programs, not the opening of specific documents) by allowing non-program files such as HTML, PDF, PowerPoint, etc. to be automatically opened when the medium is inserted in the drive.

Autorun.inf

When a medium is inserted in an AutoRun-enabled drive, the system looks for a file named "autorun.inf", which has to be stored at the root of the medium (i.e. it cannot be inside a directory). The file is structured following a simplified INI file format (the format used by MenuBox for its own configuration files). Most AutoRun-related needs are fully covered by setting just one or two keys (Open and Icon) in the [AutoRun] section of the "autorun.inf" file, which can be edited with a simple program like Notepad.

In the following example "menubox.exe" (the MenuBox executable) and "menubox.ini" (the MenuBox configuration file) are stored at the root of the medium (i.e. together with "autorun.inf") and the behavior of MenuBox is defined in detail in the MenuBox configuration file (which is opened automatically when MenuBox is launched with no command line options).

[AutoRun]
Open=MenuBox.exe

The following example additionally assigns an icon to the medium and groups the MenuBox executable and configuration file, plus the icon file, in a subdirectory named "AutoRun" (this could be any other name, e.g. "MenuBox", etc.)

[AutoRun]
Open=AutoRun\MenuBox.exe
Icon=AutoRun\MyCD.ico

The following example uses the MenuBox command line functionality, rather than a MenuBox configuration file, to open an HTML file using the default browser installed on the system. Command line mode is very easy to use, but it cannot be used to check if a viewer is installed and install it if necessary. (Note: although this example uses an external browser, HTML documents can also be opened inside MenuBox.)

[AutoRun]
Open=AutoRun\MenuBox.exe Docs\index.html

The following example uses the MenuBox command line functionality to open a PowerPoint presentation, making sure that the current directory is changed first, so that relative links from the first PowerPoint file to other files in the same directory will work properly (be sure to also enable the "Use relative path for hyperlink" option in PowerPoint).

[AutoRun]
OPEN=MenuBox\MenuBox.exe /d:powerpoint presentation.pps

The above example can be applied in a similar way to other types of documents (e.g. PDF, Excel, Word, etc.), but in all cases it does not check whether the system is actually capable of displaying these documents. MenuBox includes powerful functionality to check whether an appropriate viewer/player is installed, and, if not, to install the required software (which can be included on your medium) before proceeding. This functionality cannot be expressed in a single command line, and is therefore available through the configuration file.

The Open and Icon keys work on all versions of Windows (Windows 95 and higher). The leading path information and the trailing command line options in the Open key are optional. If you use the Icon key we recommend that, for best results, you make sure that the icon file contains images in the most popular formats (ready for use on different display resolutions and icon size settings), which are 16x16, 32x32 and 48x48 pixels.

The AutoRun specification covers additional features (e.g. support for different CPU platforms, drive label and shortcut menus, handling of removable devices, installation of drivers, event handlers, etc.) which in part require a specific minimum version of Windows (e.g. Windows XP, Windows for Automotive, etc.) and which are beyond the scope of this documentation. Also, the default behavior of AutoRun (i.e. if it should be enabled in general and/or on specific drives) can be modified via the Control Panel, programmatically, or via the registry.

For additional information please refer to the MenuBox documentation.

Also see:

 

Article Information
Article ID:3-186
Platform:Windows
Products:MenuBox
Additional Keywords:None
Last Update:2003-11-25
Your feedback is always appreciated. It is safe to link to this page.
Legal and Privacy NotesTop of Page