How to automate software installation in Windows 32-bit

exchange keys

Limp Gawd
Joined
Feb 18, 2009
Messages
339
I was curious if you folks knew of a way (or combined ways) of automating the following tasks:

- installing certain software (MS Office 2007, Symantec AV 10.1.0.394, IPSWITCH WS_FTP Professional 7, Cisco VPN Client 5.0.01.0600, Foxit Reader 2.0.3)
- printers (standard IP ports) (HP LJ 4000 series PCL6 driver, and Savin C3535 RPCS driver)
- mapping network drives
- creating app shortcuts to the All Users' desktop
- running Windows Updates
- appending DNS suffix to the TCP/IP properties

Our current setup is in a workgroup, so peer-to-peer. Whenever a new machine needs to be deployed out, I would want to run my NLITE image and hopefully run these scripts to automate the installation of apps for me so I can work on something else.

I'm kind of combining ways, which is working for me, but I want to organize it a bit better.

Any suggestions would be great.

Thank you.
 
Last edited:
I probably should have mentioned that I can't purchase software for these tasks right now since they are not in the budget. I can use CloneZilla instead, but that would require me to do a cloning of the disk, which I don't really want to do.

I was mainly hoping for sample batch scripts to save on the local hard disk (laptops), so say someone (i.e. user) needs to uninstall and reinstall the apps, they can do so at their own leisure while on the road, and when I'm not around.

I'm not a big fan of Acronis support either, lol.
 
I was mainly hoping for sample batch scripts to save on the local hard disk (laptops), so say someone (i.e. user) needs to uninstall and reinstall the apps, they can do so at their own leisure while on the road, and when I'm not around.

You want something to move software over the WAN for install reasons? Thats not gonna happen, office itself is like 500 MB.

I'm not a big fan of Acronis support either, lol.

Their support is alrighty, their product is awesome.
 
Well...

