Automatic installation of driver with Setupapi.dll under WIN2K,XP
In the drive net see 54cndr write this article, although oneself has been used InstallShield, but still think this is also a very good idea, so excerpt here.
Installing driver with Setupapi.dll
Applicable OS:WIN2K,WINXP
Installshiled Code:
Szprogram = "Rundll32.exe";
szCmdLine = "Setupapi.dll,installhinfsection DefaultInstall" + supportdir + "Netsf.inf";
Launchappandwait (Szprogram, szCmdLine, WAIT);
Attention:
1. Where defaultinstll refers to the installation section in the INF file and must be replaced with the Install section name in its own INF, for example, if the section name is Usbcamera.dev, the code should be changed to:
szCmdLine = "Setupapi.dll,installhinfsection Usbcamera.dev" + supportdir + "Netsf.inf";
2. Supportdir refers to the path of all driver files such as INF and sys. You need to copy all driver files to your hard disk, such as your files in C:yourdriver,
The Supportdir is replaced with "c:////yourdriver////" in the program. ------------------------------------------------------------------------------------------------------you to command first. DOS command in the environment under the command to debug the success of the program before writing it. This is easy to eliminate errors, note the driver directory and spaces. You can also check the usage of rundll32.exe.
For debugging commands, refer to:
rundll32.exe setupapi.dll,installhinfsection Modem2.nt C://yourdriver//netsf.inf
http://blog.csdn.net/jiangxinyu/article/details/4465445
Automatic installation of driver with Setupapi.dll under WIN2K,XP