驱动安装包制作:使用SetupCopyOEMInf函数 用installshield 即可完成安装

Driver Package Installer (dpinst) 使用说明 DPInst.exe: installs and uninstalls driver packages. DPInst.exe: 安装及删除驱动程序包。 By default, the tools searches the current directory and tries to install all driver packages found. 默认情况下,此工具会搜索当前目录并尝试安装找到的驱动程序包。 Usage: DPInst.exe [/U INF-file][/S | /Q][/LM][/P][/F][/SH][/SA][/A][/PATH Path][/EL][/L LanguageID][/C][/D][/LogTitle Title][/SW][/? | /h | /help] 用法:DPInst.exe [/U INF-file][/S | /Q][/LM][/P][/F][/SH][/SA][/A][/PATH Path][/EL][/L LanguageID][/C][/D][/LogTitle Title][/SW][/? | /h | /help] /U path to INF file Uninstall a driver package (INF-file). /U 指定 INF 文件 删除一个驱动程序包(INF-文件)。 /S | /Q Silent (Quiet) mode. Suppresses the Device Installation Wizard and any dialogs popped-up by the operating system. /LM Legacy mode. Accepts unsigned driver packages and packages with missing files. These packages won't install on the latest version of Windows. /LM 传统模式。接受未签名的驱动包(缺少.cat文件)以及包中有文件丢失。 /P Prompt if the driver package to be installed is not better than the current one. /P 如果驱动包已经安装以及比当前使用的版本要旧就发出提示。 /F Force install inf the driver package is not better than the current one. /F 强制安装比当前使用的版本要旧的驱动包。 /SH Scans hardware for matching devices and only copies and installs those drivers for which a device is present. Only valid for Plug and Play drivers. /SH 仅仅对已插入的匹配的硬件设备进行扫描。 /SA Suppress the Add/Remove Programs entry normally created for each driver package. /SA 禁止“添加或删除程序”创建卸载项。 /A Install all or none. /PATH Path Search for driver packages under the given path. /PATH 路径 在指定的路径下搜索驱动程序包。 /EL Enables all languages not explicitly listed in the XML file. /L LanguageID Tries to use the given language in all UI. Useful for localization tests. /SE Suppress the EULA. /SE 禁止最终用户许可协议。 /C Dump logging output to attached Console (Windows XP and above). /C 转存日志文件输出到附加控 立即下载

http://blog.csdn.net/emma_he/article/details/5858781 


http://cysbox7.blog.163.com/blog/static/11587863320105975159520/

 

引用不知道哪位大牛的原话:

对于即插即用简单地说要对付2种情况 
1。在你的设备未安装前,安装驱动程序这叫预先安装。 
最简单的方法就是使用SetupCopyOEMInf函数。 
具体做法是: 
将SetupCopyOEMInf封装在一个动态库里。 
用installshield将所有文件copy到一个临时目录。 
调用动态库使用SetupCopyOEMInf函数copy临时目录下的inf文件(路径)。 
installshield让计算机重启。 
插上设备,自动识别。 
 2.你的设备已安装,弹出安装向导。 
很简单,让用户搜索你的安装盘,即可完成安装。
 
懒得写dll了(其实是不会写- -),devcon dp_add调用SetupCopyOEMInf做了预安装




wdk文档中关于预安装的一段话
我刚开始以为预安装就是直接把驱动安上,白痴似的把驱动直接安上了,然后我机子上面之前的驱动没卸干净,添上设备后直接能用,偶就把安装程序当成一个版本交了,囧。。。

 

Preinstalling Driver Packages

To preinstall driver files, your device installation application should follow these steps:

1. On the target system, create a directory for the driver files. If your device installation application installs an application, the driver files should be stored in a subdirectory of the application directory.

2. Copy all files in the driver package from the distribution media to the directory created in step (1). The driver package includes the driver or drivers, the INF file, the catalog file, and other installation files.

3. Call  SetupCopyOEMInf specifying the INF file in the directory created in step (1). Specify SPOST_PATH for the OEMSourceMediaType parameter and specify NULL for the OEMSourceMediaLocation parameter.SetupCopyOEMInf copies the INF file for the driver package into the %windir%/Inf directory on the target system and directs Windows to store the source location of the INF file in its list of preprocessed INF files. SetupCopyOEMInf also processes the catalog file, so the PnP manager will install the driver the next time it recognizes a device listed in the INF file.

When the user plugs in the device, the PnP manager recognizes the device, finds the INF file copied bySetupCopyOEMInf, and installs the drivers copied in step (2). (For more information about copying INF files, see Copying INFs.)


InstallShield 驱动打包完美的示例 一个完整的IS安装程序实例,是分享网友的一些经验;仔细阅读、临摹以便,将会能顺利上手如何为自己的软件打包,或者将一些第三方的ocx、dll等资源整合到相应的驱动之中! 立即下载

相关推荐

SetupCopyOEMInf函数 驱动开发

