Automated Installs of Windows98
with INF Files
|
|
One of the new capabilities of Windows9x is its ability to install
many of it's options and configurations automatically.
This is accomplished through the use of INF files. These can
be created beforehand and used during an installation.
If you are installing many computers with basically the same
configuration, it is much easier to use these pre-defined INF files.
All the Windows95 applications, network settings, printers etc. can
be defined ahead of time and installed with little user intervention. |
If you are doing a large amount on installations over a network, I
recommend you use the NETSETUP utility that is the \ADMIN\NETTOOLS\NETSETUP
directory on the CD.
This expands all the files to approximately 130 megs on to a network
server. You can then keep these files up to date as well as have the
most flexibility when modifying INF files. |
There are three basic programs you can use to create INF files.
|
1.
|
The main program available to create INF files is BATCH.EXE .
Version 1 can be found on the CD in the \ADMIN\NETTOOLS\NETSETUP (for
the original Win95) or in the \ADMIN\NETTOOLS\BSETUP directory
for OEM SR2.
Version
2.0 is available from Microsoft's Web Site.
With it you can configure things such as printers, network protocols,
Windows95 applications, time zone etc. |
2.
|
The second program you can use to create INF files is INFINST ,
also in the \ADMIN\NETTOOLS\NETSETUP directory.
This will allow you to use existing INF files, such as OEMSETUP.INF,
and add their information to your MSBATCH.INF.
For example, this will allow you to add additional programs or
protocols to your installation automatically. |
3.
|
The third program is INF Gen , available from Microsoft.
This allows you to further customize things such as removing the
INBOX, MSN icon, adding remote Registry, installing Chat etc. |
The basic syntax for using a particular INF file is:
SETUP INF_FILENAME
If you use the default of MSBATCH.INF , you do not need to
enter any name after SETUP. |
The following instructions will show how to create and use basic INF
files.
I won't be going through all the options, but enough to get you well on
your way.
|
Creating INF files using BATCH.EXE
|
| 1. |
The main program available to create INF files is BATCH.EXE
The following screen shots are from Version 2. |
 |
| 2. |
Here you can enter the Computer, Workgroup,
Description etc. |
| 3. |
Clicking on Network options brings up the
following screen.
From here you can enter the protocols, TCP/IP settings, file and print
sharing, network clients etc. |
 |
| 4. |
Click on Installation Options brings up the
following screen.
From here you can select basic install options, time zone, automatically
add printers, when to stop for a response, screen resolution and color
depth etc. |
 |
| 5. |
Clicking on Optional Components brings up the
following screen.
From here you can set what Windows apps you want to load such as Defrag,
Dial-Up networking, etc. |
 |
