Apr 6 2009
The Build Disc – Part 4b (wrap-up)
Over the past week or so I’ve posted separate articles on each of the standard utilities that comprise the unattended installs portion of my standard build disc. Now I’m going to build on the starting point of unattended installs and talk about how to implement these installs as a component of the overall standard build.
The benefit of using unattended installs is that all of these tools get installed with no interaction required on my part. Just set it going and come back when its done. How did I do this? Largely be combining each silent install into a single batch file that does the whole install process.
Unfortunately, it’s not just a matter of doing a cut and paste on each item. In order to do this properly I need to work out which operating system I’m dealing with. For example, there’s no point trying to install Sidebar Gadgets under Windows XP.
I’ve also found that the launcher I’m currently using does not retain any useful path information. That means that in order to get things working properly I first have to identify what driver letter the batch file was called from and then ensure that I keep all paths correct from that point.
Working out operating system and drive path has already been discussed earlier in my article about an automated install of Windows Service Packs, check there for further background.
Where does that leave us? Ready to take a look at the finished result for handing installation of all the standard utilities that I include in my build disc.
At this point I should also note that this batch file really doesn’t do enough error checking for my liking. It should check if any of the standard utils are already installed before going ahead and installing them. In my own workshop, this isn’t as much an issue as we only use this particular installer in certain circumstances (on a new computer or on a computer that we’ve just done a clean rebuild on). In these circumstances, we already know what software is installed and, for us, there are rarely conflicts with these standard utils.
If anyone has a good way of doing the error checking here I’d love to hear from you (my thought is to check either registry keys or particular .exe’s that form part of the relevant util’s install).
So, here’s my complete batch file:
@ECHO OFF echo ************************************** echo * Build DVD - 28 March 2009 * echo * * echo * Software Installers * echo ************************************** echo. echo Checking drives for build disc... rem ========================================================== rem * When this batch file is launched it * rem * doesn't retain a path and, therefore, can't find any * rem * of the stuff it's supposed to install. This routine * rem * is used to locate the DVD that contains the required * rem * information. * rem * * rem * The batch file works in Vista but currently benefits * rem * from having UAC disabled. Working on a future version * rem * that will copy with UAC being enabled. * rem ========================================================== SET CDROM= SET Temp1=%Temp%.%~n0%Random%1.reg SET Temp2=%Temp%.%~n0%Random%2.reg START /WAIT REGEDIT /E %Temp1% "HKEY_LOCAL_MACHINESYSTEMMountedDevices" TYPE %Temp1% > %Temp2% TYPE %Temp2% | FIND "\DosDevices\" | FIND /V "\DosDevices\A:" | FIND "=hex:5c," > %Temp1% FOR /F "tokens=3 delims=:" %%A IN (%Temp1%) DO CALL :ParseDrive %%A DEL %Temp1% DEL %Temp2% SET Temp1= SET Temp2= echo Build Disc Found: %CDROM% drive. cd /d %CDROM%: GOTO:FindOSVer :ParseDrive IF EXIST %1:buildversion.txt ( SET CDROM=%1 ) GOTO:EOF :FindOSVer rem ========================================================== rem * This batch file supports Vista and XP - need to work * rem * out which one we're dealing with. * rem ========================================================== echo. echo Checking Windows Version... rem ========================================================== rem * Test for Windows XP here... * rem ========================================================== ver | find /i "Windows XP" > nul if %ERRORLEVEL% equ 0 ( echo Build running - Windows XP Version set OSVER=5 goto XP1 ) rem ========================================================== rem * Test for Windows Vista here... * rem ========================================================== ver | find /i "Version 6" > nul if %ERRORLEVEL% equ 0 ( echo Build running - Windows Vista Version set OSVER=6 goto Vista1 ) goto Unsupported echo. rem ========================================================== rem * Install XP-only pre-requisite software - basically, * rem * any dependencies for other software that may not be * rem * installed already. * rem ========================================================== :XP1 echo Installing Windows Installer v3.1 ... start /wait .InstallersWindowsInstaller-KB893803-v2-x86.exe /quiet /norestart rem ========================================================== rem * Install software compabible with XP and Vista. * rem ========================================================== :Vista1 echo Installing .NET Framework 3.5 ... start /wait .Installersdotnetfx35.exe /passive /norestart echo Installing 7-Zip v4.65 ... start /wait .Installers7z465.exe /S echo Installing K-Lite Codec Pack v4.7.5 (Corporate) ... start /wait .Installersklcodec475c.exe /verysilent /norestart /loadinf".Installersklcpc.ini" echo Installing Paint.NET v3.36 ... start /wait .InstallersPaint.NET.3.36.exe /auto /CHECKFORUPDATES=0 DESKTOPSHORTCUT=0 "PROGRAMSGROUP=Utilities" echo Installing PDF Creator v0.9.7 ... start /wait .InstallersPDFCreator-0_9_7_setup.exe /SP- /VERYSILENT /NOCANCEL /NORESTART /LOADINF="./Installers/pdfinf.inf" echo Installing Citrix Client ... start /wait .InstallersIca32Web.msi /passive /norestart echo Installing Google Earth v5.0 beta ... start /wait .InstallersGoogleEarth-5.0.11337.1968.exe /S /v/qn echo Installing Mozilla Firefox v3.0.8 ... start /wait .InstallersFirefox_3.0.8.exe /S /ira echo Installing Sun J2SE Runtime Environment v6 update 13 ... start /wait .Installersjre-6u13.exe /quiet /norestart echo Installing Adobe Flash v9 and Shockwave v10 Players ... start /wait .InstallersAdobeFlashPlayer_ie_v9.exe /S start /wait .InstallersAdobeFlashPlayer_moz_v9.exe /S start /wait .InstallersAdobeShockwave_v10.exe /S echo Installing Windows Live Messenger v8.5 start /wait .InstallersWLSetup.exe /silent /configfile: .InstallersWLSetup.txt echo Installing Google Toolbar v4.0 for IE (Enterprise) ... start /wait .InstallersGoogleToolbarInstaller.msi /passive /norestart echo Installing MS SyncToy Power Toy ... start /wait .InstallersSyncToySetup.msi /passive /norestart echo Installing Westnet Sign-up Tool ... start /wait .InstallersWestnetD461.exe /S /v/qn echo Installing CrossLoop ... start /wait .Installerscrossloopsetup.exe /VERYSILENT /SP- rem ========================================================== rem * Install XP-only software * rem ========================================================== if %OSVER% equ 6 goto Vista2 echo Installing Windows Media Player v11 ... start /wait .InstallersXP_WiMP11.exe /Q:A /C:"SETUP_WM.EXE /Q:A /R:N /P:#e" echo Installing PowerToys for XP ... start /wait .InstallersXP_ClearTypePowerToy.exe /S /v/qn start /wait .InstallersXP_TaskSwitchPowerToy.exe /S /v/qn echo Installing Eye Candy ... @xcopy .Installers3DWindowsXP.scr %SystemRoot%system32 /q /y start /wait .InstallersXP_Royale_Theme.exe /S /v/qn echo Installing Additional Windows XP Tools ... start /wait .InstallersXP_Uninstall_MS_JVM.exe /Q start /wait .InstallersXP_WindowsRightsManagementServicesSP2-KB917275.exe /S /v/qn start /wait .InstallersXP_KB925876.exe /quiet /norestart start /wait regedit /s .InstallersXP_Reg_Hacks.reg if %OSVER% equ 5 goto Finish rem ========================================================== rem * Install Vista-only software * rem ========================================================== :Vista2 echo. echo Copying Vista Sidebar Gadgets (current user profile only) echo. echo -o- CPU Utilization Gadget @xcopy ".ExtrasVistaSidebarCPUUtilization v1.2.0.2.Gadget" "%USERPROFILE%AppDataLocalMicrosoftWindows SidebarGadgetsCPUUtilization v1.2.0.2.Gadget" /e /i /c /q echo -o- Drive Info Gadget @xcopy ".ExtrasVistaSidebarDriveInfoByChris.gadget" "%USERPROFILE%AppDataLocalMicrosoftWindows SidebarGadgetsDriveInfoByChris.gadget" /e /i /c /q echo -o- iWeather Gadget @xcopy ".ExtrasVistaSidebariWeather.gadget" "%USERPROFILE%AppDataLocalMicrosoftWindows SidebarGadgetsiWeather.gadget" /e /i /c /q echo -o- Memory Meter Gadget @xcopy ".ExtrasVistaSidebarMemoryMeter.gadget" "%USERPROFILE%AppDataLocalMicrosoftWindows SidebarGadgetsMemoryMeter.gadget" /e /i /c /q echo -o- Neptune Digital Clock @xcopy ".ExtrasVistaSidebarNeptuneDigitalClock.gadget" "%USERPROFILE%AppDataLocalMicrosoftWindows SidebarGadgetsNeptuneDigitalClock.gadget" /e /i /c /q echo -o- SysShutdown.gadget... @xcopy ".ExtrasVistaSidebarSysShutdown.gadget" "%USERPROFILE%AppDataLocalMicrosoftWindows SidebarGadgetsSysShutdown.gadget" /e /i /c /q goto Finish rem ========================================================== rem * Failed to find valid operating system. * rem ========================================================== :Unsupported echo. echo ERROR: Operating system not supported. echo (Windows XP and Windows Vista only) pause rem ========================================================== rem * Pause to permit whoever is doing the installs to check * rem * for any install errors that may have occurred and give * rem * path to installers if any manual installs are needed. * rem ========================================================== :Finish echo. echo Installs Complete. Please check output for any error indicators. echo. echo If needed, re-install manually from %CDROM%:Installers. echo. pause
There you have it. The next step in this journey is handling the extra stuff that may be needed depending on other software (e.g. if a system has Office 2003 installed, what extra bits do we install?).