You can click the ellipsis The Config. Review the configuration information for the Location box, including the following:. Unlocked button, with which you enable or disable the Location box. Default value box, in which you enter a default value to be displayed in the Location box. Friendly display name visible in summary page , in which you enter the caption for the information displayed on the Summary page.
Use the information in this guide and the source code in the examples to help you create your own UDI custom wizard pages and wizard page editors.
Table 1 lists the folders immediately beneath the SDK folder and provides a brief description of each. Before you begin creating your custom wizard pages and wizard page editors, perform the following tasks to prepare the UDI development environment:. A UDI wizard page has methods that correspond to each stage or phase of the life cycle of the page. As a part of creating your custom wizard page, you need to override these methods with your code. Table 2 lists the methods that you will need to override and provides a brief description of each method, including when to use the method in the wizard page life cycle.
Review the SamplePage example using the following list, which represents the sequence of events during the wizard page life cycle of the SamplePage example:. When the custom wizard page has collected the information, perform any tasks necessary before clicking Next to proceed to the next wizard as described in Step 4: The Next Button Is Clicked in the Custom Wizard Page.
The example uses the Config. In the example, two. In the example, two pages are defined: Custom and SummaryPage. In the example, the defined type is Microsoft. For your custom page, substitute the following to avoid any potential conflicts with other pages you may create in the future:. In the example, this function is implemented in the dllmain. Each wizard page you create must implement the RegisterFactories function. The RegisterFactories function is used to register the factory class of your wizard page with the class factory registry for the UDI Wizard.
Class factories are classes that can create an instance of another class. The RegisterFactories function creates a new instance of a factory class and passes that class to the class factory registry for the UDI Wizard, which makes that factory class available to the wizard.
LocationPage , which matches the Type attribute for the Page element in the Config. The name value provided using the Register function template must implement the iClassFactory interface. The ClassFactoryImpl Class handles most of the details for implementing a class factory.
You can also use the RegisterFactories function to register task types and validator types. For more information, see the following:. The example contains and registers only the one custom wizard page.
The example does not include custom tasks or validators and so does not register any custom tasks or validators. The custom wizard page in the example is defined in the LocationPage. Wizard pages are derived from template classes that provide much of the functionality a page has. Each wizard page can implement other optional template classes and corresponding interfaces based on the needs of the page. The WizardPageImpl Template Class has several useful interfaces that can help you write custom wizard pages.
Template classes for wizard pages, see Wizard Page Helper Classes. Interfaces for the wizard page template classes, see Wizard Page Interfaces. In addition, the custom wizard page implements the IFieldCallback interface. Both of these are implemented in the LocationPage. The OnWindowCreated method in the example wizard page calls the following methods:.
Use this method to initialize the fields controls that you have added to the form. The pointer of the page is a parameter. In the example, the this pointer is passed, which refers to the current page. To support the use of the this pointer, you must implement the IFieldCallback interface in addition to the interfaces that the WizardPageImpl Template Class supports.
The IFieldCallback interface calls the SetFieldDefault method, which is used to set the default values for controls other than text box and check box controls. In the example, the SetFieldDefault method sets the initial index of the combo box control based on the default value specified in the Default element for the Field element in the Config.
For more information about setting up the form controller, see Setting up the Form. This method populates the combo box from the list of locations in the Config. The Data element and child DataItem elements the Confg. Updates the TSLocation task sequence variable with the value selected in the combo box using the SaveFields method.
Adds information that will be shown on the Summary page using the SaveFields method. When the user completes the fields on the custom wizard page, they click Next , which calls the OnNextClicked method. The OnNextClicked method performs any necessary tasks before proceeding to the next wizard page, such as recording any configuration changes made on the custom wizard page. For the example custom wizard page, the override for the OnNextClicked method is implemented in the LocationPage.
In the OnNextClicked method in the example custom wizard page, the following methods are called:. This method initializes the header label caption for the summary data displayed on the Summary page. Typically, you can set this value using the DisplayName function. The data associated with this caption is saved using the SaveFields method. This method saves field values to task sequence variables and to the data displayed on the Summary page.
The Pages element in the UDI Wizard configuration file contains a list of pages that has a separate Page element for each wizard page. When you edit the configuration settings for a wizard page, the UDI Wizard Designer loads the custom page editor that corresponds to the wizard page type. The custom wizard page editors are developed as WPF user controls. As you create your custom wizard page, some of the configuration settings may be set in code and cannot be changed after you have compiled the page.
However, for other configuration settings, you will need to allow those configuration settings to be changed using the UDI Wizard Designer. However, you can also create your own separate configuration file, if necessary. The following is a list of the typical configuration settings that you can manage using the UDI Wizard Designer:.
Use fields allow users to provide input. The corresponding wizard page editor needs to provide a method for editing the field configuration settings for the field using the FieldElementControl. Setters help create properties for entities on the page, such as pages in the Page element, fields in the Field element, or data in the Data or DataItem elements.
You configure properties in the Setter elements. Add a separate Setter element for each property you want to define. You edit the properties using the SetterControl and configure other Setter elements using other controls. Data is used to store information for use by the wizard page and other components.
You can define data for pages or fields using the Data or DataItem elements. The data can be defined in a flat or hierarchical structure through the proper use of the Data or DataItem elements. The custom wizard page editor that you create must be able to manage these configuration settings.
The EditorPage example has the following primary components:. UI to add or edit a location in the list of possible locations, which are shown in the Location combo box.
This attribute determines the name of the DLL to be loaded. This attribute is the Microsoft. Use this attribute to configure the page type of the custom wizard page, which the UDI Wizard loads. Use this attribute to provide information about the wizard page editor. Use this attribute to provide the name of the custom wizard page that is displayed in the UDI Wizard Designer.
In the example, the type of the SamplePage custom wizard page is Microsoft. LocationPage , which is saved in the Config. When the wizard page editor is loaded and initialized, the SampleEditor wizard page editor is loaded when a page with a type of Microsoft. LocationPage is edited. For example, the following code ties the Default value text box with the Default element in the UDI wizard configuration file Config. Use the Views:CollectionTControl. You use the CollectionTControl control to display the grid view and bind the grid view to the Data element with the name Location in the UDI configuration file.
A context-sensitive menu and Ribbon buttons that allow you to add, edit, remove, or change the order of items in the list of locations as described in Review Context-sensitive Menu and Ribbon Buttons for Modifying the List of Locations.
A dialog box that is initiated when you select to add or edit an item in the list of locations as described in Review the Dialog Box for Adding or Editing Locations. When you right-click in the list box that contains the list of locations, a context-sensitive menu is displayed. The Ribbon has corresponding buttons that allow you to perform the same tasks.
This data-bound property is activated when the user selects an item from the list. This action is performed when the user clicks the Add Item option from the context-sensitive menu or the corresponding buttons on the Ribbon. There is a data binding to a property in the view model that returns the AddLocationAction object. This action is performed when the user clicks the Edit Item option from the context-sensitive menu.
There is a data binding to a property in the view model that returns the EditLocationAction object. This action is performed when the user clicks the Remove Item option from the context-sensitive menu. There is a data binding to a property in the view model that returns the RemoveAction object. If you add a new location to the list of locations or edit an existing location, a message is displayed that is in the AddEditLocationView.
A title, which you configure using the DialogTitle attribute of the dialog frame. The configuration information for your custom wizard page is stored in the UDI Wizard configuration file, which is the:. Write code to perform the appropriate tasks when the wizard page loads overrides for the OnWindowCreated method , including the following steps:.
Read memory variables, task sequence variables, environment variables, or XML file information such as Setter properties. Write any code to perform the appropriate tasks when the page is shown overrides for the OnWindowShown method , including the following steps:. Update the controls based on information read when then page loaded in step 3, such as the population of controls based on the information read.
Write any code to perform the appropriate tasks when the user clicks Next in the UDI Wizard overrides for the OnNextClicked method , including the following steps:. Update any memory variables, task sequence variables, environment variables, or XML file information. The UDI Wizard can run in:. The existing operating system on the target computer. You can run bit versions of your wizard page on bit or bit Windows operating systems. However, you can only run bit versions of your wizard page on bit Windows operating systems.
Windows PE on the target computer. So, you need to have built a version for your wizard page for each processor architecture of Windows PE that you plan to use.
Add instances of the FieldElementControl control as required by the wizard page to be configured if required. Add instances of the SetterControl control as required by the wizard page to be configured if required.
Add instances of the CollectionTControl control as required by the wizard page to be configured if required. Write the appropriate code to update the UDI Wizard configuration file based on the configuration settings to be configured using your custom wizard page editor.
Create child dialog boxes in a. Add the appropriate interfaces to the UDI Wizard Designer Ribbon based on the requirements of the wizard page to be configured. For example, if you install the bit version of MDT, then build a bit version of your custom page editor. For more information about the elements required to perform the mapping between the wizard page and the wizard page editor, see the DesignerMappings element, child elements, and corresponding attributes.
You can create a DLL that contains wizard pages, tasks, and validators within the same. Write code that implements the ITask Interface and the following methods:. This method is called to initialize your task. This method is called to run your task. All Task elements should include the BitmapFilename parameter.
Specify all other parameters as the task requires. For example, in the previous excerpt, the log parameter is used to specify a parameter for the location of a log file. Write code that creates a subclass of the BaseValidator class and implements the following methods:.
The form controller calls the Init member to initialize the validator. This method must call the Init method for the BaseValidator class. It typically reads any properties set for the validator from the UDI Wizard configuration file. For example, the InvalidCharactersValidator validator retrieves the value of the InvalidChars property using this method. The form controller calls this method to see whether the control contains valid text.
The following is an example of the IsValid method for a validator that validates that the field is not empty:. The form controller calls this member for each keystroke and other events so that the validator can validate the contents of the control and updated messages at the bottom of the wizard page or clear them.
Typically, these are the only methods that you need to override. However, depending on the validator, you may need to override other methods in the subclass of the BaseValidator class you create. For more information about these other methods, see the BaseValidator class. All Validator elements should include the Message parameter. Specify all other parameters as required by the validator.
For example, in the previous excerpt, the NamedPattern parameter is used to specify a parameter for the name of a predefined regular expression pattern. The UDI Wizard uses class factories to create new instances of objects for you. These factories are registered with a factory registry, using a string as the key to the factory. For example, the WmiRepository component is identified by the string "Microsoft. Assuming that you have written your page as a subclass of WizardPageImpl , you can create a new instance of a WmiRepoistory like this:.
The CreateInstance function is a type-safe template function for creating new instances of components. PWmiRepository is a smart pointer, so it handles reference counting for you. There is a set of components that you can register with the registry. The first set of components is always registered, because the main UDI Wizard executable file provides it.
The other two sets of components are provided in "optional" DLLs. Your code does not need to know which executable contains a specific component. You interact with the controls on your page through the GetControlWrapper template function, which provides access to one of the types of components listed in Table 6.
The wizard creates this component for you and passes it to your page. You access it from your page using the Form method, which the WizardPageImpl base class implements.
This is a type of validator that you can include on a page. This validator looks for a single property a Setter element in the. It checks the characters in a text box; if the text contains any characters from this list, the component reports failure. This validator reports failure if the text box or any other control that supports IStaticText has an empty string value.
This validator works with two different text controls controls that support IStaticText and reports failure if they do not contain the same values. In other words, it fails if the Password and Confirm Password text boxes do not match. Because this validator requires two controls, it needs more setup than other validators. The setup might look something like this:. First, you define the Confirm Password control as a "child" of the Password control. That way, if the form controller disables the Password control, it will also disable the Confirm Password control.
Next, add a password validator to the form. Finally, provide the password validator with the interface to the Confirm Password control. Because of the requirement for two controls, you must use code to set up this validator rather than the.
This validator compares the contents of a text control one that supports IStaticText to a regular expression and fails if the text does not match the regular expression. Alternatively, you can use this validator with a predefined named pattern. To use a regular expression, the XML must contain a setter property called Pattern. If you want to use a named pattern instead, use a setter called NamedPattern set to one of the values in Table 7.
This component keeps track of all class factories and services. It implements the IFactoryRegistry interface and is available indirectly through your page's Container method. In addition, the registry loads extension DLLs. You must implement this function and in it register the class factories for your pages, tasks, and validators and any other class factories you want to register.
Here is an example from the sample project:. This component is available to your page via the Logger method implemented by WizardPageImpl. You use this method to write entries to the log file. The contents of the log file are useful for diagnosing issues users might have running the UDI Wizard.
The property bag is a container for memory variables. Memory variables are useful for passing temporary data among different pages. The TSVariableBag component allows you to read and write task sequence variables. It keeps the values in memory until the user clicks Finish by default. These components log all reads and writes of task sequence variables. This component returns result records via the IWmiIterator interface. Table 8 lists the helper classes that you can use to create custom wizard pages.
This is a useful base class for creating a class factory that you can then register with the factory registry. The following is an excerpt from the LocationPage. Use this template class when you want to build a component that implements more than one interface—for example:. It also returns the full path to the. The class returns the full path and file name of the. Finally, the class returns a new string that is the combined path and file name or another path.
This class is defined in Pointer. Because COM components use reference counting for lifetime management, it is important that you always release interfaces when you are done with them. Microsoft provides a template class that handles the lifetime automatically. For example, if you want a smart pointer for an XML interface, you could write something like this:. The first line defines the smart pointer. The second line shows retrieving a smart pointer via another call. Once you have retrieved a pointer like this, the Pointer instance calls Release for you when the variable goes out of scope.
Microsoft recommends that you use smart pointers instead of calling AddRef and Release manually. In addition, the Pointer smart pointer class calls QueryInterface to retrieve other interfaces for you.
For example, when the factory registry creates a new instance of a component, it has code like this:. The resulting smart pointer will equal nullptr if the component does not support that interface.
This class is a smart pointer specifically for the IUnknown interface. For all other interfaces, use the Pointer template class. This class is defined in Utilities. These methods are a bit like the Microsoft. However, they do not perform any formatting of the input—just substitution:. These are wrappers around the StringCchPrintf that return a wstring so you do not have to allocate memory for strings or buffers yourself. This base class makes it easier to implement a component that supports an interface that itself inherits from another interface.
Here is how this class is used to define the CheckBoxWrapper :. This class is defined in UnknownImpl. Here is an example of how you would use this base class:. This class is defined in IWizardComponent. The parameter for this template class is the "main" interface you want to use for your component, which in the case of tasks is ITask. The UDI Wizard uses interfaces to access the different controls on your page. Within you page, you use the GetControlWrapper function to retrieve a control wrapper.
Here is an example:. The Progress page uses this class to run tasks on a separate thread. You can also use this class whenever you want to perform operations on a separate thread.
Tasks are any class that supports the ITask interface. BackgroundTask" component, defined in the IBackgroundTask. This method waits until either the thread stops running or the number of milliseconds has elapsed. This method kills the thread that is running see Table 14 and Table This process may take a short amount of time to finish after this method returns. This method releases the background thread.
Set the checked state of the check box. This interface is implemented by the CheckBoxWrapper component. Use this method when you have a data source that implements the IBindableList interface. The list box initializes the contents with the captions from this list. This method returns the index of the selected item or -1 if nothing is selected. This interface is implemented by the ControlWrapper component.
The single method reports whether the CPU is 32 or 64 bit. Note that if you have a bit operating system on a bit computer, this method returns TRUE, because it is only reporting the width of the CPU not the operating system. This method finds a first match for the name you provide.
It supports wildcard characters and returns both file and directory names. This method retrieves the name of the file found with a call to FindFirst or FindNext. This method returns the attribute for the most recent found file or directory. You can use code as follows to test whether it is a directory:. See that method for details. Verify whether the user has rights to modify the computer entry.
Call this method before you call any other components. You will need to create a new WmiRepository before you call this method. This method allows you to add text that will appear as a "where" clause in the query. For example, the following line returns only USB drives:. This method adds the names of additional properties that you want to make available in the query results. Call this method before calling Update. Table 18 shows three of the useful properties. The number of records the query returns.
Call Update before you call this method. This method retrieves the caption for a record which is the same as the Caption property. This interface is implemented by the ImageList component. You retrieve an instance of this component from the IListView interface. This method returns the handle for the image list in case you need to perform other operations on the image list.
This method returns TRUE if an item in the list is selected. This method requires that you call SetExtendedStyle to set the check box style. Add an image to the list view's image list. You need to call CreateImageList , first. This interface is implemented by the ProgressBarWrapper component. Set the position of the progress bar using a number between 0 and This interface is implemented by the RadioButtonWrapper component. Provide the wrapper with the range of radio buttons that should be treated as a group.
Call this method before you call CheckRadio. Set the specific radio button to be the single button in the group of radio buttons selected. Call SetGroup before calling this method. This interface is implemented by the StaticTextWrapper component. Implement this interface if you want your component to be available as a task in the preflight page or if you want to use the BackgroundTask component to perform work on a background thread.
If you are writing a task for the preflight page, call this method to initialize your task. The pProperties parameter provides access to the three setter values, whereas the pTaskSettings parameter provides access to the Task element and children. Most tasks only need to read data from the pProperties parameter.
Here is where you write the code that performs the task. The pReturnCode parameter must be updated with a number that reports the state of the task. This interface is implemented by the TreeViewWrapper component. Add a new image list to the tree view control. Add an image to the image list from a resource resourceId in the module with the instance handle hInstance. Add a node to the tree view. Otherwise, provide the handle to the parent item where you want the new item added. This method returns the handle to the new item.
Ensure that the tree view item is visible. The tree view will scroll if required to make this item visible. Set the currently selected item to the item that you provide. You can call SetFirstVisible after this to ensure that the newly selected item is visible. Windows 11 Windows 10 More Need more help? Expand your skills. Get new features first. Was this information helpful? Yes No. Thank you!
Any more feedback? The more you tell us the more we can help. Can you help us improve? Resolved my issue. Clear instructions. Easy to follow. They can be sat while waiting for me to download any ISO of W I cant think of any new features I would want to backport to ltsb.
Bolean said on November 24, at pm. Minou said on December 10, at am. No options for Office. Marek said on November 24, at pm. Anonymous said on November 25, at am. Alex said on November 24, at pm. Jeremy said on November 24, at pm. Steven Abeyta said on November 25, at am. Jozsef said on November 25, at am. Anonymous said on November 25, at pm.
Chronophan said on January 1, at am. For more info, go to KB I finally guessed that the installation was stuck due to something it was getting from the internet, so I disconnected the Ethernet cord and then the setup ran fine. Reece said on November 26, at am. Marine Recon said on November 26, at am. Robert K. Radical Dreamer said on November 28, at am. Loucha parsat said on March 11, at am. EP said on September 25, at pm. Leave a Reply Cancel reply Comment Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy We love comments and welcome thoughtful and civilized discussion.
Rudeness and personal attacks will not be tolerated. Please stay on-topic. Please note that your comment may not appear immediately after you post it. Spread the Word.
0コメント