• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

My Unattended Install Method

#1
Hey everyone. I wrote up a little something detailing the method that I use to create unattended installations. If you are interested you can swing by and check it out!

This is what I like to call the Un4ttended Method

Let me know if you have any questions, comments or concerns!

:)

Link Removed - Spamming AnythingIT Site and Its Redirection Service / Forums
 
#2
That's lame... but if that's how you feel then I'll just post the whole article here.

Information below taken from my site, link removed

The original reason for starting this forum community was that while there is a wealth of information out there about unattended installations, there is not enough about RIS unattended installations. There are a lot of similarities but the differences make it difficult to find information. A lot of the techniques I use were developed by me before I ever started frequenting forums. All of the scripts you will find below were written compeltely by me.

The reason for creating an unattended CD for most people is the speed aspect of it. For me it was a little different. The speed is of course important, but the ability to automize EVERYTHING wast most important to me. I am sure there are a few people who will think it’s crazy that my method uses 5 reboots, but I will guarantee it’s one of the most safe methods you can find. It has been tested time and time again and I am not bringing it to you!

Enjoy!
__________________________________________________

The below image is directory structure that I use. It has been trimmed of a couple things such as programs and a software script that I talk about a little later. At the end of this you will find a file including the file structure and all of the scripts here in the proper locations.


_____________________________________________________

The following information is a break down of all of the scripts that I have created and a little information about them.

WINNT.SIF
  • The location of this file differs from RIS and CD installs. The example below was taken from a RIS unattended answer file. For RIS this file would be copied to the i386\templates directory. For a RIS image you can name this file anything you wish as long as it does not have any spaces and it has an extension of “.SIF”. For an unattended CD you would place the file in the i386 directory. There are some items that I have removed from this file that allow you to pass variables from the Client Installation Wizard of the RIS server. The options are useful because they allow you to answer a few questions about software and passes those variables to the registry later. These registry variables are queried by a software script (which I have ommited as well) and the proper software/versions are installed.
Code:
[data]
floppyless = "1"
msdosinitiated = "1"
OriSrc = "\\%SERVERNAME%\RemInst\%INSTALLPATH%\%MACHINETYPE%"
OriTyp = "4"
LocalSourceOnCD = 1

[SetupData]
OsLoadOptions = "/noguiboot /fastdetect"
SetupSourceDevice = "\Device\LanmanRedirector\%SERVERNAME%\RemInst\%INSTALLPATH%"

[RemoteInstall]
Repartition = yes
UseWholeDisk = yes

[Unattended]
OemPreinstall = yes
DriverSigningPolicy = Ignore
NoWaitAfterTextMode = 0
FileSystem = ConvertNTFS
ExtendOEMPartition = 0
ConfirmHardware = no
NtUpgrade = no
Win31Upgrade = no
TargetPath = \WINDOWS
OverwriteOemFilesOnUpgrade = no
OemSkipEula = yes
OemSkipWelcome = 1
InstallFilesPath = "\\%SERVERNAME%\RemInst\%INSTALLPATH%\%MACHINETYPE%"
;OemPnpDriversPath = ""
UnattendMode = FullUnattended
UnattendSwitch = Yes

[UserData]
FullName = "Registered User"
OrgName = "Your Company"
ComputerName = %MACHINENAME%
ProductID = "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"

[GuiUnattended]
AdminPassword = *
OemSkipWelcome = 1
OemSkipRegional = 1
TimeZone = %TIMEZONE%
AutoLogon = YES
AutoLogonCount = 5

[Shell]
DefaultStartPanelOff = NO
DefaultThemesOff = NO

[LicenseFilePrintData]
AutoMode = PerSeat

[GuiRunOnce]
"reg add HKLM\Software\UNATTENDED /v stepholder /t REG_SZ /d 1"
"%systemdrive%\auto.cmd"

[Display]
ConfigureAtLogon = 1
BitsPerPel = 16
XResolution = 1024
YResolution = 768
VRefresh = 60
AutoConfirm = 1

[Components]
chat = off
msnexplr = off
msmsgs = off
freecell = off
minesweeper = off
pinball = off
solitaire = off
hearts = off
spider = off
zonegames = off

[Networking]
InstallDefaultComponents=No
ProcessPageSections=Yes

[NetAdapters]
Adapter1 = params.Adapter1

[params.Adapter1]
INFID = *

