At the end of this article, you should be able to create a single NT deployment portal or DS6.9 job that will install software for multiple sites and automatically pick the correct installation source. I was holding out for NS7 to see if Altirs would add this functionality but alas, no dice.
At each one of our 30 schools, we have a local server that houses PXE functionality, remote wakeup proxy, and a large D drive which houses an "Express" share where all our software goes. These boxes are HP 5850's running Server 2003 OS because there are times when more than 10 computers need to access its express share at the same time. (30 computer lab install). We refer to them as PXE server even though their primary role is a software installation source.
In the attached zip file, you'll find 3 scripts.
- IPtopath.cmd should be placed on your master installation source. For us that would be the express share on DS1 (SMDS1). \\smds1\express\scripts\iptopath.cmd
- SoftwareInstalling.hta is optional and is used to inform your clients that installations are occurring. If you'd like to use it, place it in the same folder as iptopath.cmd
- Script job template needs to be opened in notepad, all the contents copied, and then placed in a new script job using your DS console or using the NS manage->jobs and tasks Be sure to change the credentials that it runs as so that it has rights to access the package server express shares.
- script job template msi is the same as the previous but it's for msi installations instead of svs layers.
Walkthrough of the script job template:
Your packagers really only need to edit the first couple lines of code in order to get a new package job working. But you'll need to fix my script with the proper paths for your organization. It's designed to be duplicated into a new job and renamed when you need a new task. This is a template after all.
Rem Install Layer X - this line will show up in DS6.9 as information about what the script is doing. It does not show up anywhere in NS7 deployment portal. It's more of an FYI line.
Layerpath is the first important line. You'll want to specify the path to your vsa file or your .msi file without specifying the name of the server Every one of our PXE servers have an express share and their file structure is identical.
Layer name is the name of the layer that SVS needs to have to activate the job. You can look up this name be loading the vsa file in the svs admin console or using the command "svscmd enum" on the command prompt of a client who has the layer installed.
Set Displaymessage to 1 if you want the user to be notified of the software installation. The name of the software is what you type in the friendly name parameter.
Set IPAddress=%AgentIPAddress" is the cue to altirs to insert the ip address of the client. This ip address is then stored in the IPADDRESS variable.
Next we call the iptopath.cmd file which can natively get the ipaddress we stored in the variable in the previous step.
->Switching to iptopath.cmd
The first line splits the ip address into it's 4 octets and stores them in variables oct1 - oct4
The rest is a bunch of if statements that branch to different package servers in our district and the store the path to the correct server in the variable PXEPATH
DISP is the ip address of the DS I want the DS agent on our image to connect to after sysprep. It requires windows pe scripting code which I won't cover here. You can remove these lines if you like.
I have told this script to exit with an error of 3000 if the client ip address doesn't match a supported range.
->Switching back to the script job template
AFter returning, the job then checks for an error code of 1 or higher. If it gets the mentioned 3000 error code it will exit and return that error to the DS/NS
If not exist %PXEPath%\%LayerPath% This line makes sure the vsa file or msi file exists on the local package server. If not it returns error 3001 so you know you need to fix your installation source or a typo.
if %displaymessage%: This part sees if you want to display the installation message and then does so or skips to placeholder "NOMESSAGE" if you don't want to.
echo ^app^> etc... This line actually builds an xml file called appname.xml which is then read by softwareinstalling.hta. Apparently >< symbols are reserved in the cmd language and so ^ is necessary as an escape character. This makes for a really ugly line of code but it does work. The final > is the redirect command that dumps the echo output to the appname.xml file.
The last few lines are the commands to actually do the installation. The EXITGRACEFUL command was needed because I wanted it to return the real error code and still close the installation message if you are using it. I found that if I tried to use the taskkill command, it would erase the return code of svscmd so I had to preserve it first before using taskkill.
Issues:
On Windows XP SP3 mshta.exe has some issues. Sometimes it only loads up a menu bar with no contents. I have not been able to make this work consistently and so generally we don't use the installation messages. Also, if you run this on a machine where nobody is logged on, it cannot start mshta and therefore cannot taskkill it at the end. The trouble is that it queues up the command and waits for the next person to log on. So on the next logon, someone will get the software installing message but it will never go away since taskkill has already been called.
Development:
Supposedly NS7 has the ability to capture output from a script task to use as a progress update. My scripting tasks don't currently provide any method of status update. It's just done when it's done. Usually you can gauge how long it will take based on prior installations but I'd like to try and implement this feature in the future.