Contact

 
Google
Web www.alanphipps.com

     
     
     
   
www.alanphipps.com

.: Windows Application Deployment - Outlook Install CD

 
 

In the case where a PC was not on the domain and hence the deployment could not be initiated by logon script, an installation CD was posted to the client. This CD contained all the files necessary to install and configure MS Outlook 2003 with no more interaction other than placing the CD in the Drive. This CD was built as described below:

Step 1 - Create the Outlook Package

Using the files from the MS Office CD you must first create the Installation package to be used for the CD. Obviously not all the Office files are necessary, a complete list of all files necessary to install outlook can be found here. Once all files have been copied to a separate folder you can then create the Outlook Transforms file that will automatically configure the installation, this can be done as shown here. Lastly, you must create a PRF file that will configure such settings as the default Exchange server and Cached Exchange Mode, again this can be done as shown here.

The other files that will be necessary for the installation are:

 

Now that all the files are ready, store them in the folder and move on to step 2.

 

Step 2 - Create the Self-Extracting Compressed file that holds the Outlook Files.

After much trial and error, i found that running the install directly from the CD caused too many errors, so i decided to create a Self-Extracting Zip file that would copy the installation files to the PC's temporary folder and run the install from there. Using your favourite compression program, which for me is WinRAR, create the SFX zip files as follows:

One SFX file called Laptop.exe should be created for a laptop installation using SetupLaptop.exe and the Laptop MST, another should be built for a desktop with SetupDesktop.exe and the Desktop MST file, this file should be called Desktop.exe

Create a folder called Outlook which contains the following files:

OutlookCD - Outlook Folder

In case you missed it, the PRF file can be created here and the MST file can be created here. With WinRAR, WinZip or another Zip program installed, right-click on the outlook folder and select "Add to Archive" or equivalent:

Outlook CD - WinRAR Archive General Options

Create a SFX Archive, press Advanced.

Outlook CD - Archive Options

Press SFX Options.

Outlook CD - SFX Options

Create as Above and press advanced.

Outlook CD - SFX Options

Configure as above, press Modes

Outlook CD - SFX Options

Configure as above, press Text and Icon.

outlook CD - SFX Options

This part is optional, here you can change the title of the window and choose an icon for the SFX file. The other 2 tabs are not necessary and can be left at their defaults. Press OK.

Outlook CD - Build SFX File

Press OK and WinRAR will create the SFX file.

Outlook CD - Desktop.exe created

Create another SFX file for Laptops using the SetupLaptop.exe file and the laptop MST file and add them to the Outlook CD folder. Now you need to build the Scripts.

 

Step 3 - Create the Scripts that Installs the Package

By now you should have an Outlook CD folder that contains the following files:

Outlook CD - Create Scripts

We will now write the scripts that tie everything together.

1 - Autorun.inf

Used by windows to start a cd.

[autorun]
OPEN=Autorun.bat

2 - Autorun.bat

This script checks for a previous successful installation and if found apply's the PRF file. It then checks that it can ping the SMTP server so that the install can be logged, if the ping is unsuccessful then the script ends. If the ping was successful the script prompts the user to decide whether they want to install outlook or not, If yes the install continues, if no the install exits. The decision on whether a computer is a laptop or desktop is decided by the existence of the windows battery driver C:\Windows\System\Drivers\Battc.sys. Lastly the script starts processCheck.vbs which will watch for the end of the install and email the result to a pre-configured mail box.

@ECHO off

IF Exist "C:\Program Files\Microsoft Office\DHLOutlookInstallSuccess.txt" Goto AlreadyInstalled

ECHO Installing Outlook 2003 SP1 - Version 3.1

IF Exist "%Temp%\00temp12.tmp" Erase /q "%Temp%\00temp12.tmp"
IF Exist "%Temp%\00temp13.tmp" Erase /q "%Temp%\00temp13.tmp"

start /wait .\IsNetworkReady.vbs
.\Sleep.exe 2
IF NOT Exist "%Temp%\00temp12.tmp" Goto End

