Todd Hemsell at myITforum.com

{Enter witty eye catching description here}

Microsoft Deployment Toolkit Wizard Editor : Part 1 : Introduction

The Microsoft Deployment Toolkit Wizard Editor (WizardEditor.exe) is a free open source program hosted on CodePlex.

WizardEditor is used to edit the XML definition files that define the dialogs that Wizard.hta displays and under what conditions they are displayed. Using the WizardEditor it is possible to build a custom Front End to interact with humans in your OS Deployment. The wizards it creates can be used in lite touch or with a TS in ConfigMgr/SCCM/CM. In this tutorial we will create a simple wizard that will run prior to our TS starting when booting to boot media in an SCCM OSD Deployment.

Screenshot of the MDT Wizard

Screencap of Wizard.hta running BDD_Welcome_ENU.xml

To get a better idea of how to use WizardEditor to create our own custom Front Ends we will need to go over how Wizard.hta interacts with the other files.  The following diagram shows how they tie together.

LiteTouchWizardFlow

LiteTouch.vbs Purpose: Start the lite touch deployment process

LiteTouch.vbs does two main things, it runs ZTIPrereq.vbs to ensure the machine meets the prerequisites and then it launches LiteTouch.wsf

LiteTouch.wsf Purpose: Drive the lite touch deployment process

LiteTouch.wsf performs quite a few functions. Everything from correcting drive letters to setting the deployment phase and finding the deployment root. The two main items we are concerned with is it runs ZTIGather.wsf to process the CustomSettings.ini file then it launches the Wizard.hta and specifies the Definition XML that the wizard will use.

Wizard.hta

Purpose: Display a wizard to the user Wizard.hta loads and processes the XML file.

DeployWiz_Definition_ENU.xml

the XML Definitions file defines what Wizard.hta displays and under what circumstances

DeployWiz_Initialization.vbs

Purpose: Initialize wizard panes used in the deployment wizard. This file contains the functions used by the “initialize” actions you specify in the definition xml file

DeployWIz_Validation.vbs

Purpose: Validate wizard panes used in the deployment wizard. This file contains the functions used by the “validate” actions you specify in the definition xml file

WizUtility.vbs

Purpose: Common Utility functions used by UI Scripts

General purpose scripts and files used. See MDT documentation for an explanation

  • CustomSettings.ini
  • ZTIUtility.vbs
  • ZTIGather.wsf
  • ZTIPrereq.vbs

If you want to follow along with this tutorial download the files I am starting with Front End Wizard Example.

Please note, line 465 of DeployWiz_Initialization.vbs was altered to make it load the TaskSequences.xml from the current directory rather than Control so do not use the included scripts except with this demo

   'Set oTSList = RemoveNonEnabledElements( Property("DeployRoot") & "\Control\TaskSequences.xml" )    
   Set oTSList = RemoveNonEnabledElements( "TaskSequences.xml" )

1.) Open WizardEditor.exe and browse to the definition file you want to edit

image


{insert text so I do not look too stupid if I post errors}

I need to say a few things at this point:

I am not  a professional developer. The target audience of this article is other Sys Admins. If you are a professional developer (or Maik) I have no doubt you will find errors in what follows. If you do see any and would like to help please send me a clarification or blog about it and send me the link and I will place a link to it here.

Links to corrections/explanations: {none so far}

My goal is to provide folks with enough information to get them started with a fundamental understanding of what is happening and what to do. I struggle with many of the concepts and code in these scripts so do not take anything that follows as fact, it is just “how Todd sees it today”.


Now that the Definition.xml  is loaded click the “Test” button in the WizardEditor. When you run a test the wizard editor will do a few things to get the environment ready for a test:

// Tell the user if there are pending changes that need to be saved first. (Tells you to save the XML file if you modified it)

// Clean up from previous execution (Deletes the log files from C:\MININT\SMSOSD\OSDLOGS)

// Run ZTIGather.wsf if it can be found 
        // Launch ZTIGather.wsf to get information about the current machine.  Have it shove in a few default
        // values too for DeploymentType, DeploymentMethod, and DeployRoot so that the wizard works better.

// Now run Wizard.hta if it can be found 
    // Make sure the required files are present in the same directory

    { "Wizard.hta", "Wizard.css", "WizUtility.vbs", "Wizard.ico", "BackButton.JPG", "ZTIUtility.vbs" }

    // Launch Wizard

Since it will run ZTIGather.wsf we will want to see  what CS.ini file it is using. to do this open the BDD.log in C:\MININT\SMSOSD\OSDLOGS and find the value

image

Now lets test the xml and see if it will load up before we make any changes. click the “Test” button. After running ZTIGather the wizard should load as shown below

image

If you cannot get it to run read the logs and try to determine the issue. Note: If you leave any of the logs open in Trace WizardEditor.exe will generate an error and exit. Make sure you do not have a handle on any of the files it needs before testing.

Next Post: Global Settings and Custom Initialization and Validation scripts.

Comments

ejensen said:

I have downloaded your FrontEndWizardExample.rar file and extracted it to my C drive (C:\FrontEndWizardExample\). I cannot get this first part to work, the wizard runs but says there are no task sequences availible (TaskSequences.xml does not exist, is empty, or is inaccessible).

here is the last few lines in my BDD.log file after running this.

----------------------------------------

Using DEFAULT VALUE: Ini file = C:\FrontEndWizardExample\CustomSettings.ini ZTIGather 10/14/2009 1:45:46 PM 0 (0x0000)

Added new custom property MYCUSTOMPROPERTY ZTIGather 10/14/2009 1:45:46 PM 0 (0x0000)

Skipping rules processing. ZTIGather 10/14/2009 1:45:46 PM 0 (0x0000)

ZTIGather processing completed successfully. ZTIGather 10/14/2009 1:45:46 PM 0 (0x0000)

Property WizardComplete is now = N Wizard 10/14/2009 1:45:46 PM 0 (0x0000)

Entered Function EvalWithErrorHandling With fn value of = UCASE(Property("SkipTaskSequence"))<>"YES" Wizard 10/14/2009 1:45:46 PM 0 (0x0000)

Error Handling Off, Calling Eval with a value of = UCASE(Property("SkipTaskSequence"))<>"YES" Wizard 10/14/2009 1:45:46 PM 0 (0x0000)

Back in Function EvalWithErrorHandling Wizard 10/14/2009 1:45:46 PM 0 (0x0000)

XMLDOM: File: \Control\TSID\TS.xml Line: 0

The system cannot find the path specified.

Wizard 10/14/2009 1:45:46 PM 0 (0x0000)

A VBScript Runtime Error has occurred:

Error: 424 = Object required

VBScript Code:

-------------------

InitializeTSList Wizard 10/14/2009 1:45:46 PM 0 (0x0000)

--------------------------

Any thoughts would be helpful.

I have also tried putting a \ in front of the TaskSequences.xml entry in the DeployWiz_Initialization.vbs script as noted above, but this does not help.

thanks,

Eric

# October 14, 2009 1:49 PM