Link to home
Start Free TrialLog in
Avatar of DrDelphi
DrDelphi

asked on

installling an INF programatically?

Here's my situation. I have a third party driver which I need to install prior to my application. I
am trying to make this as user friendly as possible, meaning that I would like to eliminate any user
intervention for the driver install. How to I programatically simulate a right click/Install of the
INF file? Points for working example.

Thanks!!
Avatar of jkr
jkr
Flag of Germany image

ShellExecute ( NULL, "install", "c:\\path\\myfile.inf", NULL, NULL, SW_HIDE);
BTW, to elaborate: Check the entries in the registry under HKEY_CLASSES_ROOT\inffile\shell - all the keys represent valid actions for 'ShellExecute()' for an .inf file, and 'Install' is what you want :o)
Avatar of jhance
jhance

In the Windows Platform SDK docs, there is a step-by-step example titled:

Steps of an Installation Program

If you have the MSDN library, it's there.  Otherwise, see:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/setupapi/setupapiovr_02p9.asp
Avatar of DrDelphi

ASKER

jkr,
  No joy. I neglected to mention that ShellExecute was my first line of attack. It doesn't raise any exceptions, but it doesn't install either.


jhance,
  I have seen this, too. I am just not convinced that I should have to go through all of those steps to install this. And if so, I am not sure if I know what keys to use and which to ignore from the INF file.



Thanks!
I've done this and I can assure you that all these steps are needed for a proper installation via API calls.  It's not as complicated as it looks.
Jhance,

   You wouldn't happen to have a template that I could follow , would you?

Thanks!
I think I have one somewhere.  Let me see if I can dig it up.....
ASKER CERTIFIED SOLUTION
Avatar of ambience
ambience
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you right-click the INF file in the Windows Explorer, doesn't it present to option to Install?  Or if you double-click it, doesn't it run?

If it does, then just use ShellExecute("open"...)

-- Dan
ambience,
  I have been able to verify that what you say is in fact right...but it still keeps insisting on prompting for the file, despite the fact that the file has been copied into the Winnt\System32\Drivers folder. Have you seen anything similar and if so, do you know a workaround? I ned my users to be completely removed from ANY installation processes.

DanRollins,
  See my above comments re:ShellExecute. Thanks!!


>>See my above comments re:ShellExecute.
I Did see this:
>>I neglected to mention that ShellExecute was my first line of attack. It doesn't
>> raise any exceptions, but it doesn't install either.

You neglected to mention what parameters you used and what happened when you tried it.  And you did not answer my queries.  ShellExecute is the best method.  If it does not work, it will be most productive to figure out why it failed and then correct *that* problem.

-- Dan
>> but it still keeps insisting on prompting for the file

have you specified the complete path to the file, possibly you can try changing the current directory to that folder as a workaround.
Dear DrDelphi

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept

     "ambience"

comment(s) as an answer.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
Force accepted

** Mindphaser - Community Support Moderator **