[params.MS_TCPIP.Adapter1]
SpecificTo=Adapter1
DHCP=Yes
WINS=No
NetBIOSOptions=1

[Identification]
JoinDomain = %MACHINEDOMAIN%
CreateComputerAccountInDomain = No
DoOldStyleDomainJoin = Yes

[NetProtocols]
MS_TCPIP=params.MS_TCPIP

[params.MS_TCPIP]
; transport: TC (TCP/IP Protocol)
InfID=MS_TCPIP
DHCP=Yes

[NetClients]
MS_MSClient=params.MS_MSClient

[params.MS_MSClient]
InfID=MS_MSClient

[NetServices]
MS_Server=params.MS_Server

[params.MS_Server]
; service: SRV (Server)
InfID=MS_Server
BroadcastsToLanman2Clients = No

[ServicesSection]

[OSChooser]
Description ="Windows XP Professional"
Help ="Installs Windows XP Professional SP1 and all current hotfixes"
LaunchFile = "%INSTALLPATH%\%MACHINETYPE%\templates\startrom.com"
ImageType =Flat
Version="5.0"
_________________________________________________________

%ROOT%\$OEM$\CMDLINES.TXT
  • This file holds commands that will be run around the “13 minutes left” mark of Gui Setup Mode. The commands must be enclosed in quotations. You may not use double quotations so any programs that require quotes to run must be run from a CMD script that you can run from this file. Any changes you make during this time will be made to the Default User profile so this is a good place to make changes to the HKCU registry hive.
Code:
[commands]
".\files\ie6sp1\ie6sp1br.exe"
".\curegkeys.cmd"
".\files\directx90b\dx9ntopk.exe"
_________________________________________________________

%ROOT%\$OEM$\CUREGKEYS.CMD
  • This is the registry file that I call from CMDLINES.TXT. This file is not an esential part of an unattended installation. In this particular script it searches the %systemdrive%\files\regkeys directory for files with .REG extensions and runs each.
Code:
@echo off
echo Importing Default User registry keys...
for /f %%i IN ('dir /b .\files\regkeys\*.reg') DO regedit /s .\files\regkeys\%%i
echo -completed
:end
_________________________________________________________

%ROOT%\$OEM$\AUTO.CMD
  • This is a script created by me that controls the unattended installations after Windows has completed. Because of a problem with RIS and SP1 on Windows XP PCs I do not slipstream SP1 so I use this file to control that as well as hotfixes, software and other things. As you all know Windows XP does not take a long time to reboot so the 5 reboots only adds about a minute to the build total. It’s safer this way. I have tested this technique on well over 100 PCs and not a problem yet. Feel free to edit the script below as you feel fit, adding your own items and removing anything you do not wish to run. It is not necessary, but it would be nice if you would leave the tag line with my information on it. There are a few pieces of this script that have been omited such as my printer script that determines which location the user is at and places an item into the RunOnce of the Default User profile so that the first time a user logs on it will map all the network printers in their location. If you wish to see this information please let me know.
Code:
@echo off
REM Unattended Installation Script by Don Freeman
REM This file is provided AS IS.  You have the rights to edit this
REM in any way you see fit.  Please do not remove this information.
REM Please feel free to submit any questions or suggestions to:
REM Don Freeman – [email]don@anythingit.org[/email]
color 0E
TITLE Installation Script - Written by Don Freeman
 
ECHO Determining installation step...
for /F "tokens=3*" %%i IN ('reg query HKLM\Software\UNATTENDED /v stepholder ^| findstr /r "REG"') DO set stepholder=%%i
for /F "tokens=3*" %%i IN ('reg query HKLM\Software\UNATTENDED /v adminpass ^| findstr /r "REG"') DO set adminpass=%%i
  
ECHO -completed
ECHO.
ECHO Jumping to installation step %STEPHOLDER%
  
IF "%STEPHOLDER%" == "1" GOTO STEP1
IF "%STEPHOLDER%" == "2" GOTO STEP2
IF "%STEPHOLDER%" == "3" GOTO STEP3
IF "%STEPHOLDER%" == "4" GOTO STEP4
IF "%STEPHOLDER%" == "5" GOTO STEP5
IF "%STEPHOLDER%" GTR "5" GOTO ERROR
GOTO ERROR
  
