原文链接: http://forum.installsite.net/index.php?showtopic=15898
Summary
We found some issues in our drivers’ installation under Microsoft Windows. There are 5 to 6 ways to setup/remove device driver. Let’s see each one’s performance and why we choose the right one to deal with.
The following string will demonstrate each method usage, Advantage and Disadvantage. 
Compare with all different instance and potential problems. Finally, we choose Basic MSI Project & DPInst tools to setup our device driver.

Compile platform:
InstallShield 12 – Premier Edition

Target OS:
Vista, Vista x64, WinXP, WinXP x64 Windows.

Device Driver Setup method Overviews
1. Devcon.exe & Pnputil.exe (InstallScript MSI Project)
Usage:
devcon.exe update driver.inf HWID
devcon.exe remove HWID
devcon.exe dp_delete oem.inf
pnputil.exe –i –a driver.inf
pnputil.exe –f –d oem*.inf

Use LaunchAppAndWait to run the command.

Advantage:
You can setup or remove our driver freely, without any error.

Disadvantage:
devcon.exe can not be distributed. This utility could only use for driver setup testing.
This method will display black command dialog. Custom may not want this.

2. DriverPackage*** API (InstallScript Project Only)
Usage:
Call DIFxDriverPackageInstall function to install device driver.
DIFxDriverPackageUninstall remove device driver.

Advantage:
Call these functions in Install Script in the right position. It is very easy to install or uninstall device driver.

Disadvantage:
Call DIFxDriverPackageInstall will return error code. (Vista x64)
ERROR_BAD_ENVIRONMENT -- The Windows version on which this call was made does not support this operation.

3. Use C to build some utilities to setup or remove drivers. (Old model – InstallScript MSI Project)
Usage:
Build utilities to setup or remove device driver. WINDDK/6000/src/setup/devcon is the source code for reference.
Build DLL (Dynamic-Link Library) or EXE files; contain the functions of FindExistingDevice, RemoveDevice and InstallDevice to do the drivers’ operation.
Call these functions in script code, UseDLL, LaunchAppAndWait or launch the EXE file in Custom Action.
Note: The new version of WDK is different from DDK, including driver setup program. So the original utilities do not work under Vista OS.

Advantage:
This driver setup method is more compatible. You could setup the entire device by one utility; just use the different parameters to setup different device.

Disadvantage:
This must be careful in the path of utilities and the input parameters. And this method is very complex to control all the conditions and environments. It depends more time to build the right utility and to test this utility is correct for all the OS environments.

4. Device Driver Package component in InstallShield (InstallScript MSI or Basic MSI Project)
Usage:
The Device Driver Wizard simplifies the process of installing device drivers from a Windows Installer–based installation using the Driver Installation Frameworks for Applications (DIFxApp) from Microsoft. The wizard creates the necessary table and entries, custom actions, feature, and components.
Create a component in IS contains the SYS, CAT, INF files. 
To open the Device Driver Wizard, do one of the following: 
In the Setup Design view, right-click a feature and then click Device Driver Wizard. The feature that the wizard creates will be a subfeature of the selected feature.
On the Project menu, click Device Driver Wizard. The feature that the wizard creates will be a root-level feature.

Advantage:
If you followed the Device Driver Wizard step by step, then finish the wizard. This component will setup or remove device driver easily, without any other operation.

Disadvantage:
This method could setup only one device driver. There is an error happened when you install two drivers in one project. (Test OS: IS v10.5, Vista Beta 1)

5. DPInst.exe & DIFxAPI.dll (Basic MSI Project)
Usage:
Driver Package Installer (DPInst) version 2.1 is a component of Driver Install Frameworks (DIFx) version 2.1 that simplifies and customizes the installation of driver packages for devices that are not yet installed in a computer (commonly known as a software-first installation). DPInst also automatically updates the drivers for any installed devices that are supported by the newly installed driver packages.

dpinst.exe /S /SA ---- setup driver
dpinst.exe /U "[INSTALLDIR]driver.INF" /S ---- remove driver

Advantage:
Enhance the user experience of a driver package by eliminating most of the manual steps that would otherwise be required to install driver packages. When a user runs DPInst, a wizard notifies the user of the installation progress and provides an optional end-user license agreement (EULA) page that gives the user the option to cancel installation.
Avoid writing a custom installation program to install driver packages and update the installed drivers for supported devices. You do not have to change your driver packages to use DPInst. You only need to create an installation package that includes DPInst and one or more driver packages.

DPInst enables:
• Localization. There are two versions of DPInst: an English-only version and a multi-language version that supports many of the commonly used languages that the Windows operating system supports. 
• Driver installation customization. You can localize and customize the text, icons, and bitmaps that are displayed on wizard pages. You can include an optional EULA and can control whether wizard pages are displayed. 
• Automatic driver package removal. For each driver package that is installed by DPInst, DPInst adds an entry to Add or Remove Programs (in Control Panel) that users can use to remove the driver package from their computers. If a user removes a driver package, the package is removed from the driver store, the corresponding INF file is removed from the system INF file directory, and all of the devices that were previously supported by the package are updated with the next best available driver. 
• Installation error logs. DPInst records high-level messages in the DPInst log file (%windir%/DPINST.LOG). The log file is a plain-text file that contains information and error messages and identifies the driver package that was being installed when an error occurred. For more information about the DPInst log file, see Testing and Debugging a DPInst Installation Package.

Disadvantage:
Not yet.

Other issue
1. Find relate install package (by UpgradeCode), and remove previous version quietly.
Use MsiGetProperty gets the ACTIONPROPERTY value for an installer property.
nResult = MsiGetProperty(ISMSI_HANDLE, "ACTIONPROPERTY", szActionProperty, nSize);