start /wait .\UserChoice.vbs
.\Sleep.exe 2
IF Exist "%Temp%\00temp13.tmp" Goto End

IF Exist "%ProgramFiles%\Microsoft Office\Office11\Outlook.exe" Goto OutlookExists

ECHO Please Wait...

IF Exist "%Windir%\System32\Drivers\Battc.sys" Goto Laptop

copy /y .\Sleep.exe %Temp%
copy /y .\CompletionNotice.vbs %Temp%
copy /y .\Outlook_GCC.prf %Temp%
copy /y .\ApplyPRF.bat %Temp%
copy /y .\Cleanup.bat %Temp%
.\Desktop.exe
Goto End

:Laptop

copy /y .\Sleep.exe %Temp%
copy /y .\CompletionNotice.vbs %Temp%
copy /y .\Outlook_GCC.prf %Temp%
copy /y .\ApplyPRF.bat %Temp%
copy /y .\Cleanup.bat %Temp%
.\Laptop.exe
Goto End

:OutlookExists

Copy /y .\Outlook_GCC.prf %Temp%

"%ProgramFiles%\Microsoft Office\Office11\Outlook.exe" /importprf %Temp%\Outlook_GCC.prf

Goto End

:AlreadyInstalled

Start .\AlreadyInstalled.vbs

:END

Start .\ProcessCheckCD.vbs

Exit

 

3 - AlreadyInstalled.vbs

Displays a message that outlook has already been installed.

MsgBox "Outlook has already been Installed", vbOKOnly

WScript.Quit

 

4 - ApplyPRF.bat

If outlook is allready installed then this script applies the pre-configured PRF file

@ECHO off

"%ProgramFiles%\Microsoft Office\Office11\Outlook.exe" /importprf "%Temp%\Outlook_GCC.prf"

"%Temp%\CompletionNotice.vbs"

Exit

 

5 - CompletionNotice.vbs

Displays a message that the installation is complete but the user should not close the window yet.

MsgBox "The Black Command Window, will remain open until you exit outlook. Please do not Close the Command Window " & _
"Manually. The Command window can however be minimized.", VBOkOnly + vbInformation, "Outlook 2003 SP1 Setup - Version 3.0"

WScript.Quit

 

6 - CleanUp.bat

Deletes the installation files.

@ECHO off

%Temp%\Sleep.exe 3
RD /S /Q %Temp%\Outlook
Erase /Q %Temp%\ApplyPRF.bat
Erase /Q %Temp%\Outlook_GCC.prf
Erase /Q %Temp%\Sleep.exe

Exit

 

7 - IsNetworkReady.vbs

Pings the SMTP Server IP Aaddress and if unsuccessfull, displays a message asking the user to connect to the network, if successfull the install will continue. Remember to change SMTPServerIPAddress to your network's SMTP server's IP Address

Option Explicit

Dim UserChoice, FSO, WSH, IntStr4, AllText, TempDir, Windir, CMD, UserName
Dim PingPath, RunPing, OpenFile, CreateFile

Set FSO = CreateObject("Scripting.FileSystemObject")
Set WSH = WScript.CreateObject("WScript.Shell")
TempDir = WSH.ExpandEnvironmentStrings("%Temp%")
UserName = WSH.ExpandEnvironmentStrings("%UserName%")
WinDir = WSH.ExpandEnvironmentStrings("%WinDir%")
CMD = WSH.ExpandEnvironmentStrings("%Comspec% /C ")

PingPath = WinDir & "\System32\Ping.exe SMTPServerIPAddress "

RunPing = WSH.Run(CMD & PingPath & "> %Temp%\0123456789.tmp", 0, True)

WScript.Sleep 1000

Set OpenFile = FSO.OpenTextFile(TempDir & "\0123456789.tmp", 1)
AllText = OpenFile.ReadAll
OpenFile.Close

IntStr4 = Instr(1, AllText, "Reply from SMTPServerIPAddress: bytes=32 time", 1)

