Microsoft KB Archive/155099

= INFO: Creating Network Component .inf File for Unattended Setup =

Article ID: 155099

Article Last Modified on 1/19/2007

-

APPLIES TO


 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Professional Edition
 * Microsoft Windows NT Server 3.51
 * Microsoft Windows NT Workstation 4.0 Developer Edition

-



This article was previously published under Q155099





SUMMARY
For a network component (adapters, services, or protocols) to be installed using the Unattended Setup mechanism, its Oemnxxxx.inf file must check certain INF symbols and react accordingly. These symbols (STF_UNATTENDED, STF_GUI_UNATTENDED, and STF_UNATTENDED_SECTION) inform Windows NT Setup whether the installation is being run in unattended mode or not. In order to perform these modifications, you must be familiar with the Windows NT- style INF formats.



MORE INFORMATION
To find out which mode Setup is running in, your .inf file must contain code similar to the following code: ifstr(I) $(!STF_GUI_UNATTENDED) == "YES" ifstr(I) $(!AutoNetInterfaceType) != "" set BusInterfaceType = $(!AutoNetInterfaceType) else set BusInterfaceType = 1 endif ifstr(I) $(!AutoNetBusNumber) != "" set BusNumber = $(!AutoNetBusNumber) else set BusNumber = 0 endif goto adapterverify endif If Setup is running in Unattended mode, you must skip the commands that open the user interface (UI), dialog boxes, and so on. These commands are usually of the form: read-syms FileDependentDlg$(!STF_LANGUAGE) ui start "InputDlg" Once the network component .inf file has verified that Setup is running in Unattended mode, it can use the STF_UATTENDED symbol to get the unattended file name. The STF_UATTENDED_SECTION symbol will be set by Setup so the .inf file code can read it as needed.

Setting Parameters for Network Adapter Cards
If the component is an adapter card, the .inf file will have to pass the parameter section for the card through the AddDefaultNetCardParameters in the Utility.inf file that is included with Windows NT. To do this, the following key will be specified: ifstr(I) $(!STF_GUI_UNATTENDED) == "YES" Shell $(Utililty.Inf), AddDefaultNetCardParameters, $(KeyParams) endif This causes the parameters listed in the Unattend.txt file to be written to the registry. Note that this code must be implemented after the default network adapter parameters have been written to the registry. See the Oemnade2.inf file included in Windows NT 4.0

Setting Parameters for Network Protocols or Services
.inf files for network protocols or services normally do most of their configuration from UI configuration DLLs. The following sample is an example of an .inf file code fragment from a network protocol .inf file. This code fragment handles most of the work that will otherwise be done by the .inf file code. LoadLibrary "x" $(!STF_CWDDIR)\mycfg.dll CFG_HANDLE LibraryProcedure ResultList, $(CFG_HANDLE), Properties, $(!STF_HWND), $(!STF_GUI_UNATTENDED), $(!STF_UNATTENDED), $(!STF_UNATTENDED_SECTION) FreeLibrary $(CFG_HANDLE) This causes the component DLL (Mycfg.dll in this case) to call the Setup APIs from the Config.dll file to perform any necessary operations. See the Oemnsvra.inf and Oemnxptc.inf files for examples of .inf files that install services and protocols.

Verifying and Testing Component .inf Files
Network Adapters:  Install the network card in Windows NT in attended mode. Check the parameters installed in the registry under

HKLM\System\CurrentControlSet\Sevices\\Parameters

where x is an instance of the card. It is usually 1. Note the values of the parameters listed. If the parameter values are not of the type REG_DWORD, the driver for the adapter must be modified to generate REG_DWORD values. Note that the NetworkAddress parameter is of the type REG_SZ. Install the network adapter in unattended mode using the .inf file you created. Check the registry again to verify that the parameters were installed correctly.</li></ol>

Additional query words: 4.00 Unattended Setup

Keywords: kbenv kbfaq kbinfo kbnetwork kbsbk kbsetup KB155099

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.