Install a USB device without a manager prompt

We have a usb device and drivers (.inf, libusb.dll, libusb.sys) and you can install it using the Windows device installation wizard (pointing to the .inf file). However, we need to install the drivers without using the wizard (passively, so the user does not need to do anything). Does anyone know how this can be achieved?

0
source share
2 answers

My colleague came up with an answer that works very well. It appears that if your hardware / driver combination is not WHQL signed, in Win XP the Add New Hardware Wizard will always appear. However, with the following method, it is possible that the Search button in the wizard will automatically find your driver. There is no prompt in Windows 7, and the device installs just fine. However, you will need to monitor 64-bit machines, as they are significantly more stringent in terms of compliance.

So, here is the relevant excerpt from the entire document :

Use the DIFxAPi merge module. (Read a good introduction to drivers on Windows, using INF and DIFxAPP files .) The DIFxAPI merge module is included in the WDK in the WDDK // redist \ DIFx \ DIFxApp \ MergeModule \ directory. The merge module can be included in the MSI package and can be installed to install multiple device drivers. The following are the steps to create an MSI with the DIFxAPP merge module:

  • In the installation folder, create a separate directory in the application folder for the driver package and add the driver files to the folder.
  • Add DIFxApp.msm to the installation project.
  • Create customization
  • Use Orca to edit the MSI database table and add the INF component to the DIFxAPP merge module table.

    • An Orca installation is included in the Windows SDK in the C: \ Program Files \ Microsoft SDK \ Windows \ v7.0 \ Bin directory. (Windows SDK can be downloaded from Microsoft )
    • Launch the Orca program and select the MSI package you want to modify.
      • Read part 5 for automation.
    • In the β€œFile Table”, locate the INF file of the driver package that you want to install and copy the Component value.
    • Create a new row in the MsiDriverPackages table. Add the Component value to the Component field. You can use the following flags (although some of them are ignored by Windows 7):

      • 0 - Not set (default)
      • 1 - force the driver to be installed, even if the installed drivers are installed better than the installed driver.
      • 2 - Disable the window with a message telling the user to connect the device after the driver has been installed.
      • 4 - Prevent the entry in the "Add or Remove Programs for the Driver" entry.
        The driver will be uninstalled if the main application is uninstalled.
      • 8 - Install unsigned driver packages
      • 16 - Delete executable files during removal.
    • Save the MSI. To automate the process, editing the MSI database can be written to Transform, and then Transform can be applied in the post-build process.
      • Open MSI in Orca.
      • Choose Transform-> New Transform
      • Follow steps 3 and 4 in the above directions.
      • Choose Tranform-> Generate transform and save the transformation.
      • Add the following line to the post-assembly of the installation project MsiDb.exe -t transform.mst -d $ (TargetDir) \ DriverInstall.msi Note. MsiDB.exe ships with the Microsoft SDK and is located in C: \ Program Files \ Microsoft SDK \ Windows \ v7.0 \ Bin

If you get a setup error message from MSI (for example, I received error code 2356, which ended due to an invalid Flag value), use the Orca Validate function to see if there are any errors. EDIT: Fixing these errors still hasn't gotten rid of the error. I remember reading that the inf files should be in their own subdirectory, but that also didn't solve my problem.

+1
source

You added the tag "installer", so I assume that you are talking about some kind of installation package, such as Windows installer, InstallShield InstallScript, etc.

If in this case you should probably use the Microsoft DIFx framework .

DIFx makes it easy to create high-quality driver packages, configure the installation of driver packages, enable the installation of driver packages in combination with application software, and use standard Windows APIs and installation tools. DIFx also makes it easier for end users to diagnose device and driver issues. End users can be sure that, if necessary, drivers can be removed or rolled back.

I used DIFx from both Windows installations and to install InstallScript. Very comfortable, easy to debug and efficient.

+2
source

All Articles