Discussion:
[WiX-users] Strange behavior of SetupAPI function : InstallHInfSection
kirannhegde
2015-01-12 06:38:19 UTC
Permalink
Here is a description of the problem:
-Environment is Win 7 SP1 Enterprise x64
-We are executing a MSI package which contains numerous INF files. These
INF
files are associated with drivers. To install the drivers , we make use of
the
API: InstallHInfSection.

The exact usage of InstallHInfSection is as follows:
InstallHinfSection( NULL, NULL, INFFile, 0 );

However, what is happening is that, each and every time this API is invoked
on a
driver INF file, i am presented with a message box with the text:
Installation
Failed.

I inspected the setupapi.app log file and did not find any errors.
Everything
seems to be fine.
The driver .sys file is successfully copied to
%windows%\system32\drivers.

To confirm is InstallHInfSection works as expected, i executed the
following
command from outside of the .msi package:
RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 128 <path to
driver
inf>
Strangely, the above command works without any error messages.

Do you have any pointers on what could be wrong? I am under tremendous
pressure
to provide an answer.

Any assistance would be very much appreciated.

Regards,
Kiran Hegde



--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Strange-behavior-of-SetupAPI-function-InstallHInfSection-tp7598825.html
Sent from the wix-users mailing list archive at Nabble.com.
Phill Hogland
2015-01-12 13:32:28 UTC
Permalink
I would also enable MSI extra debug logging and evaluate the msi logs,
typically in %temp%. My first guess, and it is only a guess (without
specific data from the log) is that on a x64 system, if the msi CA tried to
launch a 32 bit version of the api it would fail. But again this is only
one possible guess. If the call to the Setupapi.dll failed due to bitness,
I would not expect any entry in the setupapi.xxx.log, but you should see
info in a verbose msi log.

On Win7, I assume that you looked at both the setupapi.app.log and the
setupapi.dev.log (and not setupapi.log). I also assume that you enabled
full verbose setupapi logging prior to running the setup, as the default
logging often does not provide much information. For info see here
<http://msdn.microsoft.com/en-us/library/windows/hardware/ff550808%28v=vs.85%29.aspx>
.

I would use the Wix DifxAppExtension, and avoid using a CA to call
InstallHInfSection.
In a Component element, which includes the File Element for the INF file,
add the following (and adjust the parameters to your needs):
<difx:Driver AddRemovePrograms="no" PlugAndPlayPrompt="no" />






--
View this message in context: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Strange-behavior-of-SetupAPI-function-InstallHInfSection-tp7598825p7598828.html
Sent from the wix-users mailing list archive at Nabble.com.

Loading...