In this tutorial I will demonstrate how to use the Office Deployment Tool (ODT) to create an Office 2016 package that can be streamed to client computers using Microsoft’s Application Virtualisation.
First, a word on Application Virtualisation — more commonly known as App-V. App-V is Microsoft’s solution to deploying and maintaining application packages for programs that need to be deployed to large numbers of computers in an enterprise or cannot be deployed using conventional methods. An example of this may be an application which does not ship with a MSI installer to push out with Group Policy. Unlike most applications, in which an administrator must install on the App-V sequencer to create the .appv package, Microsoft has provided us with an easy way to create and maintain App-V packages for Office without first installing from the MSI to capture the installation. This is where ODT comes into play.
The Office Deployment Tool is available for download from Microsoft’s website. It is a small executable file which extracts two other files to a location of your choosing. I saved it in a subfolder of my software distribution share, \\hq.jacobhouse.ca\software\office. I suggest you do the same since the packages this tool will create need to be accessible by clients.
Extract the tool by running the executable you downloaded and choosing a location for the files, for example \\hq.jacobhouse.ca\software\office\ODT. You will now need to map this shared folder to a drive letter so that you can open a command prompt there — cmd.exe does not support UNC paths. Going forward, my N:\ drive will reference this path.
To map the network path on your own computer, run the following command, replacing my share path with your own.
Next, open the extracted XML file in the text editor of your choice. Later in this tutorial you will need a proper text editor — Notepad.exe won’t cut it — but for now you may use Notepad.
There are a couple of things that you will need to customise in this file based on your environment and Office licencing agreement.
Should specify a download location for the Office files. Change it to something like is shown below.
Below this you will need to add a <Product> field for each Office suite you are deploying. The options are Office, Visio and Project. This is important because ODT will create a single package for all of your programs and you cannot publish more than one Office package (one containing Office and the other with Visio, for example) to a single computer. Below this, customise the display level and update preference. We will be manually updating the package so set updates to false.
The finished file should look something like this:
From your command prompt, run setup.exe to download the bits for Office from the Microsoft CDN. The downloaded files will measure nearly 1.5 GB.
Rerun setup.exe using the /packager parameter this time. This also requires you to specify the location to place the finished package. In the example below, configuration.xml is my XML file in the same directory as setup.exe and Package is a relative path to the directory where the App-V package will be saved.
When used with the /packager parameter, setup.exe invokes the program Flattener.exe which can easily be identified by the brightly-coloured text shown in the picture below. Flattener.exe is the program that compiles the bits that make up Office into the App-V package.
After the flattener exits, change to the Package\AppvPackages\ directory. This is where the App-V package is. There are also two XML files created by the flattener. Since Office can only be deployed globally on a machine, the machine configuration file is the one we will need, not the user configuration. Using a text editor like Notepad++, Atom, or Visual Studio Code, open the DeploymentConfig XML file. This file is used to configure the installation by modifying file-type associations, shortcuts, scripts, and which Office applications are enabled.
Adding program shortcuts is easy. Simply search the file for “.lnk” and you will find a section dedicated to creating start menu shortcuts for each of the programs. If you want to add another shortcut — to the desktop for example — just copy and paste the code, modifying the shortcut path of course.
To disable an application, search the file for the word “Application” until you see something like what is below. Find the program you want to disable and change “true” to “false”. The example below is how your XML would look if disabling Excel.
Immediately below the Applications section of the file is the User Scripts section. This is used to execute a program or script when an Office application is launched. An example may be to map a shared network drive when Publisher is opened so that users can work on shared documents. You can then close the connection when the application is closed in a similar manner.
Overwrite the existing XML file with your updated file. You can use a different name but this requires us to manually specify the configuration file when publishing the App-V package. If you use the default name the changes will be applied automatically.
There are many ways to deploy the finished App-V package: App-V Server, System Center Configuration Manager, or even using PowerShell. Since deployment is not within the scope of this tutorial, I will use PowerShell for its simplicity.
Open PowerShell ISE and create a new file. Copy and paste the following code, replacing my UNC path with your own.
This PowerShell script can then be deployed using Group Policy startup scripts or another method of your choice.