ActionProperty 
When the FindRelatedProducts action detects a related product installed on the system, it appends the product code to the property specified in this field. The property specified in this column must be a public property and the package author must add the property to the SecureCustomProperties property. Each row in the Upgrade table must have a unique ActionProperty value. After FindRelatedProducts, the value of this property is a list product codes, separated by semicolons ( , detected on the system.

Silent uninstall InstallShield package
HKLM/SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall/[InstallShiels_]{YOUR_GUID}Get the Value of the "UninstallString" (..../IDriver.exe /M{YOUR_GUID})
append to that Value /uninst --> /IDriver.exe /M{YOUR_GUID} /uninst 2. Support silent install. (setup.exe /S /v/qn)

2. Support silent install.
setup.exe:
setup.exe /S /v/qn
setup.msi:
msiexec.exe /qn

3. Support multi-languages. (All items in the InstallShield project languages list)

4. Vista x64 Windows/System32 folder
Our utilities do not work under Windows/System32 folder. Include:

Narrow Sense (Windows Utilities)
pnputil.exe
silentcall.exe (this utility use for hide the command’s dialog, call CreateProcess API function)
cmd.exe

Broad Sense (Windows API)
ShellExecute
LaunchAppAndWait
CreateProcess
CreateProcessAsUser

On the contrary, devcon.exe runs success.

5. be careful of parameter’s full path
In Vista x64 system, the ProgramFileFolder is “Program File (x64)”. Be careful of parameter’s path must add quotation mark in Custom Action and Script Code. Make sure the full path is right.

How to install Windows device driver, Vista, Vista x64, WinXP, WinXP x64 Window相关推荐

  1. Debug docker: docker: Error response from daemon: could not select device driver ““ with capabilitie

    报错信息 docker: Error response from daemon: could not select device driver "" with capabiliti ...

  2. docker gpu报错Error response from daemon: could not select device driver ““ with capabilities: [[gpu]]

    Docker容器中使用Nvidia GPU报错 docker: Error response from daemon: could not select device driver "&qu ...

  3. Ubuntu18.04报错解决方案:could not select device driver ““ with capabilities: [[gpu]]

    Docker容器: Docker容器将一个软件包在一个完整的文件系统中,该文件系统包含运行所需要的一切:代码,运行时,系统工具,系统库等任何可以安装在服务器上的东西.这保证了软件无论其环境如何,都将始 ...

  4. VxWorks设备驱动开发指南--VxBus And VxBus Device Driver

    8D Spaces Reliability & Stability & Efficiency 目录视图 摘要视图 订阅 VxWorks设备驱动开发指南(二)--VxBus And Vx ...

  5. docker: Error response from daemon: could not select device driver ““ with capabilities: [[gpu]]

    docker: Error response from daemon: could not select device driver "" with capabilities: [ ...

  6. I.MX6 ar1020 SPI device driver hacking

    /************************************************************************************* I.MX6 ar1020 ...

  7. [转]Install Windows Server 2012 in VMware Workstation

    本文转自:http://kb4you.wordpress.com/2012/06/28/install-windows-server-2012-in-vmware-workstation-2/ Thi ...

  8. bus,device,driver三者关系

    bus,device,driver三者关系 bus: 总线作为主机和外设的连接通道,有些总线是比较规范的,形成了很多协议.如 PCI,USB,1394,IIC等.任何设备都可以选择合适的总线连接到主机 ...

  9. Linux中SDIO命令,linux device driver之sdio驱动编程分享

    linux device driver之sdio驱动编程分享 闯客网 • 2018-12-19 • 技术交流 [p=26, null, left]先谈谈如何写linux驱动:[/p]- 在驱动模块初始 ...

最新文章

  1. 一篇文章搞定大规模容器平台生产落地十大实践
  2. AOP动态代理的实现机制
  3. 给html5标签设置手机号码格式化,meta标签name=format-detection属性写法及用法
  4. org.apache.flink.table.api.bridge.java.internal.BatchTableEnvironmentImpl找不到的问题
  5. ASP.NET Core File Providers
  6. FIREDAC连接SQLITE乱码的解决
  7. dx 游戏 hook 画面截取 鼠标_关于DX-30E 个人简评
  8. 数学分析:定积分的概念
  9. ASCII码表、ASCII码扩展表
  10. 2022年5月17日 点扩展函数的matlab仿真学习
  11. 【人脸识别】arcface-pytorch代码解析
  12. Span 介绍及使用(二)
  13. 数据库原理及应用教程(第4版|微课版)陈志泊-第三章习题
  14. MySQL数据库整理
  15. 2021-03-17
  16. html背景颜色图片,HTML背景颜色和背景图片
  17. 交通流的微观模型(Matlab代码实现)
  18. 阿里云SDK播放器集成
  19. 高大上网站布局的三个技巧
  20. 物联网区块链革命来了:这就是为什么你应该注意

热门文章

  1. Pycharm如何设置自动换行
  2. java8 stream_Java 8 Stream中间操作(方法)示例
  3. python编写爬虫爬取先知社区文章
  4. 分析3CX SIP呼叫
  5. 神行千里 游戏蜂窝iOS战舰少女r远征辅助
  6. ios上运行python_iOS上的Python
  7. 1454 糖果的游戏
  8. 大学计算机课程报告python_基于python语言和数据分析的大学公共计算机课程方案...
  9. 免费的PDF转PPT网站分享
  10. 解读各种PS图层混合模式的工作原理