驱动程序打包
来源:互联网 发布:syslog服务器软件下载 编辑:程序博客网 时间:2024/06/06 03:43
对于提供inf文件的驱动,在cmd中可以输入一下格式的命令:
RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection <section><mode><path>
例如:
Rundll32.exe setupapi.dll,InstallHinfSection usb2066.Dev.NT 132 D:\Driver\usb2066.inf
通过Rundll32 调用setupapi 的 installHinfSection 函数
SLABWdm.Install.NT INF文件中的配置节 一般是安装开始的入口点 该配置节中包括 文件拷贝 注册表信息
132 ——该参数不详
D:\Driver\usb2066.inf ——INF文件的完整路径
或者自己编写程序实现
msdn 中 installHinfSection 函数说明如下:
InstallHinfSection function
[This function is available for use in the operating systems indicated in the Requirements section. It may be altered or unavailable in subsequent versions. SetupAPI should no longer be used for installing applications. Instead, use the Windows Installer for developing application installers. SetupAPI continues to be used for installing device drivers.]
InstallHinfSection is an entry-point function exported by Setupapi.dll that you can use to execute a section of an .inf file.InstallHinfSection can be invoked by calling the Rundll32.exe utility as described in the Remarks section.
The prototype for the InstallHinfSection function follows the form of all entry-point functions used with Rundll32.exe.
If a file is copied or modified, the caller of this function is required have privileges to write into the target directory. If there are any services being installed, the caller of this function is required have access to theService Control Manager.
Syntax
VOID CALLBACK InstallHinfSection( _In_ HWND hwnd, _In_ HINSTANCE ModuleHandle, _In_ PCTSTR CmdLineBuffer, _In_ INT nCmdShow);
Parameters
- hwnd [in]
The parent window handle. Typically hwnd is Null.
- ModuleHandle [in]
Reserved and should be Null.
- CmdLineBuffer [in]
Pointer to buffer containing the command line. You should use a null-terminated string.
- nCmdShow [in]
Reserved and should be zero.
Return value
This function does not return a value.
Remarks
Note that three exports exist: InstallHinfSection (for RunDll32),InstallHinfSectionA, and InstallHinfSectionW.
To run an Install section of a specified .inf file, you can invokeInstallHinfSection with the Rundll32.exe by using the following syntax.
RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection <section><mode><path>
This passes "<section> <mode> <path>" to CmdLineBuffer.
Alternatively, your program may call InstallHinfSection, InstallHinfSectionA, or InstallHinfSectionW directly, setting theCmdLineBuffer parameter to the following.
"<section> <mode> <path>"
Where path is the full path to the .inf file, mode is the reboot mode parameter, andsection is any Install section in the .inf file. The comma separator between SETUPAPI.DLL andInstallHinfSection on the command line is required. Note that there cannot be any white space on the command line between the comma and SETUPAPI.DLL orInstallHinfSection.
It is recommended that you specify the full path to the .inf file as path.
You may specify any Install section in the .inf file as section. No spaces are allowed.
You should use a combination of the following values for mode. You must include 128 to set the default path of the installation to the location of the INF, otherwise a system-provided INF is assumed. Add values to specify rebooting. Note that only the values 128 or 132 are recommended, other values may cause the computer to reboot unnecessarily or not reboot when it required.
For example, the following command line runs the DefaultInstall section of the Shell.inf file. If Setup determines a reboot is required, the user is will be prompted with a "Reboot the computer, Yes/No" dialog box.
RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 C:\WINDOWS\INF\SHELL.INF
Requirements
Minimum supported client
Minimum supported server
Header
- Setupapi.h
Library
- Setupapi.lib
DLL
- Setupapi.dll
Unicode and ANSI names
- 驱动程序打包
- USB驱动程序打包
- 驱动程序
- 驱动程序
- 驱动程序
- 驱动程序
- 驱动程序
- 驱动程序
- 驱动程序
- 怎么把一个硬件的驱动程序打包到自己的应用程序的安装程序里
- 将Eclipse中编写含有JDBC驱动程序jar包的Java程序打包
- 打包
- 打包
- 打包
- 打包
- 打包
- 打包
- 打包
- POJ 2653 Pick-up sticks (判断线段相交)
- 警告Local declaration of 'tableView' hides instance variable
- Spark SQL利器:cacheTable/uncacheTable
- js 父子窗口(一)
- spring动态配置多数据源
- 驱动程序打包
- c++模板特化
- ubuntu 建立快捷方式
- Java I/O流操作(二)---缓冲流
- 人脸识别学习资料
- 强联通分量-kosaraju
- 使用opengl绘制三角形
- 我的第一博客
- 图像像素颜色显示及像素位置显示工具——imtool