hai
i am karthik. i am having very small doubt. for one of my usb devive, i am having .inf and .sys file. If i plug the device, then i can force manuall to take that files and works well. how can i create one installer to this automatic for installing and removing driver.

help me.
thanks in advance.
karthik

Dani AI

Generated

Short, practical plan for that builds on ’s points: the right‑click “Install” on an INF is fine for one machine, but a redistributable EXE should not just copy files into System32. Create a proper driver package (INF + referenced binaries + a catalog), stage it into the Windows Driver Store, and have the installer call the supported install APIs or pnputil so Windows validates and re‑uses the package when the device is replugged. (learn.microsoft.com)

Authoring checklist and an installer workflow to follow: (1) make sure the INF’s Version section lists a CatalogFile and the correct hardware IDs; (2) generate the .cat file with Inf2Cat; (3) release‑sign the catalog (or submit for attestation/WHQL as required for public x64 drivers); (4) bundle the INF/.sys/.cat in your installer and call the supported staging/install step (SetupCopyOEMInf/DiInstallDriver or pnputil) from an elevated process. Minimal examples:

Inf2Cat /driver:"C:\MyDriver" /os:10_X64

signtool sign /fd sha256 /tr <timestamp-url> mydriver.cat

pnputil /add-driver "C:\MyDriver\mydriver.inf" /install

See Inf2Cat, SignTool, and PnPUtil docs for exact options. (learn.microsoft.com)

Uninstall and packaging notes: remove any device instances first, then delete the package from the Driver Store (pnputil /delete-driver … /uninstall or DiUninstallDriver / SetupUninstallOEMInf from your uninstaller). Don’t rely on old DIFx/DPInst tooling — Microsoft deprecated DIFx and recommends using standalone driver packages and pnputil or SetupAPI calls. Also remember modern 64‑bit Windows enforces driver signing rules (plan for test‑signing during development and proper release signing/attestation for production). (learn.microsoft.com)

Troubleshooting tips: run the installer elevated; verify the INF references every file (or staging will fail); use pnputil /enum-drivers and SetupAPI logs to debug; confirm hardware IDs in Device Manager match the INF. For a single‑machine convenience install the INF context‑menu is simplest, but for any redistribution use the package + signing + pnputil/SetupAPI approach above. (learn.microsoft.com)

Recommended Answers

All 3 Replies

Once the drivers are installed, the USB device should be reckognized every time you plugg it in. If the driver is not included in windows list of drivers, then you'll need to install the device driver manually or provide hardware installation wizard a floppy or CD with the driver.

There is no need for driver removal afterwards.

Thats ok but still i need to make one exe to put the files in the system 32 directory. if somebody can assis on this to do?

When you rightclick INF file you have "Install" menu item.

The command for "install" is rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 %1

You can make 2 BAT files for install and uninstall commands.

Install.bat:

rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 usbdevice.inf

Uninstall.bat:

rundll32.exe setupapi,InstallHinfSection DefaultUninstall 132 usbdevice.inf

where the "usbdevice.inf" should be changed to filename of the INF file.

These 2 batch files must be in same directory as INF file.

Here are examples attached.

If you need to manually put files in system32 directory, you can use "copy" command.

"Copy file.dll %SystemRoot%\System32\file.dll"

Note that you must use quotation marks on the filename if the filename has spaces in it, or (in case of w95 or w98) if the filename exceeds 8.3 format (ex: copy "very long filename.very long extention").

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.