MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Driver install fails when using .inf file

Mon Apr 16, 2018 5:37 pm

Hi,

[[ This is occurring on while installing on Windows 7 (x64) system ]]
[[ I am an administrator on the system ]]

This is an urgent issue and I need a resolution ASAP


I have sent a smaller project file that contains a test program for watching the driver status to Daniel Radu


Please try these steps

1. Run install program, get "unsigned driver" message, click "install anyway"

2. Locate PDeTectTest.exe on your system
3. start PDetectTest, notice application says driver is NOT installed and NOT running
4. shut down PDetectTest

5. right click on PDetect.inf, select "install"
6. start PDetectTest, notice application says driver is IS installed and NOT running

7. reboot system
8. start PDetectTest, notice application says driver is IS installed and running


To uninstall PDetect driver
open administrator command prompt
type :
SC stop PDetect40
SC delete PDetect40
Last edited by MLiss@Cetrus.com on Mon Apr 16, 2018 8:17 pm, edited 11 times in total.

MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Driver install fails when using .inf file

Mon Apr 16, 2018 5:38 pm

During the install (on two different windows 7 machines)... I get the following dialog:
PDetect.DriverInstallProblem.PNG
PDetect.DriverInstallProblem.PNG (32.1 KiB) Viewed 7074 times
Last edited by MLiss@Cetrus.com on Mon Apr 16, 2018 5:55 pm, edited 2 times in total.

MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Driver install fails when using .inf file

Mon Apr 16, 2018 5:42 pm

My PDetect.sys file is signed using an EV certificate (Extended Validation) from our company
and
it's been through MS driver certification and signed by MS:
PDetect.sys.signed.png
PDetect.sys.signed.png (14.74 KiB) Viewed 7073 times
The EV certificate IS valid:
PDetect.CertificateIsValid.PNG
PDetect.CertificateIsValid.PNG (30.99 KiB) Viewed 7073 times
The PDetect.cat file is signed:
PDetect.cat.signed.png
PDetect.cat.signed.png (18.83 KiB) Viewed 7073 times
Last edited by MLiss@Cetrus.com on Mon Apr 16, 2018 8:14 pm, edited 1 time in total.

MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Driver install fails when using .inf file

Mon Apr 16, 2018 5:55 pm

when I right click on the .inf file (after the install is done) and select "install",
the driver installs without issue and the driver starts when the system is rebooted.
Last edited by MLiss@Cetrus.com on Mon Apr 16, 2018 7:17 pm, edited 3 times in total.

MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Driver install fails when using .inf file

Mon Apr 16, 2018 6:43 pm

I checked an older post viewtopic.php?f=5&t=34303&start=15 about something similar and it indicated that for Windows 7 machines SHA256 driver signing is not supported unless KB3033929 and/or 3035131 have been installed:

BOTH KB articles have been installed on BOTH machines:
3033929_installed.PNG
3033929_installed.PNG (18.14 KiB) Viewed 7074 times
and
3035131_installed.PNG
3035131_installed.PNG (13.08 KiB) Viewed 7074 times
Last edited by MLiss@Cetrus.com on Mon Apr 16, 2018 7:00 pm, edited 5 times in total.

MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Driver install fails when using .inf file

Mon Apr 16, 2018 6:44 pm

After carefully re-reading the old issue...

I noticed that you could not get the driver to install on a Windows 7 box either:

"The only error I got was on a Win 7 x64 machine and was due to your driver files having a digital signature created with a SHA-256 certificate."

What I am wondering is if you had the security packs installed and are getting the same error as me ?

I know the security packs are installed on my machines... and the installer is still failing to install the driver.

Thanks
Mike

MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Driver install fails when using .inf file

Mon Apr 16, 2018 8:07 pm

Please let me know why I can't install a driver with a standard .inf file

Daniel
Posts: 8176
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Driver install fails when using .inf file

Wed Apr 18, 2018 2:12 pm

Hello Mike,

I've tested your driver installation and replicated the behavior. It seems that our Driver feature (which makes use of standard Windows Installer support for drivers install ) is not compatible with your kernel mode driver. What I discovered was that your driver is indeed installed but only partial: its binaries are installed but the driver service is not installed at all. I've tried troubleshooting this but unfortunately didn't find anything useful.

