Hello,
I want to install/uninstall a driver(only inf file), this inf file does not
support right-click to install in explorer, it can only be installed from
Control Panel/Add Remove hardware.
Can anyone tell me how to install/uninstall in VB.NET?
Regards
Steven
Herfried K. Wagner [MVP] - 01 Mar 2008 03:41 GMT
"yxq" <gayxq@163.net> schrieb:
> I want to install/uninstall a driver(only inf file), this inf file does
> not support right-click to install in explorer, it can only be installed
> from Control Panel/Add Remove hardware.
> Can anyone tell me how to install/uninstall in VB.NET?
P/invoke:
Using SetupAPI Functions
<URL:http://msdn2.microsoft.com/en-us/library/ms791318.aspx>

Signature
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
yxq - 01 Mar 2008 06:31 GMT
Thank you, could you please tell which function to install the inf file?
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at>
??????:elSId40eIHA.5996@TK2MSFTNGP04.phx.gbl...
> "yxq" <gayxq@163.net> schrieb:
>> I want to install/uninstall a driver(only inf file), this inf file does
[quoted text clipped - 6 lines]
> Using SetupAPI Functions
> <URL:http://msdn2.microsoft.com/en-us/library/ms791318.aspx>
Thorsten Doerfler - 01 Mar 2008 10:26 GMT
yxq schrieb:
> I want to install/uninstall a driver(only inf file), this inf file does not
> support right-click to install in explorer, it can only be installed from
> Control Panel/Add Remove hardware.
> Can anyone tell me how to install/uninstall in VB.NET?
Take a look at the Driver Package Installer:
Driver Package Installer (DPInst)
http://msdn2.microsoft.com/en-us/library/ms790308.aspx
You can configure it to run silently and check the results.
DPInst Command-Line Switches
http://msdn2.microsoft.com/en-us/library/ms790806.aspx
DPInst Return Code
http://msdn2.microsoft.com/en-us/library/ms791066.aspx
Thorsten Doerfler

Signature
Microsoft MVP Visual Basic
vb-hellfire visual basic faq | vb-hellfire - einfach anders
http://vb-faq.de/ | http://www.vb-hellfire.de/
yxq - 01 Mar 2008 11:10 GMT
Thank you, but i do not want to use DPInst, only want to use the API
function, can you tell which API use?
"Thorsten Doerfler" <t.doerfler_nospam@bdsw.de>
??????:fqbeg2.12o.1@news.bdsw.de...
> yxq schrieb:
>> I want to install/uninstall a driver(only inf file), this inf file does
[quoted text clipped - 17 lines]
>
> Thorsten Doerfler
Thorsten Doerfler - 01 Mar 2008 17:32 GMT
yxq schrieb:
> Thank you, but i do not want to use DPInst
What's wrong with it?
> only want to use the API
> function, can you tell which API use?
Herfried gave you the entry point in the MSDN for information about
what APIs to use. With one API it's not done. If you don't want to
read the documentation, it would be easier for you, you take a tool
what encapsulates the required functions for you. The simplest API to
use is DriverPackageInstall of the DIFxAPI:
Perform a Default DIFxAPI Installation
http://msdn2.microsoft.com/en-us/library/ms790275.aspx
Thorsten Doerfler

Signature
Microsoft MVP Visual Basic
vb-hellfire visual basic faq | vb-hellfire - einfach anders
http://vb-faq.de/ | http://www.vb-hellfire.de/