Your IoT/Embedded Channel Partner & more

Blog

Creating custom components

XP Embedded Builder v2 allows you to create your own components very easily. To create a component you just need to create the correct file structure, export your registry entries and build a configuration file.

Here is how to build a component, using the MsConfig component as an example.

Creating the File Structure

1. Create a folder for your new component — in this case `MsConfig`

2. Create a subfolder named `Data` in the component folder

3. Copy the files into the `Data` folder with the full path. Example:

MsConfig
  |-Data
    |-Windows
      |-PCHEALTH
        |-helpctr
          |-binaries    <-- place MsConfig.exe here

If you have your own application, you can copy and paste the whole folder structure into the `Data` folder. Just make sure to put it into the correct subfolders like `Windows`, `Program Files`, etc.

Creating a Registry Import

If you need to add registry data to run the application, export them to normal registry files (`.reg` extension). Open the exported file and split it up according to the registry paths.

You need a separate file for:

  • `HKLM\Software`
  • `HKLM\System`
  • `HKLM\Security`
  • `HKLM\SAM`

Create a separate file for each path and replace the root paths with `tmp`.

For example:

[HKEY_LOCAL_MACHINE\System\CurrentControlSet]

becomes:

[HKEY_LOCAL_MACHINE\tmp\CurrentControlSet]

Example for MsConfig — `reg_sw.reg`:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\tmp\Microsoft\Windows\CurrentVersion\App Paths\MSCONFIG.EXE]
@="C:\\WINDOWS\\PCHealth\\HelpCtr\\Binaries\\MSConfig.exe"

Creating Config.cfg

Create a file named `Config.cfg` using the following template:

[Component]
Name=System Configuration - MsConfig
Version=1.0
Group=System Configuration
Order=1000
Autorun=FALSE

[Step_0]
Action=copy
Arg0=Data\
Arg1=[InstallPartition]

[Step_1]
Action=reg
Arg0=Import
Arg1=[InstallWinDir]System32\config\SOFTWARE
Arg2=reg_sw.reg

[Step_2]
Action=reg
Arg0=Import
Arg1=[InstallWinDir]System32\config\SOFTWARE.SAV
Arg2=reg_sw.reg

Config.cfg Fields

  • Name — Display name in the selection menu
  • Version — Component version; older versions get replaced by newer ones
  • Group — Name of the group in the selection menu
  • Order — Installation order (higher = later)
  • Autorun — If TRUE, component will be launched automatically after base image installation

Tags

Tags are replaced with parameters specified during installation:

  • `[InstallPartition]` — Installation partition (e.g. `C:\ `)
  • `[InstallWinDir]` — Windows directory of the installation (e.g. `C:\Windows\ `)

Dependencies and Conflicts

[Dependencies]
Dep0=Name of required component

[Conflicts]
Con0=Name of conflicting component

Integrating the Component into XP Embedded Builder

1. Create a folder named `Components` in the root of a USB drive.

2. Copy the created component into this folder.

3. Connect the USB drive to the target machine and boot XPeBuilder.

4. The component will now appear in the component selection dialog.

← Back to Blog