|
|
Also check out PHD's
Dynamic-CD,
a local server that serves HTML and scripted pages directly from a CD.
FindinSite-CD,
a search engine for CDs or DVDs
FindinSite,
a search engine for a web site
|
|
Introduction
Need any help setting up CDs or DVDs?
Get in touch
paid-for consultation, software development or web programming.
|
AutoRun used to be called AutoPlay.
The term AutoPlay now describes a (similar) Windows XP feature
that launches an application to display picture, music or video content
on removable devices.
Programmer's guide to AutoPlay
|
AutoRun runs a program when a CD or DVD is inserted into a Windows computer - see below
for advice on Apple Macs.
If Windows finds a (plain text) file called AUTORUN.INF in the root directory of a CD
then it follows the instructions in this file to run a program. This example
AUTORUN.INF file tells Windows to run program
setup.exe (from the root directory of the CD):
[autorun]
open=setup.exe
icon=snazzie.ico
Use the Windows Notepad application to edit plain text files
(it is in the Start+All Programs+Accessories menu).
Your CD users may have switched off AutoRun. This might be because they are concerned
about viruses. Also, if they press the Shift key down while inserting the CD,
AutoRun is disabled. In Windows NT4, 2000 and XP systems, only Administrators and Power
Users can use AutoRun.
Windows Vista by default shows an AutoPlay dialog (right) to ask whether you want to run
the AutoRun software - more details below.
There is no way to force your users to use AutoRun. It is therefore good practice to provide
instructions so that users know how to start your CD, eg tell them to open file
index.htm in their browser. These instructions are also required if your CD
might be viewed by non-Windows users.
So why is ShellRun needed?
To be honest, you do not really need ShellRun. All recent Windows computers let you show a file
as well as run a program, eg:
[autorun]
shellexecute=index.htm
If you use ShellRun instead, then a small window appears quickly to let the user know
that something is happening. The freeware version of ShellRun looks like the screen shot on the right.
If you wish to customise the display, provide a menu etc, then please look at the
retail version.
What does ShellRun do then?
ShellRun shows your file and displays a neat popup window.
The popup appears straight away so that the user knows that something is happening.
ShellRun works in all Windows systems.
This example AUTORUN.INF tells ShellRun to show web page index.htm
while displaying message "Starting CD now..." in the ShellRun popup window.
[autorun]
open=ShellRun.exe index.htm Starting CD now...
Do not forget to put ShellRun.exe in the root directory of your CD along with
AUTORUN.INF.
Viewer Technicalities
All the above AutoRun examples, including ShellRun, use the same core technique to display
a file.
Windows associates a viewer program with each file type. For .HTM and .HTML
web pages, the viewer program will be your default browser.
If a user does not have a viewer for your file type then it cannot be displayed
until a viewer is installed. For example, if you are trying to show a PDF file,
the user must have Adobe Reader or equivalent installed.
If a viewer is not available, the freeware version of ShellRun just displays a message.
In retail version you can prompt the user to run a viewer installation program.
See the page for more details.
If you have a viewer program available then put its installation program
on your CD - if you are allowed to distribute it.
To distribute Adobe Reader, see here:
Adobe Reader - Download Adobe Reader for distribution.
Enabling AutoRun on your computer
To test AutoRun you need to have it enabled on your computer. A registry setting
can be used to disable AutoRun. Click Start+Run then type in regedit.
Select Edit+Find and type in NoDriveTypeAutoRun. This value should
be found in this key:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
.
The NoDriveTypeAutoRun value should be hexadecimal 95 if AutoRun is enabled on all CDs,
or B5 if disabled for CDs. (If you want to test AutoRun on a floppy disk,
set this value to 91.)
You may need to change more than one instance of NoDriveTypeAutoRun in the registry.
You usually need to reboot for a new value to take effect.
In Windows 95/98/Me the NoDriveTypeAutoRun value is displayed as
95 00 00 00. In Windows NT4, 2000 and XP this value is
displayed as 0x00000095 or hexadecimal 95. If you modify the NoDriveTypeAutoRun value
make sure it is still in the correct format.
More ways to disable AutoRun
There are two other - uncommon - ways of disabling AutoRun. The NoDriveAutoRun registry
value is in the same key as NoDriveTypeAutoRun. Each bit represents each drive, so
hexadecimal 01 disables AutoRun for floppy drive A, 04 disables AutoRun
for drive C, 10 disables AutoRun on E. Values can be combined, so 19
disables AutoRun on E, D and A.
If either NoDriveTypeAutoRun or NoDriveAutoRun specify that AutoRun should be
disabled for a drive, then it is disabled for that drive.
Finally, programmers might like to know that AutoRun can also be disabled by the
program that controls the foreground window by handling the "QueryCancelAutoPlay"
Windows message. Please consult the Microsoft documentation for more details.
More AutoRun options
You can set further options in the AUTORUN.INF file.
Enhanced CDs - music and data
Enhanced CDs contain both music audio and computer data, so they can be played on
audio equipment and used on a computer. (Enhanced CDs are also known as
CD Extra or CD Plus CDs.) Note that the Mixed-mode CDs also
contain audio and data, but these may not be playable on audio equipment.
Note that not all Windows computers will recognise the data on an Enhanced CD,
although the audio is always seen.
(Windows Me, 2000 and XP usually seem to recognise Enhanced CD data, but it may
be drive dependent.)
A test Apple Mac (iMac OS 10.2.8) did recognise the audio and data;
however a Mac with OS 9 did not.
If the Enhanced CD data does not have an AUTORUN.INF file, then Windows will usually
start playing the CD when it is inserted.
However, if an AUTORUN.INF is present, then Windows will follow the instructions in there
rather than playing the CD. The retail version of ShellRun has an option
to start playing the audio - .
The data on an Enhanced CD can only use short filenames or folder names.
Long filenames will be truncated to an "8.3" form, eg "index.html" may appear as "INDEX~1.HTM".
Windows Vista AutoPlay and AutoRun
Windows Vista by default shows an AutoPlay dialog (right) to ask whether you want to run
the AutoRun software.
If you select "Set AutoPlay defaults in Control Panel" then the window below lets you alter
the AutoPlay and AutoRun default options.
AutoStart on Macs
The equivalent to AutoRun on Macs is called AutoStart.
We are informed that this only works on OS9 and earlier;
Mac OS10 via Toast
only allows you to open a folder window and not an application.
MacImage for Windows says that
it can create AutoStart CDs on a PC.
Other tools:
Toast for Mac.
CDEveryWhere.
We have not tested any of these products.
Keiser Photography
have instructions for using Toast to make a CD that will AutoStart on a Mac as
well as using ShellRun to AutoRun on Windows computers.
Filenames as seen by a Mac
By default, CDs created on a PC might have garbled filenames when viewed on an old Mac.
Long filenames will be truncated to an "8.3" form, eg "index.html" may appear as "INDEX~1.HTM"
on a Mac.
However OS X 10.2.6+ recognises long file names.
However, a pre OS-X Mac user can install the shareware Joliet File System Extension, from
http://www.tempel.org/joliet/, which will
make long PC filenames readable. If your CD uses the Joliet format because it has long filenames,
then suggest to your
Mac users that they install this software to view the CD fully.
Therefore, if you have Mac users, it is best to ensure that your filenames are short, and provide
instructions for viewing the CD manually, eg "View this CD by opening INDEX.HTM in your browser".
|