SetupCopyOEMInf这个函数很好,可以原装驱动,也就是在设备插入之前运行这个函数。那么当设备插入电脑的时候,系统就可以自动安装驱动。     起参数也比较简单。      BOOL WINAPI SetupCopyOEMInf( PCTSTR SourceInfFileName, PCTSTR OEMSourceMediaLocation, DWORD OEMSourceMe

QQ_976606456的博客 2247

安装USB驱动,采用让系统枚举的办法

#include #include #include #pragma comment(lib, "Setupapi.lib") #include #include BOOL RemoveUnknownDevices() { HDEVINFO hInstDevInfoSet = INVALID_HANDLE_VALUE; LPGUID lpGuid = (LPGUID)

patdz的专栏 3067

usb驱动自动安装中遇到的问题

主要有四个步骤: 1.        根据“协作安装程序应用一例”编写dll 2.        函数实现dll的注册 3.        然后预安装 4.        插入设备测试 1.        根据“协作安装程序应用一例”编写dll Dll是基于win32的dll程序,入口函数的声明如下: extern "C"__declspec(dlle

Huaerge的专栏 2932

安装驱动程序的API,SetupCopyOEMInfW 和 UpdateDriverForPlugAndPlayDevices

Windows安装驱动程序的api特别的多,

闲人的专栏 5327

C# SetupCopyOEMInf安装驱动并返回DestinationInfFileNameComponent

最近用C#写安装usb驱动,必须得调用APISetupCopyOEMInf: BOOL WINAPI SetupCopyOEMInf( _In_ PCTSTR SourceInfFileName, _In_ PCTSTR OEMSourceMediaLocation, _In_ DWORD OEMSourceMediaType, ...

weixin_30797199的博客 407

windows 网路驱动安装

最近在开发网路协议及小端口驱动,在http://www.ndis.com/下载了协议驱动安装的例子ProtInstall(http://www.ndis.com/ndis-general/ndisinstall/programinstall.htm),研究了一下,特记录一下。 网络方面的驱动可以使用INetCfg接口安装,其安装步骤大致如下 1. 使用CoCreateInstance创建Com

xbgprogrammer的专栏 2791

通过右键安装inf文件来安装驱动程序这种方式可取吗?

很多人拿到驱动包准备安装驱动时,往往先想到通过鼠标右键-安装这种方式来安装驱动。且不说能不能安装成功,要支持这种安装方式,对inf文件有一定的要求:inf文件中需要包含[DefaultInstall]这样的节,这个节是右键安装时的Inf入口点(MSDN的原话:"An INF file's DefaultInstall section is accessed if a user selects th

lixiangminghate的专栏 1万+

怎样编写驱动程序安装程序?(英文)

 Writing a Device Installation Application     If your driver package includes drivers and INF files that replace "in-box" drivers and INF files, or if your package includes device-specific applicatio

sun的专栏 2309

如何制作驱动程序安装包

制作驱动程序的安装包(需要inf,sys等)其实有许多种方法,以下以NSIS作为制作工具列举几种,并说明利弊: 1.使用NSIS的InstDrv控件: 下载地址:http://nsis.sourceforge.net/InstDrv_plug-in 下载来的安装包里有例子,本人成功用此方法做出了一个安装包,可惜有如下缺点。 缺点:不能做64位系统的驱动安装包  

Enbiting的专栏 2524

InstallShield 2020 基本使用教程

title: InstallShield 2020 基本使用教程 date: 2021-07-24 12:16:48 tags: [InstallShield] InstallShield 2020 基本使用教程 本教程使用 InstallShield 2020 进行教学 新建项目 选择 HOME, 点击 New 进入 New Project 页面 这里可以选择您需要的 Project Types,设置您的 Project Name 以及 Location,然后点击 OK 即可创建项目。 这里我以默.

F_Just 1万+

使用installShield制作一个含调用设置、服务注册及驱动程序的安装包

<br /><br /> <br />新建一个工程,类型为installScript Project。填入工程名称及工程路径<br />进入project Assistant点击下一步 <br />在ApplicationInformation中填入公司名称、应用名称、版本和公司网址<br />在Application Files中的Application Target Folder对应的右边框中加入程序文件,在Support Folder中加入对应的驱动程序文件.inf和.sys<br />在Applic

萌大叔的专栏 2659

使用InstallShield制作Windows阿里云Virtio驱动安装包(三)-- 安装和卸载驱动

    安装和卸载驱动使用的是Windows的devcon.exe,具体安装和卸载的原理可以参考微软官方的MSDN文档。以下两条devcon命令的说明转载自微软的MSDN:1.devcon install: https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/devcon-install2.devcon remove...

Mr.Qiao の Blog 680

vista 64无法正常安装驱动的问题--SetupCopyOEMInf

SetupCopyOEMInf这个函数很好,可以原装驱动,也就是在设备插入之前运行这个函数。那么当设备插入电脑的时候,系统就可以自动安装驱动。 起参数也比较简单。 BOOL WINAPI SetupCopyOEMInf( PCTSTR SourceInfFileName, PCTSTR OEMSourceMediaLocation, DWORD OEMSour...

weixin_33672109的博客 858

SpringBoot启动失败Application run failed的解决办法

启动springBoot报Application run failed 我只发现两种错误。 1.改成UTF-8的格式 application.yml文件格式错误,编辑的时候一般都是jdk格式得改成UTF-8 2.查看pom.xml中的依赖 第一次创建是2.4.3版本改成2.2.12版本和eureka依赖的版本一致就可以正常运行了 已可以正常运行。 ...

detailJUN的博客 11万+
上一篇: Window Driver 安装
下一篇: Gid+私有字体
patdz
博客等级 码龄14年 20粉丝 32原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值