In this article I explain how to create a template for Microsoft User Experience Virtualization. For details on how UE-V works please see my earlier article Microsoft User Experience Virtualization (UE-V): Facts and Review. As a sample application I used my permission management tool SetACL Studio.
As explained in my review, a UE-V template is an XML file. As such, a text editor is sufficient for template creation. The process is much more comfortable with Microsoft’s Generator tool, though. It can be installed independently of the UE-V agent. Just run ToolsSetup.exe from the download package. After clicking through the MSI you will find it in the Start Menu under the name Microsoft User Experience Virtualization Generator.
Generator requires the Visual C++ 2010 Redistributable Package and the .NET Framework 3.5.
When you start UE-V Generator you see this screen:
I clicked on Create a settings location template.
Generator creates templates by starting and monitoring an application. I browsed for the path to SetACL Studio:
After clicking Next Generator tried to start SetACL Studio:
If you get an error message at this point that says “AppMonitor exited with error: 4” you need to install the Visual C++ 2010 Redistributable Package.
SetACL Studio, started through Generator:
Once SetACL Studio was closed, Generator finished location discovery:
On the next screens, the discovered locations can be reviewed (but not changed until later in the process):
Next comes the edit template section. On its first tab the template properties are displayed. The fields application name, program name, product version and file version are read from monitored executable. The template author name could have been preset with the name of the user executing Generator, but it was not, so it filled that out myself:
Moving to the registry tab we notice that Generator recorded a path which obviously belongs to the Intel Display Driver in my laptop, not to SetACL Studio:
This demonstrates nicely that the recorded output of Generator needs to be checked carefully. I deleted the Intel registry path, of course:
The recorded file path looks better, but is still not entirely correct. Instead of %AppData%\Helge Klein Generator should have chosen the subdirectory SetACL Studio. Like many other applications SetACL Studio keeps its settings in %AppData%\Vendor\Product. Generator ignored the Product directory:
I added the subdirectory SetACL Studio to the path:
After saving the template I had reached the Finish of the template creation wizard:
In addition to creating new templates Generator can be used to edit existing templates:
Clicking Edit a settings location template brings up the Select template screen:
When clicking Next the wizard described above is invoked with the values from the template filled in.
Some may prefer edititing the XML template files in a text editor. To ensure that the resulting file conforms to the schema Generator comes with a validation function:
After selecting a template…
…the result of the validation is shown:
This is the resulting XML template file:
<?xml version="1.0"?> <SettingsLocationTemplate xmlns="http://schemas.microsoft.com/UserExperienceVirtualization/2012/SettingsLocationTemplate"> <Name>SetACL Studio</Name> <ID>SetACL-Studio-SetACL-Studio-v-1-2</ID> <Version>2</Version> <Author> <Name>Helge Klein</Name> </Author> <Processes> <Process> <Filename>SetACL Studio.exe</Filename> <ProductVersion> <Major Minimum="1" Maximum="1" /> <Minor Minimum="2" Maximum="2" /> </ProductVersion> <FileVersion> <Major Minimum="1" Maximum="1" /> <Minor Minimum="2" Maximum="2" /> </FileVersion> </Process> </Processes> <Settings> <File> <Root> <EnvironmentVariable>APPDATA</EnvironmentVariable> </Root> <Path Recursive="true">Helge Klein\SetACL Studio</Path> </File> </Settings> </SettingsLocationTemplate>
The template can be downloaded from the central UE-V template repository in Microsoft’s TechNet Gallery.