Plugins for MustangPEBuilder can be written in any programming language. They are in the form of normal executable files (.exe). Plugins in AutoIt3 script (.au3) form and standard Windows command (.cmd) form are also supported. AutoIt3 must be installed on the system for au3 scripts to work. The path to AutoIt3.exe must also be set in the Advanced Options GUI of MustangPEBuilder.
Plugins must be placed in the Plugins subfolder and should each be in a separate folder. The plugin folder should contain the executable to be processed along with any .ini file to be used. Any files to be added to the build should be in a Files subfolder under the plugin folder. See the SamplePlugin included with MustangPEBuilder. Each plugin to be included in the build needs to be placed in Plugins\Plugins.ini. An example line is SamplePlugin\SamplePlugin.exe. This would be the path to the plugin executable under the Plugins folder. Only lines in Plugins.ini that end in exe, au3 or cmd will be processed. Blank lines in Plugins.ini are allowed and will be skipped. Any line in Plugins.ini that ends with other than exe, au3 or cmd will be skipped. Plugins will be processed in the order in which they appear in Plugins.ini so you have control. Plugins may be disabled in Plugins.ini by changing the extension at the end of the line. Using .dis in place of .exe, .au3 or .cmd is a good idea so you can easily see what plugins are disabled.
There are some global variables declared by MustangPEBuilder that may be used in your plugin without declaring them. See the following list:
$WAIKpath = Path to the WAIK set by user in the MustangPEBuilder main GUI.
$AutoItpath = Path to AutoIt3.exe set by the user in the Advanced Options GUI of MustangPEBuilder.
$WorkingDir = Folder from which MustangPEBuilder is being run.
$Pluginpath = %$WorkingDir%\Plugins\Plugin Folder Name
$MainEXEpath = Set in each plugin by author.
See the SamplePlugin for examples of use.
During the build, a temporary WinPE build environment will be created at %SystemDrive%\winpe_x86. Boot.wim will be mounted at %SystemDrive%\winpe_x86\mount. You can add program files to %SystemDrive%\winpe_x86\mount\ProgramFiles and Windows files to %SystemDrive%\winpe_x86\mount\Windows. See the SamplePlugin for examples.
Shortcuts are created using the standard format for Windows shortcuts in the language being used to write the plugin. The shortcuts need to be placed in %Temp%\MustangPEBuilder\Links\Desktop\YourPlugin.lnk. You can create separate shortcuts for Desktop, StartMenu and QuickLaunch. Just substitute StartMenu or QuickLaunch for Desktop in the previous line. See the SamplePlugin for examples.
In order to make additions to the WinPE registry, you must load the hive you wish to modify. Then make the changes using the registry writing options for your language. After you make all the needed changes, you must unload the hive to save the changes. See the SamplePlugin for examples.
Programs to be started automatically at boot time are placed in AutoRun.cmd. You may manually edit AutoRun.cmd to add your line. See the SamplePlugin for help with programming your plugin to add the line to AutoRun.cmd.