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