| 6. |
When you are finished with all the settings, select File
/ Save |
| 7. |
To use your new INF file for an installation, type SETUP
INF_FILE |
A great program for creating INF files can also be downloaded
from:
INF-Tool (294 K)
SETUP Switches
|
There are several
switches available to use along with SETUP.
Some are undocumented. |
| filename |
Runs the particular INF file |
| /ID |
Ignores the DIsk Space check |
| /IS |
Ignores the routine System check |
| /IQ |
Skips the test for cross-linked files |
| /IM |
Skips the memory check |
| /IN |
Runs setup without the Network Setup Module |
| /IW |
Bypasses needing to read the License screen.
Needs to be upper case when run within Windows
Undocumented. |
| /IR |
By passes the checkin into the system CMOS. Useful
for some combinations of motherboard and Award BIOS ver 4.50 P
Undocumented |
| /D |
If you do not want Setup to use your existing
Windows configuration (such as your current Win.ini and System.ini
files), use this switch.
Undocumented |
| /N |
Allows setup to run without a mouse
Undocumented |
| /IE |
Does not create the Emergency Boot Disk (Windows98
Only) |
| /IH |
Skips the Registry Check (Windows98 Only) |
| /IV |
Does not display the billboards during setup
(Windows98 Only) |
| /NTLDR |
Eliminates check for a previous Operating System |
| /P |
Detection Switch Option String - Using a /P allows
you to use an additional switch for viewing and setting some detection
parameters. You can separate them with a semicolon (;). For example /P
g=3;i;p .
- g=0 to 3 - This switch controls how verbose the
built-in progress bar is. At maximum level (3), it shows all the
resources of the detected devices along with the progress bar. This
switch can help to identify which detection module causes a certain
problem. The default is 0.
- b - This switch enables Prompt Before mode. It
prompts you before a detection module is called so that you can step
through each detection module manually and decide if you want to
skip it. The default is disabled.
- i - This switch tells Setup not to report the
existence of a Plug and Play BIOS. It is useful on systems that have
a Plug and Play BIOS that is not reported in Machine.inf.
- p - This switch enables performance logging. It
writes performance timing information to the DETLOG.TXT file.The
default is disabled.
- f - This switch enables
Clean Registry mode. It forces Detection to clean the root branch of
the registry before starting. This switch is ignored when Setup is
run in the Windows 95 graphical user interface (GUI). The default is
disabled.
|
Additional Installation Configuration Options
|
You can add these lines to your setup MSBATCH.INF file
|
| No Network Neighborhood |
This allows you to not show the Network Neighborhood
without using System Policies
[Install]
Addreg=system.config
[system.config]
HKCU,Software\Microsoft\Windows\Current Version\Policies\Explorer,"NoNetHood",3,00000001 |
| Remove Find from Start Menu |
This allows you to Remove the Find command without
using System Policies
[Install]
Addreg=system.config
[system.config]
HKCU,Software\Microsoft\Windows\Current Version\Policies\Explorer,"NoFind",3,00000001 |
| Hide Drives in My Computer |
This allows you to hide the drive when you double
click on My Computer without using System Policies
[Install]
Addreg=system.config
[system.config]
HKCU,Software\Microsoft\Windows\Current Version\Policies\Explorer,"NoDrives",3,3ffffff |
| No Items on the Desktop |
This allows you hide all the icons on the desktop
without using System Policies
[Install]
Addreg=system.config
[system.config]
HKCU,Software\Microsoft\Windows\Current Version\Policies\Explorer,"NoDesktop",3,00000001 |
| Enabling User Profiles |
[Install]
Addreg=system.config
[system.config]
HKLM,Network\Logon,"UserProfiles",2,1 |
| Enabling System Policies - Manual
Update from Server |
[Install]
Addreg=system.config
[system.config]
te,"NetworkPath",,"\\server_name\share_name\policy_name.pol"
HKLM,System\CurrentControlSet\control\Update,"UpdateMode",1,2,0,0,0 |
| Setting Minimum Password Length |
[Install]
Addreg=system.config
[system.config]
HKLM\Microsoft\Windows\CurrentVersion\Policies\Network,"MinPwdLen",1,6,0,0,0
The above example sets it to 6 characters |
| Disable Print Sharing |
[Install]
Addreg=system.config
[system.config]
Microsoft\Windows\CurrentVersion\Policies\Network,"NoPrintSharing",2,1 |
| Disable File Sharing |
[Install]
Addreg=system.config
[system.config]
\Microsoft\Windows\CurrentVersion\Policies\Network,"NoFileSharing",2,1 |
| Disable Dial-In Server - For secure
environments |
[Install]
Addreg=system.config
[system.config]
Microsoft\Windows\CurrentVersion\Policies\Network,"NoDialIn",1,1,0,0,0 |
| No MSN Inbox |
[Install]
UpdateINIs= msn.remove
[msn.remove]
setup.ini,desktop,,%Setup_MSN_DESC%,MSNEXCH.EXE %Setup_MSN_DESC%
[strings]
Setup_MSN_DESC="Set Up The Microsoft Network" |
| No Exchange IN box |
[Install]
DelReg=NoInbox_Icon
[NoInbox_Icon]
on\explorer\Desktop\NameSpace\"{00020D76-0000-0000-C000-000000000046}" |
| No Welcome Screen |
[Install]
Addreg=remove.welcome
[remove.welcome]
HKU,.default\software\microsoft\windows\currentversion\explorer\tips,show,1,00 |
| Configure for Multi-Boot |
[Install]
UpdateINIs=Multi.Boot
[Multi.Boot]
msdos.sys,Options,,"BootMulti=1" |
| Running a program once,
automatically, after Windows95 is Installed |
[Install]
Addreg=system.config
[system.config]
HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce,"Program To
Run Once",," Your Program "
You can have multiples of these so you can automatically install
other software at then end of your Windows95 installation.
Occassionaly with many Run Once commands, some can be executing at the
same time.
To get around this problem, have the Run Once point to a batch file.
This batch file can have all the applications you want to install
but run with a start command. The syntax would be something like:
start /w program1.exe
start /w program2.exe
....
The /w causes the programs to wait before the next one is started.
Also, keep the ones that need a reboot towards the end. |
Running a program automatically after
Windows95 is Installed.
This is a great way to hide it from the user. |
[Install]
Addreg=system.config
[system.config]
HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Run,"Program to Run
Every Time",," Your Program " |
| Automatically modifying your
AUTOEXEC.BAT file |
[Install]
UpdateAutoBat=autobat
[autobat]
CmdAdd=command-name[,command-parameters]
CmdDelete=command-name
For example:
CmdAdd=set, "Variable=Value"
CmdAdd=doskey, /insert
CmdDelete= old_program |
| Automatically modifying your
CONFIG.SYS file |
[Install]
UpdateCfgSys=configsys
[configsys]
DevAddDev=driver-name,configkeyword[,flag][,param-string]
DevDelete=driver-name
For example:
DevAddDev=emm386.exe,device,,NOEMS
DevDelete=qem386.exe
|
| Disabling
the Right-Click on the Start Button |
Normally, when you right button click on the Start
button, it allows you to open your programs folder, the Explorer and
run Find.
In situations where you don't want to allow users to be able to do this
in order to secure your computer.
[Install]
DelReg=disablestartbutton
[disablestartbutton]
HKCR,Directory/Shell/Find
HKCR,Folder/Shell/Explore
HKCR,Folder/Shell/Open
Note: - Disabling these also turns off the ability to get to
them with the Microsoft keyboard shortcut keys of Window-E (for
Explorer) or Window-F (for Find)
To see how to make the registry changes on existing computers, see the Registry
Tips section. |
| Disabling Opening My Computer |
In areas where you
are trying to restrict what users can do on the comptuer, it might be
beneficial to disable the abiltiy to click on My Computer and have
access to the drives, control panel etc.
[Install]
DelReg=disablemycomputer
[disablemycomputer]
HKCR,CLSID\"{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
To see how to make the registry changes on existing computers, see
the Registry
section. |
Having the Recycle Bin set to delete
files automatically
Use this in conjunction with having Documents on the Start Menu set to
be in the Recycle Bin |
[Install]
Addreg=autodel
[autodel]
TWARE\Microsoft\Windows\CurrentVersion\explorer\BitBucket,"PurgeInfo",
0,00,01,00,00,00,0a,00,0a,00,0a,00,0a,00,0a,00,0a,00,0a,00,0a,00,0a,00,0a,00,0a,
00,0a,00,0a,00,0a,00,0a,00,0a,00,0a,00,0a,00,0a,00,0a,00,00,00,00,08,64,7c,01,00 |
| Changing Client for Microsoft
Networking to "Logon and Restore Network Connections" |
[install]
Addreg=No.Quick.Logon
[No.Quick.Logon]
urrentControlSet\Services\MSNP32\NetworkProvider,LogonDisconnected,1,00,00,00,00
Submitted by J
P Morgan |
NOTE: When calling multiple
sections, you need to have them all on the same line, separated by
commas.
For example: Addreg=system.control, remove.welcome in the above
examples. |
Copying Additional Files during the Installation
|
While installing Windows95, you have the ability to copy in
additional files.
These can be copied to any directory you choose.
A sample will be given at the end of this section.
|
There are five basic steps you need to
go through when editing the MSBATCH.INF.
1. Letting the installation know you want to copy additional files.
2. Specifying what files to copy.
3. Specifying the destination for the files.
4. Specifying the source disk number for the files.
5. Specifying the source location for the files.
|
| 1. |
In the [Install] section, add Copyfiles=file-list-section
The file-list-section should reference the one in #2.
The format is:
[Install]
Copyfiles=file-list-section |
| 2. |
Create a [file-list-section] using the same name you
did in step #1. This is simply a list of all the files you want to copy,
one file per line.
The format is:
[file-list-section]
file1
file2
file3... |
| 3. |
The next step is to define where you want the files
to be copied. You need to create or add to the [DestinationDirs]
section.
The format is:
[DestinationDirs]
file-selection-list, ldid[,subdir]
where ldid is the Local Disk Identifier
The ldid is a number which references a particular directory on your
hard drive.
Common ones would be:
10 - Windows Directory
11 - System Directory
13 - Command Directory
30 - Root of Boot Drive
A full listing is given on page 1167 in the Windows95 Resource Kit.
A feature is the ability to copy to any directory of your choice, as
long as it is created before you start the installation.
For the destination directory's location, select 30,new_directory .
This will copy the files to a directory below the root of the boot
drive. |
| 4. |
The next step is to specify a Source Disk Name. This
is simply in preparation for the next step.
The format is:
[SourceDisksNames]
disk-number= description,label,serial-number
The disk-number must match the one in #5 |
| 5. |
The last step is to identify each of the source disk
files and location. These can be from a current windows directory or a
new one you created.
The format is:
[SourceDisksFiles]
filename=source-disk-names,subdirectory,filesize
For example, if you have a new directory under your current source
called MYFILES , you would use: [SourceDisksFiles]
filename=22,myfiles,size
|
| The following example would copy the
files listed under [MyFiles] to the Windows directory and the files
listed under [NewFiles] to a C:\TEST directory.
The files for MyFiles would be in a MyFiles directory below
the main Windows95 source files. The files for NewFiles would be in a
directory NewFiles directory below the main Windows95 source
files.
The file sizes of 1024, 2048 and 3096 are just for examples. [Install]
Copyfiles=MyFiles,NewFiles
[MyFiles]
MyFile_1
MyFile_2
MyFile_3
[NewFiles]
NewFile_1
NewFile_2
[DestinationDirs]
MyFiles=10
NewFiles=30,test
[SourceDisksNames]
33,"MyFilesSource",MyFiles,0
44,"MyNewFilesSource",NewFile,0
[SourceDisksFiles]
MyFile_1=33,,1024
MyFile_2=33,,2048
MyFile_3=33,,3096
NewFile_1=44,,1024
NewFile_2=44,,2048 |
The following is a sample INF file which:
- Installs an IP protocol stack with Client for Microsoft Network
- Removes the MSN and Inbox
- Sets up for:
- Minimum Password length of 6
- No Dial-In Server
- No File or Print sharing
- User Profiles
- Installs an LPT1.DOS port
- Adds the line BOOTMULTI=1 to the MSDOS.SYS config file for booting to your
previous DOS version
- Installs a QMS-810 Printer and assigns it to LPT1
- Installs a HP LaserJet III Printer and assigns it to LPT2
- Installs a pre-selected list of applications
-
[Install]
UpdateINIs=msn.remove, Multi.Boot, WIN.INI
DelReg=NoInbox_Icon
Addreg=remove.welcome,config.system
[WIN.INI]
win.ini,ports,,"lpt1.dos="
[strings]
Setup_MSN_DESC = "Set Up The Microsoft Network"
[msn.remove]
setup.ini,desktop,,%Setup_MSN_DESC%,MSNEXCH.EXE %Setup_MSN_DESC%
[NoInbox_Icon]
HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\Desktop\NameSpace\"{00020D76-0000-0000-C000-000000000046}"
[Multi.Boot]
msdos.sys,Options,,"BootMulti=1"
[remove.welcome]
HKU,.default\software\microsoft\windows\currentversion\explorer\tips,show,1,00
[config.system]
HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Network,"MinPwdLen",1,6,0,0,0
HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Network,"NoDialIn",1,1,0,0,0
HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Network,"NoFileSharing",2,1
HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Network,"NoPrintSharing",2,1
HKLM,Network\Logon,"UserProfiles",2,1
[BatchSetup]
Version=1.0
SaveDate=11/06/95
[Setup]
Express=1
EBD=0
ChangeDir=0
OptionalComponents=1
Network=1
System=0
CCP=0
CleanBoot=0
Display=0
PenWinWarning=0
InstallType=3
DevicePath=1
TimeZone="Pacific"
VRC=0
Uninstall=0
InstallDir=C:\windows
[System]
DisplChar=4,640,480
[NameAndOrg]
Name=""
Org=""
Display=0
[Network]
ComputerName=""
Workgroup=""
Description=""
Display=0
Clients=VREDIR
Protocols=MSTCP
Services=VSERVER
IgnoreDetectedNetCards=0
;Security=share
[NWLINK]
FrameType=4
NetBIOS=0
[MSTCP]
DHCP=1
DNS=0
WINS=DHCP
Hostname=e000001
[NWREDIR]
FirstNetDrive=F:
ProcessLoginScript=1
[VREDIR]
ValidatedLogon=0
[VServer]
LMAnnouce=0
[OptionalComponents]
"Accessibility Options"=1
"Briefcase"=0
"Calculator"=1
"Character Map"=0
"Clipboard Viewer"=1
"Desktop Wallpaper"=0
"Document Templates"=1
"Games"=0
"Mouse Pointers"=1
"Net Watcher"=0
"Object Packager"=0
"Online User's Guide"=1
"Paint"=1
"Quick View"=1
"System Monitor"=1
"System Resource Meter"=1
"Windows 95 Tour"=1
"WordPad"=1
"Dial-Up Networking"=0
"Direct Cable Connection"=0
"HyperTerminal"=0
"Phone Dialer"=0
"Backup"=1
"Defrag"=1
"Disk compression tools"=0
"CompuServe Mail Services"=0
"Microsoft Exchange"=0
"Microsoft Mail Services"=0
"Microsoft Fax"=0
"Microsoft Fax Services"=0
"Microsoft Fax Viewer"=0
"Central European language support"=0
"Cyrillic language support"=0
"Greek Language support"=0
"Audio Compression"=1
"CD Player"=1
"Jungle Sound Scheme"=0
"Media Player"=1
"Musica Sound Scheme"=0
"Robotz Sound Scheme"=0
"Sample Sounds"=0
"Sound Recorder"=0
"Utopia Sound Scheme"=0
"Video Compression"=1
"Volume Control"=1
"Blank Screen"=0
"Curves and Colors"=1
"Flying Through Space"=0
"Flying Windows"=0
"Mystify Your Mind"=0
"Scrolling Marquee"=0
"The Microsoft Network"=0
[Printers]
Your QMS Printer=QMS-PS 810,LPT1
HP III=HP LaserJet III,LPT2
This site is copyrighted. No portion may be reproduced
without my written permission.
|