If IntStr4 = 0 Then
MsgBox "Unable to contact Prague SMTP Server - Please Ensure that You are Connected to The Network and Restart The Installation.", vbOKOnly + vbExclamation, "Network Error"
Delvars()
Else
Set CreateFile = FSO.CreateTextFile(TempDir & "\00Temp12.tmp", True)
CreateFile.Close
End IF

Function DelVars

Set UserChoice=Nothing
Set FSO=NOthing
Set WSH=Nothing
Set IntStr4=Nothing
Set AllText=Nothing

End Function

 

8 - ProcessCheck.vbs

Change the value for your SMTP Server IP Address. Create the mail boxes to receive the emails and change the Email addresses in the script to reflect this. This script emails the result of the install to a these Exchange mail boxes.

'**Start Encode**

On Error Resume Next

Dim Counter, FSO, FileExist, WSH, CompName, UserName, Sendmail

Set FSO = CreateObject("Scripting.FileSystemObject")
Set WSH = WScript.CreateObject("WScript.Shell")

CompName = WSH.ExpandEnvironmentStrings("%ComputerName%")
UserName = WSH.ExpandEnvironmentStrings("%UserName%")

Counter = 1

Do While Counter < 1800
WSCript.Sleep 10000

FileExist = FSO.FileExists("C:\Program Files\Microsoft Office\Office11\Outlook.exe")

Counter = counter + 1

IF FileExist = True Then
Counter = 1800
End If

Loop

IF FileExist = False Then

Set SendMail = CreateObject("CDO.Message")
SendMail.From = "Email.Address@domain.com"
SendMail.To = "Email.Address@Domain.com"
SendMail.Subject = "Install Failure - " & UserName & " - " & CompName
SendMail.TextBody = "Outlook not been installed"
SendMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
SendMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "SMTPServerIPAddress"
SendMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = "25"
SendMail.Configuration.Fields.Update
SendMail.Send

End IF

IF FileExist = True then

Set SendMail = CreateObject("CDO.Message")
SendMail.From = "Email.Address@domain.com"
SendMail.To = "Email.Address@Domain.com"
SendMail.Subject = "Install Success - " & UserName & " - " & CompName
SendMail.TextBody = "Outlook has been Installed Correctly."
SendMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
SendMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "SMTPServerIPAddres"
SendMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = "25"
SendMail.Configuration.Fields.Update
SendMail.Send

End IF

WScript.quit

 

8 - UserChoice.vbs

A simple Yes/No box that creates a file if no is pressed. The existence of this file will then stop the Install.

Dim UserChoice, FSO, WSH, TempDir, CreateFile

Set FSO = CreateObject("Scripting.FileSystemObject")
Set WSH = WScript.CreateObject("WScript.Shell")

TempDir = WSH.ExpandEnvironmentStrings("%Temp%")

UserChoice = MsgBox("Would You Like To Install Outlook 2003 SP1 ?", VBOkCancel, "Outlook 2003 SP1 Setup - Version 3.1")

IF UserChoice = vbCancel Then
Set CreateFile = FSO.CreateTextFile(TempDir & "\00temp13.tmp", True)
CreateFile.Close
WScript.Quit
End IF

 

Once all files are created then your Outlook folder should look like this:

Outlook CD - Complete

It is not necessary to include the Outlook Installtion files as they will be included in Desktop.exe and Laptop.exe, however i found that if there is a problem it is useful for the files to be easily accessible to you, so that you can repair the installation.

it is also important to note that CD Autorun must be enabled in Group Policy As Shown below, otherwise the user will have to start the installation by clicking on Autorun.bat

Outlook CD - Autoplay in Group Policy

Congratulations, your Outlook install CD is now complete and ready to be written to CD.

All Done.

To learn how to Install Outlook via a server deployment, click here.

     
 
 
     

 

Web site contents © Copyright Alan Phipps 2006, All rights reserved.

Website templates
   
 
 

 

__PayPal

 
Please Donate to the Nvidia Geforce Go 7950 GTX Fund, All donations welcome. Thanks.