HOWTO: Install Networking Components Programmatically

ID: Q169580


The information in this article applies to:


SUMMARY

Many cutting-edge software products require Internet or network access. Therefore, installation applications need to verify that critical networking components are installed, and possibly initiate installation of these components when necessary. Programmatic detection and installation of networking components can be accomplished using a 16-bit protected mode Setup API on Windows 95. This API is documented in DevInst.Doc in the Win95 DDK.


MORE INFORMATION

DevInst.doc, from the Windows 95 DDK, documents the Setup API itself and the parameters for each API call without illuminating any of the implementation details for installing a device. You can download a sample MFC application from the Microsoft Software Library or from the Microsoft OEM/IHV DDK home page at:

http://support.microsoft.com/support/ddk_hardware/winddk/samples/
Follow the links to the WinDDK Samples page. The sample is a MSVC 1.52 MFC application. You should not try to install PCMCIA or PCI devices with this application. These devices are installed when they are inserted for the first time or during boot time. The sample makes use of DiCreateDevRegKey:

   RETERR DiCreateDevRegKey( LPDEVICEINFO lpdi,
                             LPHKEY       lphKey,
                             HINF         hInf,
                             LPCSTR       lpszInfSection,
                             int          iFlags ) 

Create a unique registry key under the class of the associated device.

It returns OK if it has been successful; otherwise, an ERR_DI_xxx error code will be returned. If the return is OK, the lphKey will point to a valid handle to the created key. It is the caller's responsibility to close the returned registry key.

lpdi

lphKey

hInf

lpcInfSection

iFlags

The sample will accept several command line arguments:

Ipinst [-a[idstring]] [-<h|?>] [-f<logfile>] [-m[d|idstring]] [- p<COM1|COM2>] [-r] [-s] [-v]

-a[PnP ID String]

Install adapter. A PnP ID String can be specified. If no adapter is specified or detected, the user must select one.

-f<log file name>

Specify a log file. If the log file name is NULL, then the default is Ipdetect.txt.

-<h|?>

Display usage information.

-m[d|Modem PnP String|Unimodem ID String]

Install modem. A PnP ID or Unimodem String can be specified. If no modem is specified or detected, the Modem Wizard is invoked.

-p<COM1|COM2>

Attach modem to COM1 or COM2. The default is COM1. This is to be used with the 'm' option to attach the installed modem to the specified port. This is mainly for legacy modems with valid Unimodem ID's.

-r

Install remote networking. This includes RNA, Dial Up Adapter, and related RAS components.

-s

Show application. By default, the application runs hidden. The application will show up on the desktop only if the 's', 'h' or '?' options are used.

-v

Emit verbose messages to logfile. The contents of the logfile show up on the document client area when the application is visible.


REFERENCES

DDpr.Hlp, DevInst.Doc, Network.Doc


Keywords          : kbnetwork kbsetup kbAPI kbRAS kbSDKPlatform kbGrpNet 
Version           : 4.0
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: March 5, 1999