Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 648
  • Last Modified:

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!!
0
DrDelphi
Asked:
DrDelphi
  • 3
  • 3
  • 2
  • +4
1 Solution
 
jkrCommented:
ShellExecute ( NULL, "install", "c:\\path\\myfile.inf", NULL, NULL, SW_HIDE);
0
 
jkrCommented:
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)
0
 
jhanceCommented:
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
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
DrDelphiAuthor Commented:
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!
0
 
jhanceCommented:
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.
0
 
DrDelphiAuthor Commented:
Jhance,

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

Thanks!
0
 
jhanceCommented:
I think I have one somewhere.  Let me see if I can dig it up.....
0
 
ambienceCommented:
rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 %1

this is the call that rundll makes, maybe you can go directly to setupapi.dll or try using the same as a command-line invokatoin.  I suppose passing 128 instead of 132 is for un-attended installs.
0
 
DanRollinsCommented:
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
0
 
DrDelphiAuthor Commented:
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!!


0
 
DanRollinsCommented:
>>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
0
 
ambienceCommented:
>> 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.
0
 
griesshCommented:
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
0
 
MindphaserCommented:
Force accepted

** Mindphaser - Community Support Moderator **
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
  • 2
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now