Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8312693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:14:47+00:00 2026-06-08T20:14:47+00:00

I want to install a third-party libusb driver during a Windows Setup installation. I

  • 0

I want to install a third-party libusb driver during a Windows Setup installation. I created this installation with Visual Studio 2010.

I have tried installing this driver through the command line using SetupAPI and DifXAPI, but nothing happens. I expect a window to popup stating that it is an unsigned driver, and you have to click OK to continue. The only way I have got this window to popup is if I used a C# console application and P/Invoke to call the driver install code from DifXApi (pointing to the INF file which looks like it was generated by inf-wizard), and the project needed to be built for x64 (I need this to also work for 32-bit installers). After clicking OK the driver never installed.

The only way this driver correctly installs is if I plug in the hardware via USB, right click the unknown device, and browse to the folder containing the driver DLL file’s, sys files, and INF file. How does Windows figure out how to install the driver?

The INF file has driver sections for 32 bit/64 bit/Itanium, but how does Windows know which section to install, and what is Windows doing differently that I am in command line?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T20:14:50+00:00Added an answer on June 8, 2026 at 8:14 pm

    I am able to install the drivers on 32-bit and 64-bit Windows with the following code, where infPath is the path to the INF file, and devices is a list of all the device id’s associated with the USB device:

    [DllImport("setupapi.dll")]
    public static extern bool SetupCopyOEMInf(
        string SourceInfFileName,
        string OEMSourceMediaLocation,
        int OEMSourceMediaType,
        int CopyStyle,
        string DestinationInfFileName,
        int DestinationInfFileNameSize,
        int RequiredSize,
        string DestinationInfFileNameComponent
        );
    
    [DllImport("newdev.dll")]
    public static extern bool UpdateDriverForPlugAndPlayDevices(
        IntPtr hwndParent,
        string HardwareId,
        string FullInfPath,
        uint InstallFlags,
        bool bRebootRequired
        );
    
    [STAThread]
    static void Main() {
      if (SetupCopyOEMInf(infPath, null, 0, 0, null, 0, 0, null)) {
        foreach (string device in devices) {
          UpdateDriverForPlugAndPlayDevices(IntPtr.Zero, device, infPath, 0, false);
        }
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to install outlook add-ins (Which is developed by Visual studio 2008) but
I want to block the third party application installation in iPhone programmatically. Want to
I want to install visual studio 6 and Visual Studio 2008 both on my
I am new to android. I want to install an unreleased third party android
I want to install some great third-party libraries on Mac OS X which will
I want install Android version 1.6 SDK. I already have Android development setup with
I want to install a localhost server on a tablet with windows RT 32
I want to install php in my system.For this I have downloaded the php-5.3.5.tar.bz2
Third party vendors using our software as a component view Windows Logo Certification as
I'm using the Django Activity Stream third party app from a Easy Install /

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.