What is Txtsetup.sif?
Txtsetup.sif is a setup information file (sif) used primarily for text mode setup (as the name implies). It can be used for other things however, such as the windows pe startup (the end of text mode and the beginning of Gui Mode is windows PE after all). After text mode is done the file has no purpose; it is not copied to the windows installation. Since it is not used by windows, it has no role in functions such as system file protection (SFC). It also is not digitally signed, so you can modify it without issues.
You can use txtsetup.sif to include 3rd party drivers on the xp cd, modifying the minimum requirements to install windows, add files to your install, add or delete registry hives, and more.
Adding or Removing files from Txtsetup.sif.
To remove a line from txtsetup.sif, either add a semi colon (;) in front of the line or delete the line entirely. Usually when you remove a line from txtsetup.sif you're gonna want to remove the line from dosnet.inf too.
To add a line, it becomes more complex. Below is a sample line from txtsetup.sif, along with explanation of what it means.
locsecw.chm = 1,,,,,,,21,0,0,localsec.chm
locsecw.chm is the file on the cd
1 means it's an original (RTM) xp file. The 1 comes from [SourceDisksNames.x86]. Usually you'll see 1 or 100, with 1 being an original file, 100 being a SP1 file.
21 means what location the file will be copied to, relative to the %windir% folder. In this case, 21 tells setup to copy locsecw.chm to %windir%\help\localsec.chm. This value is found under [WinntDirectories]. Since every folder under [WinntDirectories] is relative to the %windir% folder, this means you only add files to txtsetup.sif that will be copied to the %windir% folder.
I'm not exactly what the next two 0's mean.
As you can see in the example, if you want to rename the file at the end. Microsoft mainly does this to seperate windows xp home and pro. Home will have files that have P, pro will have files that have W. The W probably stands for workstation. I assume the P stands for Personal, since windows XP home was originally called Whistler Personal.
cmconW.chm = 1,,,,,,,21,0,0,cmconcepts.chm - xp pro txtsetup.sif
cmconP.chm = 1,,,,,,,21,0,0,cmconcepts.chm - xp home txtsetup.sif
So as you see, there's different files for xp home and pro that have the same file name. Also note that txtsetup.sif supports long file names (LFN's).
Let's look at another line, what's in Bold is important:
autofmt.exe = 1,,,,,,_x,2,0,0,,1,2
The _x means the file is not compressed on the cd. If this is missing, setup assumes the file is compressed. This is important for security and reliability. Every XP file is listed in layout.inf, along with it's size in bytes. The size in bytes obviously depends on whether the file is compressed or not. If txtsetup.sif tells setup a file is not compressed, setup will look at layout.inf for the file size to make sure it hasn't been modified or corrupted. If the file size does not match what's in layout.inf, xp might throw up an error and stop. This helps keep setup secure since the files are original. It also verifies the files are not corrupt. If the files were corrupt, problems would occur later in setup. If you search txtsetup.sif for _x, you'll find every file is not compressed on the XP CD.
One important thing to note is that txtsetup.sif does not tell setup where to get the files from. It's sole function is to copy files to the correct folder, as the correct file name. Txtsetup.sif runs after dosnet.inf copies the local source to C:\$WIN_NT$.~LS. Txtsetup.sif will assume the source files reside in this folder.
Since txtsetup.sif only copies to the %windir% folder it's very limited in it's use. The main uses are to add registry hives (%windir%\system32\config) and drivers (%windir%\system32\config).
At a later point i'll give instructions on including 3rd party drivers on the XP CD. In my Using txtsetup.sif to add registry settings I explain how to add a custom hive (.inf file) using txtsetup.sif.
Let's say you wanted to add tweakui to your install, but you don't want to use an unattend file (answer file). With txtsetup.sif this would be easy to do.
Step 1: Download Tweak UI for XP SP1
Download tweakui here. Once downloaded extract tweakui.exe from the file using winrar, or install the program and copy tweakui.exe from your windows\system32 folder to your desktop.
Step 2: Copy tweakui.exe to your local source
Copy your XP CD to hard drive, then put tweakui.exe into your i386 folder.
Step 3: Modify txtsetup.sif and dosnet.inf
Add this to dosnet.inf:
Add this to txtsetup.sif:
tweakui.exe = 1,,,,,,,2,0,0
Now if you run setup from GUI mode, dosnet.inf will copy tweakui.exe to C:\$WIN_NT$.~LS\i386. When the computer restarts text mode will start, and txtsetup.sif will copy tweakui.exe from C:\$WIN_NT$.~LS\i386 to C:\Windows\System32. When the install is done, to run tweakui.exe just go to start > run > type: tweakui, click ok.
You might be wondering why I didn't use _x in the txtsetup.sif entry. Since tweakui.exe isn't on an XP cd by default, XP won't check it's checksum to make sure it's not corrupted (it's not in layout.inf). So it shouldn't matter if you use _x or not as long as the file isn't in layout.inf.
You can also use this method to add msconfig.exe to a Windows 2000 install. Just replace tweakui.exe with msconfig.exe, and everything else will be the same.
For more information see MSFN - Problem installing PowerToys from svcpack
raskren posted some useful information on txtsetup.sif he got from a Windows 2000 book. Rather than rewriting this document I decided to just include any new information provided by raskren. The original topic is here, MSFN - Switches in TXTSETUP.SIF
The following line shows the syntax of each line in the [SourceDisksFiles] section:
Extra fields specified by commas (,) are Windows NT—specific.
diskid is used when a floppy disk installation is used. (Or multiple CDs?)
subdir is the directory to which files are copied. Codes defined in the [WinntDirectories] section of the TXTSETUP.SIF file are used to identify the destination directory.
upgradecode is a single digit that is used if this is an upgrade from an earlier version. It specifies whether the file is copied during the text-mode portion.
Codes in the [Files] Section of TXTSETUP.SIF for File Copy
Status Code - Copy Action
0 - Always copies the file
1 - Copies the file only if it exists in the installation directory
2 - Does not copy the file if it exists in the installation directory
3 - Does not copy the file
newinstallcode is a single digit that is used if this is a fresh installation. It specifies whether the file is copied during the text-mode portion. The same codes are used as for upgrading Windows 2000 and are described in Table 4.3. The newinstallcode is optional; if it is not included, the file is not copied (code = 3).
newfilename is the name to which the file is renamed if it is copied. As an example, consider this line from the [SourceDisksFiles] section.
The file AUTOCHK.EXE in this line is on the CD or the disk with diskid d2 defined in the [Media] section. The file also is on Setup Disk 2 (_2), also defined in the [Media] section. The file is installed in directory 2, which is defined in the [WinntDirectories] section. If you look up the [WinntDirectories] section, directory 2 is the System32 subdirectory in the Windows 2000 root directory. The upgrade code and new installation codes are 0, which means that this file always must be copied to the installation directory, whether this is an upgrade from an earlier version of Windows 2000 or a fresh installation.
Windows® 2000 Server Professional Reference
By Karanjit S. Siyan Ph.D.
Publisher : New Riders Publishing
Pub Date : July 10, 2000
ISBN : 0-7357-0952-1
Pages : 1848