Depending on the application, you can often batch a unattended install (I would of course only do this on the local network, unless you're talking about copying the installation to the laptop...) Google WSFTP (or whatever app) command line install.

You can use:
RUNDLL32 PRINTUI.DLL,PrintUIEntry /il /c\\%machine%
to remotely install printers, there's probably some variation of the command to setup an unattended install.

Obviously you can batch NET USE to map drives.

You can xcopy shortcuts from a predefined directory on the network or local to the all users desktop.

Not sure on Updates, we use WSUS but you cant do that p2p

I'm sure you can define DNS suffix with the netsh command.
http://technet.microsoft.com/en-us/library/cc738592(WS.10).aspx
 
Here's an example of my remote printer install batch since it's a useful example of how to define variables using the SET command.

Code:
@echo off
echo Please type the hostname of the PC you'd like to install printer for.
set /p machine=Hostname: 
RUNDLL32 PRINTUI.DLL,PrintUIEntry /il /c\\%machine%
 
Here's another script example...
I use this to install some of our basic software that goes on every workstation we deploy.

Code:
@echo off
xcopy "\\servername\share\Desktop Support\Software\company_fonts\*.*" "c:\windows\fonts\" /h /e /d /y /c
set adobe=Acrobat Reader 8.0
echo =======================================
echo Checking if %adobe% is installed
echo =======================================
If Exist "%PROGRAMFILES%\Adobe\Reader 8.0\Reader\AcroRd32.exe" Goto skip_adobe

echo *************************************************
echo Installation of %adobe%
echo *************************************************
echo.
echo Now Starting %adobe% installation...
start /wait \\servername\software\adobe\acrobat\AdbeRdr80_en_US.exe /sPB /rs
echo Finished Installing %adobe%
echo Finished Installing %adobe% >>%SystemRoot%\setuplog1.log
echo.
echo. >>%SystemRoot%\setuplog1.log
Goto end

:skip_adobe
echo %adobe% is already installed, skipping install
echo %adobe% is already installed, skipping install >>%SystemRoot%\setuplog1.log
echo.
echo. >>%SystemRoot%\setuplog1.log
Goto end

:end
echo Installation Complete












set av=Symantec Antivirus
echo =======================================
echo Checking if %av% is installed
echo =======================================
If Exist "%PROGRAMFILES%\Symantec AntiVirus\pki" Goto skip_av

echo *************************************************
echo Installation of %av%
echo *************************************************
echo.
echo Now Starting %av% installation...
start /wait \\e\vphome\CLT-INST\WIN32\Setup.exe /s /v/qn
echo Finished Installing %av%
echo Finished Installing %av% >>%SystemRoot%\setuplog2.log
echo.
echo. >>%SystemRoot%\setuplog2.log
Goto end

:skip_av
echo %av% is already installed, skipping install
echo %av% is already installed, skipping install >>%SystemRoot%\setuplog2.log
echo.
echo. >>%SystemRoot%\setuplog2.log
Goto end

:end
echo Installation Complete















set discovery=Symantec Discovery
echo =======================================
echo Checking if %discovery% is installed
echo =======================================
If Exist "%systemdrive%\discovery\" Goto skip_discovery

echo *************************************************
echo Installation of %discovery%
echo *************************************************
echo.
echo Now Starting %discovery% installation...
start /wait \\watcher1\discovery\csetup.exe
echo Finished Installing %discovery%
echo Finished Installing %discovery% >>%SystemRoot%\setuplog3.log
echo.
echo. >>%SystemRoot%\setuplog3.log
Goto end

:skip_discovery
echo %discovery% is already installed, skipping install
echo %discovery% is already installed, skipping install >>%SystemRoot%\setuplog3.log
echo.
echo. >>%SystemRoot%\setuplog3.log
Goto end

:end
echo Installation Complete










set office=Office 2003 Professional
echo =======================================
echo Checking if %office% is installed
echo =======================================
If Exist "%PROGRAMFILES%\Microsoft Office" Goto skip_office

echo *************************************************
echo Installation of %office%
echo *************************************************
echo.
echo Now Starting %office% installation...
start /wait \\servername\software\microsoft\office\Office2k3Pro\PRO11.MSI PIDKEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
echo Finished Installing %office%
echo Finished Installing %office% >>%SystemRoot%\setuplog4.log
echo.
echo. >>%SystemRoot%\setuplog4.log
Goto end

:skip_office
echo %office% is already installed, skipping install
echo %office% is already installed, skipping install >>%SystemRoot%\setuplog4.log
echo.
echo. >>%SystemRoot%\setuplog4.log
Goto end

:end
echo Installation Complete

set winzip=WinZip 11.1
echo =======================================
echo Checking if %winzip% is installed
echo =======================================
If Exist "%PROGRAMFILES%\winzip" Goto skip_winzip

echo *************************************************
echo Installation of %winzip%
echo *************************************************
echo.
echo Now Starting %winzip% installation...
MSIEXEC /I \\servername\software\winzip\winzip111.msi allusers=true installcmd="/noqp /noc4u /notip /nopredefinedjobs /autoinstall" installdir="%programfiles%\WinZip" /QB
xcopy /h /e /d /y /c "\\servername\software\winzip\WinZip.wzmul" "%allusersprofile%\Application Data\winzip\"
echo Finished Installing %winzip%
echo Finished Installing %winzip% >>%SystemRoot%\setuplog5.log
echo.
echo. >>%SystemRoot%\setuplog5.log
Goto end

:skip_winzip
echo %winzip% is already installed, skipping install
echo %winzip% is already installed, skipping install >>%SystemRoot%\setuplog5.log
echo.
echo. >>%SystemRoot%\setuplog5.log
Goto end

:end
pause

I replaced a few paths so hopefully I didnt mess anything up too bad to recognize.
It's not perfect but it works. This one is just for XP, you can also use something like this to determine which os and proceed from there.
Code:
@echo off
ECHO If on Vista, please right-click and Run As Administrator.
pause

ver | find "Version 5.1." > nul
if %ERRORLEVEL% == 0 goto WINXP
ver | find "Version 6.0." > nul
if %ERRORLEVEL% == 0 goto vista
ECHO Cannot determine Operating System, please run the script for your OS manually.
pause
goto end
 
Well, I'm not going to install the software via WAN links, that's for sure, lol.

I want the installations to be done locally, with as little user interaction as possible. I feel like I can accomplish all of this without the use of paying for software, so batch scripting right now is really appealing to me. I might work with vbscript, but I don't know...

We're only a small workgroup right now, and device rarely go down. Our real work computers are on a virtualized environment (VDI), so any machine will do, really.



Regarding the printer batch file, I haven't created it yet, but I will outline what it will do:

1. Export two registry keys to create the standard TCP/IP printer ports: [HKEY_LOCAL_MACHINE\SYSTEM\CONTROLSET001\CONTROL\PRINT\MONITORS\STANDARD TCP/IP PORTS\PORTS] and [HKEY_LOCAL_MACHINE\SYSTEM\CURRENTCONTROLSET\CONTROL\PRINT\MONITORS\STANDARD TCP/IP PORTS\PORTS]

2. Stop/Start the printer spooler service [net stop service] and [net start service] so the newly created Standard TCP/IP ports get recognized.

3. Run the following command: rundll32 printui.dll,PrintUIEntry /if /b "Printer Display Name (i.e. 1st Floor Printer )" /f %windir%\inf\ntprint.inf /r "IP_192.168.1.100" /m "Printer Driver (i.e. HP LaserJet 4000 Series PCL6)" /Z


That should take care of my printers, at least for the HP LJ section. I will incorporate the Savin printer somehow.




Thank you all for your suggestions :D
 
Once I have out a layout for what I want, I'll post it here.

I already modified a config.xml file for my MS Office 2007 deployment as a batch file, but it will be installed from a UNC shared drive.

NLITE will allow me to include registry keys during the silent installation of Windows XP (SP3 slipstreamed), and I think I can run batch files after the installation, but I am not counting on that since I'd rather just run them by hand and just add a CALL to more.
 
Back
Top