martin.jansa
Posts: 3
Joined: Mon Oct 07, 2019 1:06 pm

How to install a WFP driver?

Hi,

Does the Advanced Installer support the installtion of the WFP (network filter) drivers? If so, what is the recommended procedure to do so? I am attaching the Microsoft signed version of the driver with .inf, .cat and .sys we are trying to integrate and the configuration in the AI GUI.

The expected output is, that the driver is installed into the Windows\System32\Driver and a service is created.

The real output was that the driver sodatpnf.sys was not installed into Windows\System32\Driver and the service was not created. When I install the driver manually using INF file, it is correctly installed and registered.

Thank you,

Martin
Attachments
Signed_driver_package.zip
(92.52 KiB) Downloaded 240 times
AI_driver_configuration_screen.png
AI_driver_configuration_screen.png (87.67 KiB) Viewed 8179 times
AI_driver_components.png
AI_driver_components.png (27.93 KiB) Viewed 8179 times
Catalin
Posts: 6585
Joined: Wed Jun 13, 2018 7:49 am

Re: How to install a WFP driver?

Hello Martin and welcome to Advanced Installer forums,

Thanks for the provided files.

I have tested this and I could notice that the driver entry for "sodatpnf.inf" is "C:\Windows\System32\DriverStore\FileRepository\sodatpnf.inf_amd64_583c3325586941fc\sodatpnf.inf". Could you please check this folder and let me know if the entry exists in the above folder? The entries are handled by Microsoft Driver Installation Frameworks (DIFx tool).

Additionally, since you did not mention the service name that should be installed, I have further investigated this to see if any service was installed. Is, by any chance, the display name of your service "Background Intelligent Transfer Service"? If so, it seems that it was correctly installed on my machine.

In order for me to further investigate this, could you please create a sample project which replicates this issue and forward it to me (the sample project should contain only the driver, so I can build it on my machine)?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
martin.jansa
Posts: 3
Joined: Mon Oct 07, 2019 1:06 pm

Re: How to install a WFP driver?

Hi Catalin,

thank you for a prompt response. I am attaching a sample project that contains the driver.

I admit, I am not very sure, what in particluar the "C:\Windows\System32\DriverStore\FileRepository\sodatpnf.inf_amd64_583c3325586941fc\sodatpnf.inf" means. On my testing computer I found this folder c:\Windows\System32\DriverStore\FileRepository\sodatpnf.inf_amd64_e77030add58b21c9, but I don't know, why it has a different name.

Thank you,

Martin
Attachments
WFPdriverSample.zip
(618.87 KiB) Downloaded 262 times
Catalin
Posts: 6585
Joined: Wed Jun 13, 2018 7:49 am

Re: How to install a WFP driver?

Hello Martin,

Thank you for the sent project.

I have tested this and indeed, the driver destination folder is the one you mentioned: "c:\Windows\System32\DriverStore\FileRepository\sodatpnf.inf_amd64_e77030add58b21c9"

However, I was not able to spot the service that you were talking about. Could you please give me more details about this? I manually installed the driver and I checked the number of services on my machine, using the following PowerShell cmdlet:

Code: Select all

(get-service).count
and the number is the same before and after the driver installation. Are you sure a service is created when you manually install the driver?

Looking forward to hearing from you.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 6585
Joined: Wed Jun 13, 2018 7:49 am

Re: How to install a WFP driver?

Hello Martin,

I have further investigated this and I have noticed the following thing (in what regards the fact that installing the driver manually redirects it into the %windir%\System32\drivers location and installing it with Advanced Installer redirects it into the "%windir%\System32\DriverStore\FileRepository" folder):

- upon installing a driver, Advanced Installer uses the Driver Installation Frameworks tool (DIFx), which seem to redirect the files in the %windir%\System32\DriverStore\FileRepository folder.

- however, upon installing the driver manually (right click on the .inf file and click Instal) or through a command line, the "InstallHinfSection" function of the "SETUPAPI.DLL" is used. For instance, the same results as right clicking + "Install" can be obtained by using a command line as it follows:

RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 path-to-inf\infname.inf

The RUNDLL32.EXE is used to load and run 32-bit dynamic-link libraries (DLLs).

With that being said, if it is imperative that your driver redirects to the %windir%\System32\drivers folder, you can use a custom action to register and install it (instead of using our predefined support - e.g. "Drivers" page). To do so, you can proceed as it follows:

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 [#sodatpnf.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 [#sodatpnf.inf]


this action will uninstall the driver at uninstall time and must be conditioned to execute only on uninstall

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
martin.jansa
Posts: 3
Joined: Mon Oct 07, 2019 1:06 pm

Re: How to install a WFP driver?

Hi Catalin,

thank you for your responses, meanwhile I have gone through that and tryied to play with running the rundll32.exe SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 and also the same thing using the SetupAPI functions InstallHinfSectionW() and InstallHinfSection(), but the problem with these is that none of them returns an error code for the operation result, which for me is a blocker as I don't want to implement something that just seemingly works, but does not log about it.

For your information I've ended up with having a CA for the installation using the CreateService API, which registers the kernel driver service which is then started and other CA for the stopping and uninstallation of the service. That so far seems to be working fine, but it is a lot of manual effort comparing to the installation of the Windows Minifilter driver for example, where the INF is just working fine with the advanced installer.

Thank you,

Martin
Catalin
Posts: 6585
Joined: Wed Jun 13, 2018 7:49 am

Re: How to install a WFP driver?

Hello Martin,

Thank you for your followup on this and for sharing your solution with us. I am sure this might come in handy for further users facing a similar scenario.

Indeed, you are right, this requires some manual work. I apologize our built-in support for installing drivers wasn't of much help in this scenario. It seems that the DIFx tool (the one that we use in order to install drivers) is acting differently depending on what kind of driver you are trying to install. Unfortunately, I can not say why that happens.

Please let me know if there is anything else I could help you with and I will gladly assist.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”