My assumption is that the standard Windows Installer support for drivers do not support drivers signed with a SHA256 certificate, thus the driver service fails to install due to an invalid signature. Probably this is why you get the "Windows can't verify the publisher of this driver software" error during installation.

However, as a workaround I was able to create two custom actions to install and uninstall the driver by simply calling the "InstallHinfSection" function of the "SETUPAPI.DLL". More exactly a call like this:

Code: Select all

RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 path-to-inf\infname.inf
to install the driver and like this to uninstall it:

Code: Select all

SETUPAPI.DLL,InstallHinfSection DefaultUninstall 132 path-to-inf\infname.inf
Have a look on "Using an INF File to Install a File System Filter Driver" and "Using an INF File to Uninstall a File System Filter Driver" articles.

I just deleted your driver definition from "Drivers" page and configured in "Custom Actions" page two custom actions like this:

1. one "Launch file" custom action with sequence configured as deferred and with no impersonation; the action is scheduled after "Install Execution Stage" -> "Add Resources" action group and configured as it follows:
  • File to launch: rundll32.exe
    Command Line: SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 [#driverInstall.inf]
this action will install the driver at install time and must be conditioned to execute only on install

2. one "Launch file" custom action with sequence configured as deferred and with no impersonation; the action is scheduled before "Install Execution Stage" -> "Remove Resources" action group and configured as it follows:
  • File to launch: rundll32.exe
    Command Line: SETUPAPI.DLL,InstallHinfSection DefaultUninstall 132 [#driverInstall.inf]
this action will uninstall the driver at uninstall time and must be conditioned to execute only on uninstall

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Driver install fails when using .inf file

Wed Apr 18, 2018 3:55 pm

It seems that our Driver feature (which makes use of standard Windows Installer support for drivers install ) is not compatible with your kernel mode driver.
Will you be providing an update that fixes this problem?

MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Driver install fails when using .inf file

Wed Apr 18, 2018 4:02 pm

I will modify my installer to see if the "Rundll32.exe" work around works

Thanks
Mike

MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Driver install fails when using .inf file

Wed Apr 18, 2018 4:19 pm

Here are my settings:
Driver_Uninstall_Present.PNG
Driver_Uninstall_Present.PNG (51.66 KiB) Viewed 7062 times
When I uninstall my program I get this:
Driver_Uninstall_Failed.png
Driver_Uninstall_Failed.png (5.79 KiB) Viewed 7062 times

Daniel
Posts: 8176
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Driver install fails when using .inf file

Thu Apr 19, 2018 2:10 pm

Hello Mike,
Will you be providing an update that fixes this problem?
To be honest, most likely not. Such an improvement will request a lot of work to implement and, and looking in the future and considering that nowadays Microsoft recommends that all drivers be installed through their Windows Updates channel, this kind of request is not a quite sustainable one for us. Thank you for your understanding.

In what regards your uninstall failure, I'm not so sure why this happens. Could you replicate the behavior using a modified version of the sample I've sent? If so, can you send me back a modified sample and a test case which replicates the behavior?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Driver install fails when using .inf file

Thu Apr 19, 2018 3:06 pm

Here is the project.

double click the MSI file:
Install it on a windows 7 machine.

double click the MSI file
click the "remove" button
install fail dialog comes up
Attachments
PDetectInstaller.zip
(888.98 KiB) Downloaded 207 times

Daniel
Posts: 8176
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Driver install fails when using .inf file

Mon Apr 23, 2018 1:29 pm

Hello Mike,

It seems this happened because you scheduled your driver stop and uninstall custom actions before the "Remove Resources" action group. Can you please move (drag and drop) the above actions before the "Remove Resources" action group and rebuild and test this again?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

MLiss@Cetrus.com
Posts: 366
Joined: Wed Dec 30, 2015 5:40 pm

Re: Driver install fails when using .inf file

Mon Apr 23, 2018 3:02 pm

I don't understand your post.

I downloaded the example I uploaded to you (in the post directly above your reply), opened it up and here is where the "driver_stop" and "driver_uninstall" are located???
Driver_actionPlacement.PNG
Driver_actionPlacement.PNG (22.07 KiB) Viewed 7031 times

Return to “Building Installers”