Video Screencast Help

Scripted OS Install - Part 3: The Answer File

Created: 18 Sep 2007 • Updated: 24 Apr 2009 | 2 comments
Language Translations
trb48's picture
+1 1 Vote
Login to vote

We are making good progress towards a completely scripted Windows XP install (with all of the sweet extras). In the last article we updated our Windows XP CD with all of the latest and greatest Windows Updates. This makes installing Windows much more secure, but it is still not scripted. Even after the Windows XP CD has been updated you will still have to put in your product key, timezone, administrator password, etc.

In this article, we are going to talk about the Windows XP answer file. The answer file's goal is provide the Windows XP installer all of the "answers" it needs to install Windows XP without any user input. There are many elements that make up the answer file. All of the elements combine into a very powerful tool. This tool allows system admins to install Windows without typing anything. It also gives very extensive control of what is installed. You can also configure several important elements of Windows. After this article, you will wonder how you lived without the Windows XP answer file.

Overview:

The answer file is made up of many different sections. Each has several different parts. In this article I will break up each section and describe the important parts of each. At the end of the article I will make sure to paste a sample answer file. I will also provide several Web sites that I found useful when I created my answer file.

The Bootstrap

This is the first section of the answer file. Without this section, your installation will not be scripted. This is the bootstrap of the entire process. Here is an explanation of the major parts of this section:

  • Autopartition: Installs Windows on the first available partition on the local hard drive. Make sure that your drive is formatted (it won't install on a partition that already contains Windows).
  • MsDosInitiated: This tells the Windows Install process that the scripted install is running from the CD (make sure the value is set to 0).
  • UnattendedInstall: This tells the Windows Install process that we are running an unattended (or scripted) install.
  • AutomaticUpdates: You can use this setting to turn Windows Updates on or off.

Here are the settings I use:

[Data] Autopartition = 1 MsDosInitiated = 0 UnattendedInstall = Yes AutomaticUpdates = Yes

Unattended

This section contains all the information that setup needs to run. This section has many important parts. I will only focus the entries that I found useful:

  • UnattendMode: There are several different levels of automation in an unattended install. I wanted everything to take care of itself, so I made this value "FullUnattended." You can make it so the end user has to provide all the answers or some of the answers. You can even make the Windows Installer answer all of the questions with the default answers.
  • OemSkipEula: If the value on this is "Yes" it will not ask the user to accept the EULA.
  • OemPreinstall: This copies files that are used to customized Windows. We will talk more about this in a later article.
  • OEMPnPDriversPath: This points the Windows Installer to custom drivers. You guessed it, we will talk about this more in a later article.
  • driversigningPolicy: Even though Windows XP has been out for almost 7 years now, there are still some hardware devices whose drivers have not been signed by Microsoft. I will talk more about this later, but, if I decided to include the driver I want Windows to use it. To make sure that all the drivers are used, I choose "Ignore."
  • AutoActivate: If the internet is connected, and the setting is "Yes" Windows will autoactivate.
  • WaitForReboot: At one point in the install, Windows asks you to press a button to restart the computer. If you set this value to "No" the system will restart without user input or waiting.
  • FactoryMode: This part is important if you plan on using this scripted install to create an image. More information to come.
  • NoWaitAfterTextMode: If you don't want to wait, this will help you out during the install process.
  • NoWaitAfterGUIMode: If you don't want to wait, this will help you out during the install process.
  • Repartition: This part tells the Window Installer to delete all partitions on the first drive. It also formats the drive.
  • UnattendSwitch: This tells Windows to skip the "Welcome Screen" after Windows has installed.
[Unattended] UnattendMode = FullUnattended OemSkipEula = Yes OemPreinstall = Yes OEMPnPDriversPath = "Drivers\Network\1;Drivers\Network\2" driversigningPolicy = Ignore AutoActivate = No WaitForReboot = No FactoryMode = Yes NoWaitAfterTextMode = 1 NoWaitAfterGUIMode = 1 Repartition = Yes UnattendSwitch = Yes

If you would like more information on this section, take a look at the references below.

GuiUnattended

This section covers the questions that the Windows Installer asks (you know the questions that you have to type in).

  • EncryptedAdminPassword: I am not very concerned about the Admin password. I set this value to "No." I make sure to change the Admin password after Windows has completely installed.
  • AdminPassword = "password" - pretty self-explanatory. If you don't put a password in, it will ask you for one later.
  • AutoLogon: I want software to install after Windows is done installing. The best way to do this is to have the administrator account log in by itself. (that is why we specifiy the administrator's password above.)
  • AutoLogonCount: You can tell Windows how many times you want it to autologin.
  • TimeZone: You can specify your default time zone.
  • OEMSkipRegional: If this value is set to "1" it will use the regional options specified in the answer file.
  • OemSkipWelcome: If this value is set to "1" you can skip the welcome screen.
[GuiUnattended] EncryptedAdminPassword = No AdminPassword = "password" AutoLogon = Yes AutoLogonCount = 2 TimeZone = 010 OEMSkipRegional = 1 OemSkipWelcome = 1

User Information

This part of your answer file can contain sensitive information. Make sure you are careful who sees it.

  • ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" - it has to be in this format
  • ComputerName = * - if you use an "*" it creates a random computer name.
  • FullName = "Full Name"
  • OrgName = "Company Name"
[UserData] ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" ComputerName = * FullName = "Full Name" OrgName = "Company Name"

Display Settings

In this section, you can specify the default screen resolution after Windows Installs. This part is tricky. Lets say you use this scripted install on a laptop. The screen resolution could be different. Windows recognizes that it is being installed on a laptop and adjusts the screen resolution to the best it can be. I guess this is just a backup in case Windows does not do its thing (like if you have the wrong video card drivers on your CD)

[Display] Xresolution = 1280 Yresolution = 1024 BitsPerPel = 32 AutoConfirm = 1

Regional Information

The most important part of this section is "LanguageGroup." This tells Windows to install what languages it should install. I have it installing all the languages it can. I had problems getting some of the languages to install, so I found an example of this section. After I changed my answer file to match the example it seemed to work better. Keep in mind that this setting does not cover the "Eastern Languages." If you want them installed, you will have to do it after Windows installs.

[RegionalSettings] SystemLocale = 00000409 UserLocale = 00000409 InputLocale = 0409:00000409 LanguageGroup=13,17,3,2,5,16,4,12,15,7,8,10,11,9,6,14,1

Workgroup or Domain

By default, you can have Windows join a Workgroup or Domain. If you would like it to join a Domain you have to provide the Domain name, an account and password that will allow the computer to add itself to the Domain. In the example below, Windows will add itself to the "Work" workgroup. The ";" comments out lines in the answer file. If the ";" is at the beginning of a line, the Windows Install process will ignore that line.

[Identification] JoinWorkgroup = "Work" ;JoinDomain="WorkDomain" ;DomainAdmin="" ;DomainAdminPassword=""

Networking

If you plan on installing Windows on a computer that will not use networking, set this value to "No"

[Networking] InstallDefaultComponents = "Yes"

Internet Explorer

One thing that has annoyed me when creating an image is setting the "Links" or other book marks in Internet Explorer. You can actually build those book marks into the install. This is a great option if you want everyone to get a standard set of bookmarks as part of the image.

[URL] Home_Page=http://www.google.com/ Quick_Link_1_Name="Altiris Juice" Quick_Link_1= http://www.symantec.com/connect Quick_Link_2_Name="Altiris" Quick_Link_2 =http://www.altiris.com Quick_Link_3_Name="Symantec" Quick_Link_3 =http://www.symantec.com Quick_Link_4_Name="Wikipedia" Quick_Link_4= http://www.wikipedia.org [Branding] BrandIEUsingUnattended = Yes

This can be very helpful if your company has popups as part of its web page. You can also control the filterlevel in Internet Explorer. This is really helpful. It is great when I can avoid annoying little details.

[IEPopupBlocker] AllowedSites=*.altiris.com;*.symantec.com;*.google.com; BlockPopups=Yes FilterLevel=Medium

Themes

If you have a theme that you have created, and you want it to be the default theme this is the place to do that. The theme that I created only had simple settings like the background and screensaver. If you set "DefaultThemesOff" to "No" the Windows Classic theme will be used. If "DefaultStartPanelOff " is set to "Off" the Windows Classic Start Menu will be used after Windows is installed. [Shell] DefaultStartPanelOff = no DefaultThemesOff = no CustomDefaultThemeFile = "C:\WINDOWS\Resources\Themes\Company.theme"

Proxy

To be honest, I have no idea why this is in here. It looks important so I included.

[Proxy] Proxy_Enable=0 Use_Same_Proxy=0

Components

In this section you can specify what extra components you want installed. For instance, we had problems playing games at work (something that system admins never do!). So I included all of the Windows games (Zonegames) in the answer file and made sure it never gets installed. I also make sure that MSN Explorer, Outlook Express, and IIS are not installed. For a list of what you can and can't install, check out the references listed below.

[Components] Iis_common = Off Iis_inetmgr = Off Iis_nntp = Off Iis_smtp = Off Iis_webadmin = Off Iis_webdav = Off Iis_www = Off Iis_asp = Off OEAccess = Off AutoUpdate = Off Chat = Off Dialer = Off Zonegames = Off Msnexplr = Off msmsgs = Off

GuiRunOnce

In this section you can specify what you want to run after Windows has installed. This is a great place to specify any programs you want to install. Below I have listed a "copy.bat" file. This file copies a bat file to the Startup folder of the Administrators account. I have Windows log in once. When it logs in, it runs the bat file that has been copied.

[GuiRunOnce] "C:\Drivers\Install\copy.bat"

WINNT.SIF

Here is my complete example:

[Data]
Autopartition = 1
MsDosInitiated = 0
UnattendedInstall = Yes
AutomaticUpdates = Yes

[Unattended]
UnattendMode = FullUnattended
OemSkipEula = Yes
OemPreinstall = Yes
OEMPnPDriversPath =
"Drivers\Network\1;Drivers\Network\2"
driversigningPolicy = Ignore
AutoActivate = No
WaitForReboot = No
FactoryMode = Yes
Factory = Yes
NoWaitAfterTextMode = 1
NoWaitAfterGUIMode = 1
Repartition = Yes
UnattendSwitch = Yes

[GuiUnattended]
EncryptedAdminPassword = No
AdminPassword = "password"
AutoLogon = Yes
AutoLogonCount = 2
TimeZone = 010
OEMSkipRegional = 1
OemSkipWelcome = 1

[UserData]
ProductKey = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
ComputerName = *
FullName = "Name"
OrgName = "Company"

[Display]
Xresolution = 1280
Yresolution = 1024
BitsPerPel = 32
AutoConfirm = 1

[RegionalSettings]
SystemLocale = 00000409
UserLocale = 00000409
InputLocale = 0409:00000409
LanguageGroup=13,17,3,2,5,16,4,12,15,7,8,10,11,9,6,14,1

[Identification]
JoinWorkgroup = "LDSBC"
;JoinDomain="LDSBC"
;DomainAdmin=""
;DomainAdminPassword=""

[Networking]
InstallDefaultComponents = "Yes"

[URL]
Home_Page=http://www.google.com/
Quick_Link_1_Name="Altiris Juice"
Quick_Link_1= http://www.symantec.com/connect
Quick_Link_2_Name="Altiris"
Quick_Link_2 =http://www.altiris.com
Quick_Link_3_Name="Symantec"
Quick_Link_3 =http://www.symantec.com
Quick_Link_4_Name="Wikipedia"
Quick_Link_4= http://www.wikipedia.org

[Branding]
BrandIEUsingUnattended = Yes


[IEPopupBlocker]
AllowedSites=*.altiris.com;*.symantec.com;*.google.com;
BlockPopups=Yes
FilterLevel=Medium

[Shell]
DefaultStartPanelOff = no
DefaultThemesOff = no
CustomDefaultThemeFile = "C:\WINDOWS\Resources\Themes\Custom.theme"

[Proxy]
Proxy_Enable=0
Use_Same_Proxy=0

[Components]
Iis_common = Off
Iis_inetmgr = Off
Iis_nntp = Off
Iis_smtp = Off
Iis_webadmin = Off
Iis_webdav = Off
Iis_www = Off
Iis_asp = Off
OEAccess = Off
AutoUpdate = Off
Chat = Off
Dialer = Off
Zonegames = Off
Msnexplr = Off
msmsgs = Off

[GuiRunOnce]
"C:\Drivers\Install\copy.bat"

To create this file, open Notepad. Then, paste the above into the program. Save the file as "WINNT.SIF" (without the quotes). Take a step back from the process and make the changes that make sense to you. Then, copy the file into your I386 folder. After that, you can burn your CD. The next time you use that CD, you have a fully automated install of Windows!

Resources:

Here are some great resources I found regarding answer files:

The best resource for creating a WINNT.SIF file is actually found on the Windows XP CD itself. If you navigate to Windows XP CD >> Support >>Tools >> Deploy.CAB. You will want to extract DEPLOY.CAB. Once it is extracted, find the "deploy.chm" file. Once that file is open, you can search for almost all of the things that are talked about in this article.

Also remember that you can search for any of these things in this article on your favorite search engine. I have learned many useful things doing that. One thing it keep in mind is UNATTENDED.TXT and WINNT.SIF are almost the same thing. You can use information on these two files interchangeably.

Conclusion:

The answer file is a very complicated topic to cover. The example that I provided is a great start to any scripted install of Windows. If you have specific needs please use the resources, and search the internet. It took me a long time to get my answer file configured the way that I have it now. It does work well (meaning it does what I want it to).

After your answer file is created, configured, and placed in the I386 folder you have a scripted install of Windows. There is a lot more to cover, but you can at least start testing your CD.

Scripted OS Install - Part 2: Windows Updates

Scripted OS Install - Part 4: Drivers

 

Comments 2 CommentsJump to latest comment

levwinski's picture

Thanks for the great series.

With regards to what you wrote about Autopartition = 1 not installing if Windows is already installed on the first partition, is there any way of configuring this so that the target partition is automatically partitioned (if no partition exists) and then [quick]formatted regardless of whether a prior paritition existed or not?

The ability to have this install without first preparing the target machine would be of immense benefit to us.

0
Login to vote
dan.dupont@dsb1.edu.on.ca's picture

This article was great help. I have been deligated the task of creating an image to work accross multiple flavor of computers. I have done it in the past a very primative way ,but now I am running into issues with the newer computers. The hardware is much different then the older ones. I have read through your article and if I am not mistaken (which I could be) I could use this method to create one image for many flavors. I think by loading one computer and copy all drivers to the proper location, and in my sysprep file I can direct the oemdriver to piont to that area it will load any drivers that are required when I ghost these computers. If all goes well the proper drivers will load after the image is brought down to a different computer then the one the image was created on. Please confirm this and if correctg I will spen the time to create and download all required drivers.

Thanks
Dan

0
Login to vote