Creating .inf Files

Device information (INF) files provide information used by the Windows NT Workstation Setup program to install software that supports a given hardware device. INF files may also be created to permit scripted installations of applications.

Some Windows NT Workstation 4.0 .inf files use the same format as Windows 95 .inf files. Other .inf files use the format used in earlier versions of Windows NT Workstation. See the Windows 95 Resource Kit for a discussion of Windows 95-style INFs.

Using Windows 95-style .inf Files

You can use a Windows 95-style .inf file to install applications and other components into Windows NT. For complete details about the syntax and use of statements in Windows 95 INF files, see the Win32 Software Development Kit for Windows 95 and Windows NT.

The command line to invoke a Win95-style INF in Windows NT 4.0 is:


RUNDLL32 syssetup,SetupInfObjectInstallAction section 128 inf

where:

section

specifies the name of the section in the INF.

inf

specifies the name of the INF file. This should be specified as a relative path to avoid invoking Setup's default INF rules, which look for an unqualified filename in the system inf directory instead of the current directory. For example, specify ..\newtools.inf, not just newtools.inf.

For example if you want to install MyGame application into Windows NT, create a Mygame.inf file, such as the following, and place it in the $OEM$ directory.


  This inf is a sample win95 style INF
  mygame.inf
  installs a game program into Windows NT

[version]
signature="$Windows NT$"
ClassGUID={00000000-0000-0000-0000-000000000000}

Destination Directories for CopyFiles Sections

[DestinationDirs]
BaseCopyProgramFiles            = 24,%INSTALL_DIR%
MygameDeleteFiles                    = 24,%INSTALL_DIR%
MygameCopyFilesHelp            = 18 LDID_HELP

[BaseWinOptions]
BaseSection

[Optional Components]
Mygame

[BaseSection]
AddReg                  = BaseAddReg

[Mygame]
OptionDesc              = %MYGAME_Desc%
Tip                     = %MYGAME_TIP%
IconIndex               = 64            Windows mini-icon for dialogs
Parent                  = Games
InstallType             = 0             Manual only.
CopyFiles               = BaseCopyProgramFiles, MygameCopyFilesHelp
AddReg                  = MYGAME.AddReg
UpdateInis              = MYGAME.Inis
Uninstall               = MYGAME.Remove
Upgrade                 = MYGAME.Upgrade
Detect                  = %24%\%INSTALL_DIR%\mygame.exe

[MYGAME.Remove]
AddReg                  = MYGAME.DelReg
DelReg            = MYGAME.DelPath
DelFiles                = BaseCopyProgramFiles, MygameCopyFilesHelp, MygameDeleteFiles
UpdateInis              = MYGAME.Rem.Inis
Reboot=0

[MYGAME.Upgrade]
CopyFiles               = BaseCopyProgramFiles, MygameCopyFilesHelp
DelFiles                = MygameDeleteFiles
AddReg                  = MYGAME.AddReg

[MYGAME.Inis]
setup.ini, progman.groups,, "group15=%GAMES_DESC%"         creates folder
setup.ini, group15,, """%MYGAME_Desc%"",""""""%24%\%INSTALL_DIR%\mygame.exe"""""",,,,""%24%\%
INSTALL_DIR%""" [MYGAME.Rem.Inis] setup.ini, progman.groups,, "group15=%GAMES_DESC%"
folder setup.ini, group15,, """%MYGAME_Desc%"""
deletes link [MYGAME.AddReg] HKLM,%KEY_OPTIONAL%\Mygame,Installed,,"1" HKLM,"%KEY_APP_PATH%\mygame.exe",,,"%24%\%INSTALL_DIR%\mygame.exe" [MYGAME.DelPath] HKLM,"%KEY_APP_PATH%\mygame.exe" [MYGAME.DelReg] HKLM,%KEY_OPTIONAL%\Mygame,Installed,,"0" [BaseAddReg] Create entries for Maint Mode Setup, set all initially to uninstalled: HKLM,%KEY_OPTIONAL%,"Mygame",,"Mygame" HKLM,%KEY_OPTIONAL%\Mygame,INF,,"mygame.inf" HKLM,%KEY_OPTIONAL%\Mygame,Section,,"Mygame" HKLM,%KEY_OPTIONAL%\Mygame,Installed,,"0" [BaseCopyProgramFiles] FONT.DAT MYGAME.DAT MYGAME.EXE MYGAME.MID MYGAME2.MID SOUND1.WAV SOUND2.WAV SOUND3.WAV table.bmp wavemix.inf [MygameDeleteFiles] mygame.cnt mygame.hlp mygame.inf [MygameCopyFilesHelp] mygame.cnt mygame.hlp [Strings] KEY_APP_PATH = "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths" KEY_OPTIONAL = "SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\OptionalComponents" GAMES_DESC = "Accessories\Games" MYGAME_Desc = "Mygame" MYGAME_TIP = "Company X 3-D mygame game" INSTALL_DIR = "Program Files\Windows NT\Mygame"

To install MyGame, you would include the following command line in the $OEM$\Cmdlines.txt file on your distribution sharepoint.


"RUNDLL32 syssetup,SetupInfObjectInstallAction Version 128 ..\mygame.inf"

Note

All the files needed for this application should be placed in the distribution share point.