:ERROR
CLS
COLOR 0C	
ECHO An error has been encountered.
ECHO The script was unable to determine an insertion point.
ECHO.
ECHO Please check the value in the registry:
ECHO.
ECHO Registry Key:        HKLM\Software\UNATTENDED
ECHO Registry String:     stepholder
ECHO Registry Value:      (this determines the step)
ECHO.
ECHO.
ECHO.
PAUSE
GOTO END
  
:STEP1
  
color 0A
TITLE Installation Script - Step 1 - Written by Don Freeman
echo Installing Service Packs...
start "" /wait %systemdrive%\files\servicepack\sp1a\xpsp1a_en_x86.exe -u -z
  
echo y | reg add HKLM\Software\UNATTENDED /v stepholder /t REG_SZ /d 2
  
GOTO RSEND
  
:STEP2
  
color 0A
TITLE Installation Script - Step 2 - Written by Don Freeman
  
echo Installing Critical Hotfixes...
echo Collecting list of current critical hotfixes...
   echo @echo off>>%systemdrive%\files\hotfixes\recommended\hotfixinst.cmd
   echo echo Please wait while current hotfixes are being installed. This may take awhile!!!>>%systemdrive%\files\hotfixes\recommended\hotfixinst.cmd

   for /f %%i IN ('dir %systemdrive%\files\hotfixes\recommended\1 /b') Do @echo start "" /wait %systemdrive%\files\hotfixes\recommended\1\%%i /passive /norestart>>%systemdrive%\files\hotfixes\recommended\hotfixinst.cmd
   for /f %%i IN ('dir %systemdrive%\files\hotfixes\recommended\2 /b') Do @echo start "" /wait %systemdrive%\files\hotfixes\recommended\2\%%i /q /r:n>>%systemdrive%\files\hotfixes\recommended\hotfixinst.cmd
   for /f %%i IN ('dir %systemdrive%\files\hotfixes\recommended\3 /b') Do @echo start "" /wait %systemdrive%\files\hotfixes\recommended\3\%%i -u -n -z>>%systemdrive%\files\hotfixes\recommended\hotfixinst.cmd
   for /f %%i IN ('dir %systemdrive%\files\hotfixes\recommended\4 /b') Do @echo start "" /wait %systemdrive%\files\hotfixes\recommended\4\%%i /C:"dahotfix.exe /q /n" /q>>%systemdrive%\files\hotfixes\recommended\hotfixinst.cmd

   echo echo - Completed>>%systemdrive%\files\hotfixes\recommended\hotfixinst.cmd
   echo exit>>%systemdrive%\files\hotfixes\recommended\hotfixinst.cmd
echo - Completed
echo.
START "" /wait %systemdrive%\files\hotfixes\recommended\hotfixinst.cmd

echo Installing Recommended Hotfixes...
echo Collecting list of current recommended hotfixes...
   echo @echo off>>%systemdrive%\files\hotfixes\critical\hotfixinst.cmd
   echo echo Please wait while current hotfixes are being installed. This may take awhile!!!>>%systemdrive%\files\hotfixes\critical\hotfixinst.cmd

   for /f %%i IN ('dir %systemdrive%\files\hotfixes\critical\1 /b') Do @echo start "" /wait %systemdrive%\files\hotfixes\critical\1\%%i /passive /norestart>>%systemdrive%\files\hotfixes\critical\hotfixinst.cmd
   for /f %%i IN ('dir %systemdrive%\files\hotfixes\critical\2 /b') Do @echo start "" /wait %systemdrive%\files\hotfixes\critical\2\%%i /q /r:n>>%systemdrive%\files\hotfixes\critical\hotfixinst.cmd
   for /f %%i IN ('dir %systemdrive%\files\hotfixes\critical\3 /b') Do @echo start "" /wait %systemdrive%\files\hotfixes\critical\3\%%i -u -n -z>>%systemdrive%\files\hotfixes\critical\hotfixinst.cmd
   for /f %%i IN ('dir %systemdrive%\files\hotfixes\critical\4 /b') Do @echo start "" /wait %systemdrive%\files\hotfixes\critical\4\%%i /C:"dahotfix.exe /q /n" /q>>%systemdrive%\files\hotfixes\critical\hotfixinst.cmd

   echo echo - Completed>>%systemdrive%\files\hotfixes\critical\hotfixinst.cmd
   echo exit>>%systemdrive%\files\hotfixes\recommended\hotfixinst.cmd
echo - Completed
echo.
START "" /wait %systemdrive%\files\hotfixes\critical\hotfixinst.cmd
  
