Case study - automated installation of microsoft office 2007

In this case study, the customer had no management system and wanted to deploy Microsoft Office 2007 to all computers in the domain and pre-configure the user setup process.

A dedicated install domain admin account is used to install the product. This account could also be an account that has local admin rights on all clients and read access to the setup files. It is safe to use the account in the logon script, as passwords are always encrypted in FastTrack scripts.

Automated installation of Office 2007

Case Study Note

Case Studies are provided to FastTrack Software by customers and are provided as-is. All case studies are unedited except from in most cases having actual company name, domain names, account names and server names replaced by fictitious names from a fictitious company named Acme. Please use our Contact Form, if you are interested in submitting an anonymous case study.

Step 1 - Create unattended setup file for Microsoft Office 2007

All the setup files for Microsoft Office 2007 are in this example located in a directory named Office2007 on a hidden share named \\AcmeServer\Installers$, where only domain admins have access. Refer to Microsoft Technet on Office 2007 deployment for more information on customization.

A new file (listed below) is created as \\AcmeServer\Installers$\Office2007\Acme.xml to remove the office setup GUI during installation and a license key is provided. The PIDKEY must be replaced by a valid license key.
File \\AcmeServer\Installers$\Office2007\Acme.xml

<Configuration Product="Standard">

  <Display Level="None" CompletionNotice="no" SuppressModal="yes" AcceptEula="yes" />



Step 2 - create an install script to execute installation as a domain admin

In the setup folder, one additional file is created to perform and register the actual installation. This script will be launched from the logon script in the context of a domain admin. The script shows a splash screen while installing and on successful installation, it will make a local registration, making it possible to query, if there is an office installation, so user settings can be set in the users' context. This script could easily be expanded to make per-machine modifications.
File \\AcmeServer\Installers$\Office2007\Install.fsh

Splash Installing Microsoft Office,Please wait...


Run Setup.Exe,/Config Acme.xml


If [LastExitCode]=0 Or [LastExitCode]=3010 Then RegisterInstallation Microsoft Office,2007,1

Step 3 - execute the script from the logon script

As part of the prelogon.fsh logon script, that executes before the explorer process starts, it is tested whether or not a RegisterInstallation command on Microsoft Office has ever been issued on the machine. If not, the step 2 installation script is executed in the context of the domain admin user "Installer" in the "Acme" domain, if there is more than 20GB of available disk space.

If the Install.Fsh issues a "RegisterInstallation Microsoft Office,2007,1", the installation was successful and the condition "If UserSettingsOnce Microsoft Office Then" will yield true once in the executing user's context.

Effectively, if Microsoft Office is successfully installed on the computer, these steps will be performed once for every user logging on to the computer:
  • A shortcut to Word and Excel will be copied to the user's desktop. The user can then freely delete them if he/she wants to.
  • The initials and full user name are copied from the domain information to ensure that documents are stamped with the correct user information.
  • An outlook profile is created using newprof.exe from the office resource kit.
In this case the customer has used the resource kit util NewProf.exe and two PRF files and placed them in fshbin folder on the netlogon share. Another way of importing a PRF file is to set registry keys and point outlook to the prf file, which will import it when Outlook is run the first time as described in this technet article. The customer has different setups for desktop and portable computers and the correct one is selected using the "If Portable" condition. A template PRF file is copied to a temporary file and the users' initials and mailbox name is then set before import.
Part of file \\Acme\Netlogon\Fshbin\Prelogon.fsh


If Not Installed Microsoft Office Then


  If [FreeDiskSpace]<20 Then

    ShowMessage "Microsoft Office 2007 must installed on your computer, but you do not have enough _

      available diskspace.[Return][Return]Please contact the IT department."


    RunScript \\AcmeServer\Installers$\Office2007\Install.fsh,Acme\Installer,TKtDV6ZmtLadiz/Kw==

    If Installed Microsoft Office Then

      ShowMessage "Microsoft Office 2007 is now installed under "Microsoft Office" in your start menu. _

         A shortcut to Excel and Word will be placed on your desktop.[Return][Return]Press "OK" to continue."

    End If

  End If

End If



If UserSettingsOnce Microsoft Office Then

  ''Copy word and excel shortcuts to users' desktop

  CopyFile [StartMenuDir]\Programs\Microsoft Office\Microsoft Office Word 2007.lnk, [UserDesktopDir]\Word 2007.lnk

  CopyFile [StartMenuDir]\Programs\Microsoft Office\Microsoft Office Excel 2007.lnk, [UserDesktopDir]\Excel 2007.lnk


  ''Set default user name to domain name

  WriteRegistry HKCU\Software\Microsoft\Office\Common\UserInfo\UserInitials,[UserName]

  WriteRegistry HKCU\Software\Microsoft\Office\Common\UserInfo\UserName,[UserFullName]

  WriteRegistry HKCU\Software\Microsoft\Office\Common\UserInfo\Company,Acme Corp


  ''Remove pop-up

  WriteRegistry HKCU\Software\Microsoft\Office\12.0\Common\General\ShownOptIn,1,REG_DWORD


  ''Run newprof for automatic Outlook profile setup

  SetVar TempFile,[TempFile]

  IF Portable Then

    CopyFile Portable.PRF,[Var TempFile]


    CopyFile Desktop.PRF,[Var TempFile]

  End If

  WriteINI [Var TempFile],General,ProfileName,[Username]

  WriteINI [Var TempFile],Service2,MailboxName,[UserFullName]

  Run NewProf.Exe,-x -p [Var TempFile]

  DeleteFile [Var TempFile]

End If

The result

The first time a domain user log on to a computer that does not already have Microsoft Office 2007, he/she will see this while the installation is in progress. When the installation is complete, the explorer process will start and the user will have Word and Excel icon on the desktop.

Microsoft Office 2007 installation

Rating: 5 out of 5

"Use this as a replacement for VBScript and PowerShell"

"It's easy to include attractive GUI elements in FastTrack scripts, beyond the basic dialog boxes and text input that VBScript offers ... Another powerful feature is the ability to distribute scripts as Windows Installer (.msi) or standard .exe files. Although interesting in its own right, this ability results in a much more intriguing capability: to repackage -- or wrap -- software installers as .msi files without using snapshots. If you've ever created an .msi installer file from before-and-after system snapshots, for use with a software distribution system such as Group Policy or SCCM, then you know how hit-and-miss the results can be."

Read full review

Rating: 8 out of 10

"Faster than the rest"

"We found the FastTrack syntax to be more transparent and easier to learn than Microsoft's PowerShell – the editor in particular provided good support in this regard. the Script Editor offers a large number of options from the command set through to simple output of graphical elements, which cannot be achieved at all with PowerShell or other solutions or only with a significantly greater level of effort."

"Anyone wanting to tackle the many hurdles in everyday admin and especially anyone for whom logon scripts and client automation is a priority will benefit from the variety of functions offered by FastTrack."

Review in English      Review in German