How MDT uses XML to install Applications

Deployment

Have you ever thought about what actually happens when you import applications into your MDT environment? How does the task sequence know what application to install? How does it know what command-line arguments to specify during the application install process?



Technically, as a user, all that is required of us is to simply import the application, add an “Install Application” step in the task sequence, and select the appropriate application. But what actually happens during the deployment to get the application to install? Well, let’s take a peek behind the curtain to find out.

Firstly, let’s take a look at where the application information is stored after the app is imported into MDT. The applications.xml file contains the information of every application that exists in your MDT environment. So, essentially, if you can see it in your Deployment Workbench, then there is a corresponding entry in this XML file.

This file is located at %DeployRoot%\Control\Applications.xml and although we can easily view it in a browser, I want to show how we can explore the document using powershell. As you can see below, we can view the contents of the document by using the Select-Xml cmdlet. For this demo I decided to find a specific application using an XPath query.

MBAMPosh_Edited

Note: I will focus on fully explaining how to use XPath to query XML files for information in a later series of posts.

Secondly, I want to take a look at what application info is stored in the task sequence and how it communicates with the XML file during the deployment process. The image below shows what the task sequence(ts.xml) looks like after I added an “Install Application” step and selected “Install a single application”. You can see that only the application GUID gets stored in the task sequence.

SampleTS_Edited

So how does it get the application name and the command-line arguments? Take a look below.

ZTIApplicationsScriptFlow

Generally speaking, the ZTIApplications.wsf script will do three things. First it will get the application GUID from the task sequence and/or the customsettings.ini file (If you have specified multiple Mandatory Applications to be installed). Then it will parse the applications.xml file and find the application that corresponds to the GUID. Once the application is found, it can return the name and the command-line arguments to be used for the install process. Below is a snippet from the ZTIApplications.log file.

ZTIApplicationsLog

 

You can see that it was able to use the MalwareBytes GUID from the task sequence and find the corresponding entry in the XML file. Once that was taken care of, the easy part was to get the app name and commands to perform the install.

 

Source

No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Deployment
MDT – Joining a Computer to a Domain Using PowerShell

Using PowerShell scripts within a task sequence provides more flexibility than using the CustomSettings.ini file to join a computer to a domain. The parameters of the CustomSettings.ini file are common to any deployment you perform. That’s why creating a custom PowerShell script to join your domain will be customize to …

Deployment
Task Sequence Tasks Explained

This document explains the tasks that you will find in standard task sequence. Initialization > Gather local only – gathers deployment configuration settings from local sources that apply to the target computer [ZTIGather.wsf] Validation > Validate – verifies that the target computer meets the specified deployment requirement conditions. Such as …

Deployment
MDT – Working towards Zero Touch Installation

The aim of this is to create a deployment that once started will finish without any further intervention. Step 1 – Create the Perfect task Sequence Before we start the process, we assume that you have tested your deployment process and you are able to deploy operating system as required. …