哪位老兄有多媒体安装程序,就是安装盘光盘启动时自动运行的一个外壳程序,能选则自己需要的程序进行安装。
我想,做一个这种程序应该很简单,但我在VC++方面是个新手,不知如何下手。
希望哪位高手能指导一下。
有源码最好了,可EMail至[email protected]
我想,做一个这种程序应该很简单,但我在VC++方面是个新手,不知如何下手。
希望哪位高手能指导一下。
有源码最好了,可EMail至[email protected]
解决方案 »
- 求助各位大神,程序有个自动退出的BUG,怎么测?
- VARIANT.BSTRVAL怎样转换为COLORREF
- 用vc把图片贴在EXCEL文档中,怎么搞啊
- 【100】为什么这段代码在VC6里面好使而在VC2008里面却接连提示分配失败,写入失败?
- 改变CComboBox那个下拉按扭的背景颜色(或者换成自己的图片好了)
- 我要做安装程序,这个安装程序必须支持多国语言,开始菜单必须有应用程序和卸载快捷方式选项,我应该选择哪个制作工具啊
- 转义字符串 很急!很急!
- 怎样获取对象的背景色?
- 静态链接库lib能调用静态链接库里的函数吗?
- 请问:在VC++中如何从DNS获得电子邮件右侧部分的MX记录?(200分!!!)
- 我在一个CWnd上作图,但是想设定一个区域,该区域小于CWnd,在该区域以外的图形不绘制,如何实现?谢谢!
- 问几个概念性的问题
The CD-ROM drive must have 32-bit device drivers that detect when a user inserts a compact disc and notify the system. Device drivers for MS-DOS or 16-bit versions of Windows do not have this feature.
The following sections discuss how to implement an AutoRun-enabled CD-ROM application. Creating an AutoRun-Enabled Application
Autorun.inf Commands
Enabling and Disabling AutoRun--------------------------------------------------------------------------------© 2003 Microsoft Corporation. All rights reserved.
A startup application
When a user inserts a disc into a CD-ROM drive on a AutoRun-compatible computer, the system immediately checks to see if the disc has a personal computer file system. If it does, the system searches for a file named Autorun.inf. This file specifies a setup application that will be run, along with a variety of optional settings. The startup application typically installs, uninstalls, configures, and perhaps runs the application.Creating an Autorun.inf File
The [DeviceInstall] Section
Tips for Writing AutoRun Startup Applications
Creating an Autorun.inf File
Autorun.inf is a text file located in the root directory of the CD-ROM that contains your application. Its primary function is to provide the system with the name and location of the application's startup program that will be run when the disc is inserted.Note Autorun.inf files are not supported under Microsoft® Windows® XP for drives that return DRIVE_REMOVABLE from GetDriveType.
The Autorun.inf file can also contain optional information including:The name of a file that contains an icon that will represent your application's CD-ROM drive. This icon will be displayed by Windows Explorer in place of the standard drive icon.
Additional commands for the shortcut menu that is displayed when the user right-clicks the CD-ROM icon. You can also specify the default command that is run when the user double-clicks the icon.
Autorun.inf files are similar to .ini files. They consist of one or more sections, each headed by a name enclosed in square brackets. Each section contains a series of commands that will be run by the Shell when the disc is inserted. There are two sections that are currently defined for Autorun.inf files.The [autorun] section contains the default AutoRun commands. All Autorun.inf files must have an [autorun] section.
An optional [autorun.alpha] section can be included for Microsoft Windows NT® 4.0 systems running on RISC-based computers. When a disc is inserted in a CD-ROM drive on a RISC-based system, the Shell will run the commands in this section instead of those in the [autorun] section.
Note The Shell checks for an architecture-specific section first. If it does not find one, it uses the information in the [autorun] section. After the Shell finds a section, it ignores all others, so each section must be self-contained.
Each section contains a series of commands that determine how the Autorun operation takes place. There are five commands available.Command Description
defaulticon Specifies the default icon for the application.
icon Specifies the path and file name of an application-specific icon for the CD-ROM drive.
open Specifies the path and file name of the startup application.
shell Defines the default command in the CD-ROM's shortcut menu.
shell\verb Adds commands to the CD-ROM's shortcut menu. The following is an example of a simple Autorun.inf file. It specifies Filename.exe as the startup application. The second icon in Filename.exe will represent the CD-ROM drive instead of the standard drive icon.[autorun]
open=Filename.exe
icon=Filename.exe,1
This Autorun.inf sample runs different startup applications depending on the type of computer. [autorun]
open=Filename_x86.exe
icon=IconFile.ico [autorun.alpha]
open=Filename_RISC.exe
icon=IconFile.ico
The [DeviceInstall] Section
You can use the [DeviceInstall] section on any removable media. It is supported only under Windows XP. You use its one command, DriverPath, to specify a directory path where Windows XP searches for driver files, which prevents a lengthy search through the entire contents.You use the [DeviceInstall] section with a driver installation to specify directories where Windows XP should search the media for driver files. Under Windows XP, entire media are no longer searched by default, therefore requiring [DeviceInstall] to specify search locations. The following are the only removable media that Windows XP fully searches without a [DeviceInstall] section in an Autorun.inf file. Floppy disks found in drives A or B.
CD/DVD media less that 1 gigabyte (GB) in size.
All other media must include a [DeviceInstall] section for Windows XP to detect any drivers stored on that media.Note As with the [AutoRun] section, the [DeviceInstall] section can be architecture-specific.
Tips for Writing AutoRun Startup Applications
There are essentially no constraints on how to write an AutoRun startup application. You can implement it to do whatever you find necessary to install, uninstall, configure, or run your application. However, the following tips provide some guidelines to implementing an effective AutoRun startup application.Users should receive feedback as soon as possible after they insert an AutoRun compact disc into the CD-ROM drive. Startup applications should thus be small programs that load quickly. They should clearly identify the application and provide an easy way to cancel the operation.
Typically, the initial part of the startup application presents users with a user interface, such as a dialog box, asking them how they would like to proceed. Check to see if the program is already installed. If not, the next step will probably be the setup procedure. The startup application can take advantage of the time the user spends reading the dialog box by starting another thread to begin loading the setup code. By the time the user clicks OK, your setup program will already be partly if not fully loaded. This approach significantly reduces the user's perception of the amount of time it takes to load your application.
If the application has already been installed, the user probably inserted the disk to run the application. As with the setup case, you can start another thread to begin loading application code to shorten the waiting time for the user.
Hard disk space may be a limited resource on many systems. Here are a few hints for minimizing hard disk usage:
Keep the number of files that must be on the hard disk to a minimum. They should be restricted to files that are essential to running the program or that would take an unacceptably large amount of time to read from the CD-ROM.
In many cases, installing nonessential files on the hard disk is not necessary, but may provide benefits such as increased performance. Give the user the option of deciding how to make the tradeoff between the costs and benefits of hard disk storage.
Provide a way to uninstall any components that were placed on the hard disk.
If your application caches data, give the user some control over it. Include options in the startup application such as setting a limit on the maximum amount of cached data that will be stored on the hard disk, or having the application discard any cached data when it terminates.
Even though a CD-ROM has an Autorun.inf file, AutoRun can be suppressed programmatically or disabled entirely with the registry. See Enabling and Disabling AutoRun for more information. --------------------------------------------------------------------------------© 2003 Microsoft Corporation. All rights reserved.
. All rights reserved.
Autorun.inf Commands--------------------------------------------------------------------------------This topic is a reference for the commands that can be used in an Autorun.inf file.[AutoRun] Commands
[DeviceInstall] Commands
[AutoRun] Commands
icon
label
open
shellexecute
shell
shell\verb
icon
The icon command specifies an icon which represents the AutoRun-enabled drive in the Microsoft® Windows® user interface.icon=iconfilename[,index]
Parameters
iconfilename
Name of an .ico, .bmp, .exe, or .dll file containing the icon information. If a file contains more than one icon, you must also specify zero-based index of the icon.Res
The icon, together with the label, represents the AutoRun-enabled drive in the Windows user interface. For instance, in Windows Explorer, the drive is represented by this icon instead of the standard drive icon. The icon's file must be in the same directory as the file specified by the open command.The following example specifies the second icon in the MyProg.exe file.icon=MyProg.exe,1
label
The label command specifies a text label which represents the AutoRun-enabled drive in the Windows user interface. label=LabelText
Parameters
LabelText
A text string containing the label. It can contain spaces.Res
The label, together with an icon, represents the AutoRun-enabled drive in the Windows user interface.The following example specifies "My Drive Label" as the drive's label.label=My Drive Label
open
The open command specifies the path and file name of the application that AutoRun launches when a user inserts a disc in the drive.open=[exepath\]exefile [param1 [param2] ...]
Parameters
exefile
Fully qualified path of an executable file that runs when the CD is inserted. If only a file name is specified, it must be in drive's root directory. To locate the file in a subdirectory, you must specify a path. You can also include one or more command-line parameters to pass to the startup application.Res
For more information about startup applications, see Tips for Writing AutoRun Startup Applications.shellexecute
Version 5.0. The shellexecute command specifies an application or data file that AutoRun will use to call ShellExecuteEx.shellexecute=[filepath\]filename[param1, [param2]...]
Parameters
filepath
A string that contains the fully qualified path of the directory that contains the data or executable file. If no path is specified, the file must be in the drive's root directory.filename
A string that contains the file's name. If it is an executable file, it is launched. If it is a data file, it must be a member of a file class. ShellExecuteEx launches the default command associated with the file class.paramx
Contains any additional parameters that should be passed to ShellExecuteEx.Res
This command is similar to open, but it allows you to use file association information to run the application.shell
The shell command specifies a default command for the drive's shortcut menu.shell=verb
Parameters
verb
The verb that corresponds to the command. The verb and its associated command must be defined in the Autorun.inf file with a shell\verb command.Res
When a user right-clicks the drive icon, a shortcut menu appears. If an Autorun.inf file is present, the default shortcut menu command is taken from it. This command also executes when the user double-clicks the drive's icon.To specify the default shortcut menu command, first define its verb, command string, and menu text with shell\verb. Then use shell to make it the default shortcut menu command. Otherwise, the default menu item text will be "AutoPlay", which launches the application specified by the open command.shell\verb
The shell\verb command adds a custom command to the drive's shortcut menu.shell\verb\command=Filename.exe
shell\verb=MenuText
Parameters
verb
The command's verb. The shell\verb\command command associates the verb with an executable file. Verbs must not contain embedded spaces. By default, verb is the text that is displayed in the shortcut menu.Filename.exe
The path and file name of the application that performs the command.MenuText
This parameter specifies the text that is displayed in the shortcut menu. If it is omitted, verb is displayed. MenuText can be mixed-case and can contain spaces. You can set a shortcut key for the menu item by putting an ampersand (&) in front of the letter.Res
When a user right-clicks the drive icon, a shortcut menu appears. Adding shell/verb commands to the drive's Autorun.inf file allows you to add commands to this shortcut menu.There are two parts to this command, which must be on separate lines. The first part is shell/verb/command. It is required. It associates a string, called a verb, with the application to launch when the command runs. The second part is the shell/verb command. It is optional. You can include it to specify the text that displays in the shortcut menu.To specify a default shortcut menu command, define the verb with shell/verb, and make it the default command with shell.The following sample Autorun.inf fragment associates the readit verb with the command string "Notepad abc\readme.txt". The menu text is "Read Me", and 'M' is defined as the item's shortcut key. When the user selects this command, the drive's abc\readme.txt file opens with Microsoft Notepad.shell\readit\command=notepad abc\readme.txt
shell\readit=Read &Me
[DeviceInstall] Commands
DriverPath
DriverPath
The DriverPath command specifies a directory to search recursively for driver files. This command is used during a driver installation and is not part of an AutoRun operation. The [DeviceInstall] section is only supported under Windows XP.[DeviceInstall]
DriverPath=directorypath
Parameters
directorypath
A path to a directory that Windows searches for driver files, along with all of its subdirectories.Res
Do not use drive letters in directorypath as they change from one computer to the next.To search multiple directories, add a DriverPath command for each directory as in this example.[DeviceInstall]
DriverPath=drivers\video
DriverPath=drivers\audio
To indicate that the media contains no driver files so that it is not searched at all, include a [DeviceInstall] section in Autorun.inf that contains no DriverPath commands.
--------------------------------------------------------------------------------© 2003 Microsoft Corporation
在你的根目录下,建立一个autorun.ini文件,文件内容如下:
可以放一个图标文件: youricon.ico(可以没有)[autorun]
open=setup.exe
icon=youricon.ico 然后刻成光盘就可以了,注意,autorun.ini文件,必须是放在光盘的根目录下