2

I use Inno Setup installer to install my Win32 application, it is installed mainly on Windows 10. There is a driver for some USB dongle (basically it is USB serial port) to be installed together with my app. The driver consists of files and directories:

amd64 (folder)
x86 (folder)
dfu.cat
dfu.inf
usbserial.cat
usbserial.inf

I added dpinst32.exe and dpinst64.exe to the driver's folder and I call dpinst32 or dpinst64 (based on Windows version) from my installer.

However, on some PCs I end with drivers not installed.

What is the correct way to install drivers by my installer?

EDIT: This is log from dpinst64.exe /Q /c

INFO:   Option set: dumping log info to console.
INFO:   Current working directory: 'F:\windrv'
INFO:   Running on path 'F:\windrv'
INFO:   No valid 'dpinst.xml' file provided.
INFO:   Install option set: Running in quiet mode. Suppressing Wizard and OS popups.
INFO:   Found driver package: 'F:\windrv\dfu.inf'.
INFO:   Found driver package: 'F:\windrv\usbserial.inf'.
INFO:   Preinstalling 'f:\windrv\dfu.inf' ...
INFO:   ENTER:  DriverPackagePreinstallW
INFO:   RETURN: DriverPackagePreinstallW  (0xE0000242)
INFO:   Preinstalling 'f:\windrv\usbserial.inf' ...
INFO:   ENTER:  DriverPackagePreinstallW
INFO:   RETURN: DriverPackagePreinstallW  (0xE0000242)
INFO:   Returning with code 0x80020000
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Martin Dusek
  • 1,170
  • 3
  • 16
  • 41
  • FYI: this is inno setup directives I use: – Martin Dusek Feb 14 '20 at 20:13
  • FileName: "{tmp}\windrv\dpinst32.exe"; Parameters: "/S /Q"; Check: not IsWin64 FileName: "{tmp}\windrv\dpinst64.exe"; Parameters: "/S /Q"; Check: IsWin64 – Martin Dusek Feb 14 '20 at 20:13
  • So I can see in inno setup log, that on one computer, call of dpinst64.exe /S /Q returns 2147614720 (0x80020000) exit code. Any idea? If I run dpinst64.exe manually (by double click) it installs the drivers. Then, next time, when my setup is launched and when it calls dpinst64.exe /S /Q the return code is 512 (which probably means the drivers are already installed). So what 0x80020000 means any why dpinst fails when launched in silent mode? – Martin Dusek Feb 16 '20 at 14:12
  • The problem is with `dpinst64.exe`, not Inno Setup. – Bill_Stewart Feb 17 '20 at 17:56
  • I know the problem is with dpinst. I would like to know why it fails in silent mode an not in normal mode. – Martin Dusek Feb 18 '20 at 07:59
  • 1
    I had a similar Problem with dpinst when the operating System does not (yet) trust the manufacturer, the Installation is not complete but you get no error message. Try running dpinst with /SW instead of /S, if a window pops up this could be your Problem. – Kiroul Feb 18 '20 at 10:21
  • Thanks Kiroul. You are correct. /SW works. There are obviously dialogs in dpinst which must be displayed to the user, otherwise dpinst fails. – Martin Dusek Feb 18 '20 at 18:29

1 Answers1

2

The /S Option of Dpinst completely hides all interaction with the operating System. The Problem you are having is that your operating System does not trust the manufacturer yet and does not complete the Installation. If you run Dpinst with the Parameter /SW for example you will see this window.

That will be the reason why the Installation works on some Computers and on some other not.

One solution is to extract the certificates for your Drivers, call certmgr.msc from the console and check under "Trusted Publishers", you should find the manufacturer and with a Right click be able to export the certificate as a yourCert.cer file. You can then as Admin call certutil.exe -addstore "TrustedPublisher" yourCert.cer from the console before you call Dpinst /S on your target system.

As you already gave the operating System the certificate the window should not Pop up anymore and you can run dpinst completely silent.

Kiroul
  • 465
  • 2
  • 9