Customizing Wizards with MDT 2012

Many of you have customized the MDT 2010 wizards, and I expect that will be fairly common with MDT 2012 as well – after all, one of the design goals with having HTA-based wizards is to enable customization by creative IT pros. But the process is going to be slightly different with MDT 2012.

First, let’s review the basic process most of you would go through with MDT 2010:

Download the MDT Wizard Editor from http://mdtwizardeditor.codeplex.com/. This makes editing the wizard simpler (although not necessarily trivial – there can still be a fair amount of work to do, depending on the extent of the changes that you intend to make).

Open the “DeployWiz_Definition_ENU.xml” file and make the necessary changes: Adding new panes, changing the HTML and properties of existing pane, etc.

Using Notepad or any other text editor, add any custom scripting to DeployWiz_Initialization.vbs or DeployWiz_Validation.vbs.

Test out all the changes using the MDT Wizard Editor, or if this isn’t possible (due to conditions on the wizard pane or logic contained in the pane itself) drop the changed files into the deployment share and try a deployment.

So it’s quite reasonable for you to try the same thing with MDT 2012. But you’ll quickly discover that you can’t get very far. You can open the file, but as soon as you click on one of the wizard panes in the left-hand column, you get this exception:

So what causes this? Well, if you look at the files in the deployment share, you’ll notice that there are quite a few more that start with “DeployWiz”. That’s because the entire wizard has been restructured. Instead of having one set of large files (DeployWiz_Definition_ENU.xml, DeployWiz_Initialization.vbs, DeployWiz_Validation.vbs), there are now separate files for each wizard pane (e.g. DeployWiz_ComputerName.xml and DeployWiz_ComputerName.vbs). The original files (DeployWiz_Definition_ENU.xml, etc.) are still around, but are much smaller – the bulk of the content has been separated out.

Why was this done? Mainly because it makes the wizard code much easier to maintain. It’s now much more obvious what script pieces are used for which wizard panes. Additionally, it makes the wizard easier to test, as you can work on a single pane at a time without worrying about breaking another unrelated pane.

The individual panes are then tied together by the DeployWiz_Definiton_ENU.xml file. If you look at this file, you’ll see that it’s pretty short, with entries like this:

All that is there is a reference (or link) to the separate files for each wizard pane, along with the conditions for when each wizard pane should be displayed. (This helps with the testing as well: By keeping the conditions in the DeployWiz_Definition_ENU.xml file instead of in the individual wizard files, those conditions don’t get in the way of “offline testing”, e.g. running just that one single wizard pane without going through a full deployment.)

So why does that cause problems with the Wizard Editor? Simple: It doesn’t understand that the wizard pane body is in a separate file. It can’t follow the reference link (highlighted in yellow above) to the separate wizard pieces. So does that mean the Wizard Editor is no longer useful? Not at all – you can still use it to work on (and test) individual pages like DeployWiz_ComputerName.xml:

But you’ll need to edit the DeployWiz_Definition_ENU.xml file by hand.

I’m working on a new version of the Wizard Editor in my “free time” so that it learns how to follow these links (with other improvements added in too), but it might take a while before I can complete that work.

So what does the recommended workflow look like if you wanted to add a new wizard pane to MDT 2012? Here are the basics:

Make a copy of files for one of the wizard pane files. For example, copy DeployWiz_AdminPassword.xml as “MyPane.xml” and DeployWiz_AdminPassword.vbs as “MyPane.vbs”.

Use the Wizard Editor to customize and test the new wizard pane.

When you are happy with the functionality of the new wizard pane, add an entry for it into DeployWiz_Definition_ENU.xml (just like all the others, with any conditions that you might need), then test it out as part of a normal deployment.

This new flow has another advantage too: It makes it much easier to integrate a new wizard pane into MDT. You don’t have to worry about reintegrating your changes into the “big” XML file each time you upgrade MDT – your separate files will continue to exist, untouched, so all you will need to do is add the “link” into DeployWiz_Definition_ENU.xml again and you’re good to go.

Michael, I have been trying to migrate our custom scripts from 2010 to 2012. We have a SQL Database where we store all the assett information by serial number. Therefore we need to read this SQL DB from the Deployment wizard so that we can get the computer name to use and other information.

While doing this I have hit on the infamous Access Data Across Domains issue where my SQL query doesn't work from an HTA form. The way we did in MDT2010 (that was done by somebody else) was to run the SQL Query outside the HTA but it is messy and I wanted to improve it.

Working very hard on this problem for the last two days I found an "hack". If I set the registry settings in WinPE as IE would if I set it to enable data across domains then my SQL Query works within the HTA form. The problem I have is that I need to set the registry before the HTA gets launched and this happen within the Litetouch.wsf script. So I have done that – I have wrote a few lines to set the registry with the value 1406 set to 0 just before Wizard.HTA starts and it works beautifully.

But I don't like this approach very much because everytime there will be an update to MDT I will have to remember to check and possibly modify the new Litetouch.wsf script in addition to my customisation to DeployWiz_Definition_ENU.xml. But this allows me to cutomise the deployment wizard much more elegantly than before. I am pretty sure I am not the only one who needs to read some data on a SQL database at build time and it would be great if it was a standard feature.

Curious if anyone has done this already using MDT 2012. I want to popup a "Please Wait" dialog when the user clicks the next button in the wizard. Right now it takes time to go from pane to pane and it looks like nothing is happening… anyone have any suggestions or solutions??

Hi, in MDT 2010, I added code to Summary_scripts.vbs to do some processing and send out a status email. I was calling out to different properties like a custom one: Property("ETRWIMImage") to report the information in the email. Now, in MDT 2012, I'm no longer able to grab these properties from within Summary_scripts.vbs, all property values come back empty. What can I do to make it work again?