echo y | reg add HKLM\Software\UNATTENDED /v stepholder /t REG_SZ /d 3

GOTO RSEND

:STEP3

color 0A
TITLE Installation Script - Step 3 - Written by Don Freeman

echo Installing Standard Software...
echo @echo off>%systemdrive%\files\software\standard\runsoft.cmd
COLOR 0E>>%systemdrive%\files\software\standard\runsoft.cmd
for /f "eol=; tokens=*" %%i IN (%systemdrive%\files\software\standard\software.txt) DO echo%%i>>%systemdrive%\files\software\standard\runsoft.cmd
echo exit>>%systemdrive%\files\software\standard\runsoft.cmd
START "" /wait %systemdrive%\files\software\standard\runsoft.cmd

REM echo Installing Specific Software...
REM START "" /wait %systemdrive%\files\software\specific\software.cmd
 
echo y | reg add HKLM\Software\UNATTENDED /v stepholder /t REG_SZ /d 4

GOTO RSEND

:STEP4
  
color 0A
TITLE Installation Script - Step 4 - Written by Don Freeman

echo Installing REG Keys...
echo Importing Local Machine registry keys...
for /f %%i IN ('dir /b %systemdrive%\files\regkeys\*.reg') DO regedit /s %systemdrive%\files\regkeys\%%i
echo -completed

echo y | reg add HKLM\Software\UNATTENDED /v stepholder /t REG_SZ /d 5
  
GOTO RSEND

:STEP5
  
color 0B
TITLE Client Cleaner Script - Written by Donald Freeman
ECHO Cleaning all temporary files...
rd /q /s %systemdrive%\files>nul
  
echo y | reg delete HKLM\Software\UNATTENDED /v stepholder
  
shutdown.exe -r -t 10 -f -c "PC must reboot to make changes.  This is part of the unattended installation.  Please do not disturb."
  
del /q %systemdrive%\auto.cmd>nul
  
:RSEND
echo y | reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v RISauto2 /t REG_SZ /d "%systemdrive%\RISauto.cmd"
shutdown.exe -r -t 5 -f -c "PC must reboot to make changes.  This is part of the unattended installation.  Please do not disturb."
  
:END
Download the script here... $OEM$.zip
 

Electronic Punk

willalwaysbewithyou
Staff member
Political User
#3
Wow, must have taken a while to get that sorted, but if you do reformat alot or want to ghost alot of machines it is going to save you alot of time.

The reason I wouldn't do this, tho I guess it can be easily changed, is I like to save my partitions.

Was also like to configure everything myself, but it looks like you can configure alot more this way than via the gui stage itself.
 
#4
Ghosting requires you to recreate an image for every upgrade. This method allows you to update by dropping files into a directory basically. Everything can be automated. I have been doing this for over a year and a half and on hundreds of Desktops and Laptops. Lots of different hardware configurations. I didn't create this process for myself, I created it for my company. I rebuild my PC manually, I don't bother with creating an unattended CD or anything.
 
I

Idle

Guest
#8
no offense or anything but, how can you sit in front of a computer that long and do all that? do you see sunlight at all?:p
 
#9
Idle: I have spent less time on that then I have to image every PC I have imaged with that method, and figuring I have to image 500 PCs in about a month... :)
 

ptah

OSNN One Post Wonder
#11
I found this very usefull, but I have a nasty problem when I use RunOnce.
I have put a batch file in GuiRunOnce in my .sif file. In that batch file I run a setup to install a program and add another key to RunOnce.
The install of the program works fine, the key is added to RunOnce, but the key I added to RunOnce executes immediatly and the key is removed, instead of running at the next startup.

Anyone have an idea how this comes and how I can resolve this?

Regards,
Ptah
 
#12
Find the proper key in the Windows registry, save it as a .reg file, and add a GuiRunOnce entry to add it at the end of your install.
 

kcnychief

█▄█ ▀█▄ █
Political User
#13
That is OK I guess, and I have to admit I only skimmed the post. But why wouldn't one Ghost, and just use Sysprep to adjust instead of having to do this install?

Would be quicker, that's for sure. I say that because loading an image would be quicker than installing from any network share or CD, wouldn't you think so?

If you are concerned with doing multiple computers, you could always GhostCast
 

Members online

No members online now.

Latest posts

Latest profile posts

Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,961
Messages
673,239
Members
89,014
Latest member
sanoravies