PE Builder v3 help
Table of contents

Plugin file format


  1. Introduction
  2. Creating a plugin
  3. PEBuilder section
  4. WinntDirectories section
  5. SourceDisksFiles section
  6. SourceDisksFolders section
  7. Software.AddReg section
  8. Software.DelReg section
  9. SetupReg.AddReg section
  10. Default.AddReg section
  11. Default.DelReg section
  12. AddLine section
  13. DelLine section
  14. SetValue section
  15. Append section
  16. Variables

Introduction

This document should help to create or modify PE Builder plugin files. The main .inf file for PE Builder is pebuilder.inf file. Please do not edit this file! If you want to change something use a plugin file. All plugins are located in the plugin directory. Every .inf file in the plugin directory (doesn't matter in which folder) with a "pebuilder" section is considered a valid plugin for PE Builder. Use the Enable/Disable button in the plugin dialog to turn plugins on or off.

Creating a plugin

A plugin .inf file must be an ascii file, not unicode. Lines starting with a ";" (semicolon) are ignored (used for comment).

Every plugin file should start with the lines shown below:

; PE Builder v3 plug-in INF file
; Created by Bart Lagerweij
; http://www.nu2.nu/pebuilder/
;
; Short description of what the plugin does...

[Version]
Signature= "$Windows NT$"

[PEBuilder]
Name="NiceNameOfPlugin"
Enable=0
Help="pluginhelp.htm"
Please note that you must include the [Version] Signature= "$Windows NT$" information. Otherwise the setupapi functions cannot open the .inf file. Please use the information below to add more sections to your plugins...

PEBuilder section

If you are creating a plugin, your .inf file must have an [PEBuilder] section!
Namethe name for the plugin
Enablethe state of the plugin
0 - Disabled
1 - Enabled
Helpthe filename for the plugin helpfile. This can be a text, html, doc, pdf or any other type of file. PE Builder uses the ShellExecute() function to start the document with its default association.
Configthe filename for the configuration file.

WinntDirectories section

Section WinntDirectories is in the following format:
directoryID=dirname[, attribute]

where...
directoryIDis the directory number (id)
In plugin .inf files you can use 'a'-'z' for dynamic number assignment...
dirnameis the name of the directory. If the name contains spaces put double quotes "around it".
attributenumeric value to enable/disable some options
value:
1 - Always create this directory (even when empty)
2 - Create directory from (output) root (in \ and not in \i386).
Just add the values to combine...
Default value for attr is 0.

Example:
[WinntDirectories]
; Always create a folder in the root called "Bart"
a="Bart",3
; Create a folder in the root called "Project\Bart\Source"
b="Project\Bart\Source",3
; Create a folder in the i386 directory called "extra\files"
c="extra\files",1

Here is a list of the (most used) directories ID's:
IDDirectoryRemark
30000[root]PE Builder output root
1\SystemRoot (on CD this is the \i386 folder, on hd this is the \minint folder)
2system32
3system32\config
4system32\drivers
5system
17system32\drivers\etc
20inf
21Help
22Fonts
24msagent\intl
52msagent
124WinSxS
125WinSxS\Manifests
252WinSxS\Policies

PE Builder uses directory id's starting from 30000. Where id 30000 is used for the output root directory. 30001 and up are dynamically used by PE Builder.

SourceDisksFiles section

SourceDisksFiles[.build]

This section is used to copy files. If you add a build number after the section name, that section will only be used when the source media is from that build.

BuildVersion
2600Windows XP
3790Server 2003

The section SourceDisksFiles uses the following format:
filename=directoryID[, filenameRenamed][, attribute]

where...
filenameis the file to copy.
directoryIDis the target directory number. See WinntDirectories section for a list of standard windows directory id's.
filenameRenamedis the target filename if renaming is needed.
attributenumeric value to enable/disable some options
value:
1 - used for pluginCheck(). Make sure that the file exists in the same directory as where the .inf file is located, before enabling or continuing.
2 - do not decompress the file.
4 - only copy the file if it exists. Don't complain when it does not exist.
8 - rename the filename to uppercase. When building an ISO image PE Builder renames the windows filenames to uppercase (required for booting from CD).
Default value for attribute is 0.

SourceDisksFolders section

SourceDisksFolders[.build]

This section is used to copy complete folders and files. The section SourceDisksFolders uses the following format:
sourcepath=directoryID

where...
sourcepathis the source path/folder to copy from. This is an exact copy nothing is decompressed or extracted!
directoryIDis the target directory number. See WinntDirectories section for a list of standard windows directory id's.

Example:
[WinntDirectories]
a="Programs\openoffice",2

[SourceDisksFolders]
; when openoffice folder is in plugin directory
openoffice=a

[SourceDisksFolders]
; when openoffice folder is at c:\
c:\openoffice=a

Software.AddReg section

Software.AddReg[.build]

Add registry keys to HKEY_LOCAL_MACHINE\SOFTWARE.
This section is in the following format:
regType, regKey, regValue, regData

where...
regTypespecifies the type of information to be stored as the value’s data. This parameter can be one of the following values:
0x0, (REG_NONE) create the key only, no value
0x1, (REG_SZ) string
0x2, (REG_EXPAND_SZ) string (with environment variable references)
0x3, (REG_BINARY) binary data
0x4, (REG_DWORD) 32-bit number
0x7, (REG_MULTI_SZ) multiple strings
* Note: must start with "0x" (lowercase)!
regKeyspecifies the name of the key as string.
regValuespecfies the name of the value as string.
regDataThe actual data.

Example:
0x1, "Microsoft\Windows NT\CurrentVersion\Fonts", "Tahoma (TrueType)","TAHOMA.TTF"
0x2, "Control Panel\desktop", "WallPaper", "%systemroot%\system32\nu2.bmp"
0x3, "ControlSet001\Control\TimeZoneInformation", "DaylightStart",\
	00,00,04,00,00,01,00,02,00,00,00,00,00,00,00,00
0x4, "ControlSet001\Control\GraphicsDrivers\DCI", "Timeout", 0x7
0x7, "ControlSet001\Services\VgaSave\Device0", "InstalledDisplayDrivers","vga", "framebuf", "vga256", "vga64k"

SetupReg.AddReg section

SetupReg.AddReg[.build]

Add registry keys to the "SetupReg.hiv" registry hive. Same syntax as Software.AddReg

Default.AddReg section

Default.AddReg[.build]

Add registry keys to HKEY_CURRENT_USER.
Same syntax as Software.AddReg

Software.DelReg section

Software.DelReg[.build]

Delete registry keys from the "Software" registry hive. This section is in the following format: regKey[, regValue]

where...
regKeyspecifies the name of the key (including all values) to delete as string.
regValuespecifies the name of the value to delete as string.

Default.DelReg section

Default.DelReg[.build]

Delete registry keys from the "Default" registry hive. Same syntax as Software.DelReg

AddLine section

AddLine[.build]

Adding lines to a section. The lines in the AddLine section have the following format:
Filename,Section,StringToAdd

where...
Filenameis the filename to add a line to.
Sectionis the sectionname.
LineToAddis the line to add.

Example:
"netmscli.inf", "MSClient.DelReg", "HKLM, Software\Microsoft\Rpc\SecurityService, 9"

DelLine section

DelLine[.build]

Delete lines from file. The lines in the DelLine section have the following format:
Filename,Section,StringToDel

where...
Filenameis the filename to add a line to.
Sectionis the sectionname.
StringToDelis the line to delete. You don't have to match exact, any lines begining with "StringToDel" will be deleted.

Example:
"netmscli.inf", "MSClient.Browser.AddReg", "HKR, Parameters, MaintainServerList,"

SetValue section

SetValue[.build]

Write value to file. The lines in the SetValue section have the following format:
Filename,Section,Key,Value

where...
Filenameis the filename to set a value in.
Sectionis the sectionname.
Keyis the key to assign a value to.
Valueis the data.

Example:
"netmscli.inf", "Alerter_Service_Inst", "StartType", "3"

Use Filename,Section,Key to remove a key
Use Filename,Section to remove a complete section

Append section

Append[.build]

Append a file to another file. The lines in the Append section have the following format:
Filename,FilenameToAppend

where...
Filenameis the file where data will be appended.
FilenameToAppendis the file that contain the data to append.

Example:
nu2menu.xml, penero_nu2menu.xml

Variables

Most string fields in the plugin file can have some special PE-Builder variables:
Syntax: @variable@

where...
variableexpands to...
ProgramThe name of the builder (PE-Builder by default)
VersionThe builder version
IsoFileFull path and filename of ISO image
OutDirFull path of output directory
SourcePathFull path of source directory
PluginDirFull path of the current plugin directory
PluginFileFull path and filename of the current plugin file
LanguageThe current language
VerboseVerbose mode (0 means off, 1 means on)
BuildThe windows build number (2600 means XP, 3790 means server 2003)

Example:
[SourceDisksFiles]
program.exe=2,,3
lang\@language@.lng=2,,3

Where lang\@language@.lng will get expanded to lang\german.lng (when german language is selected).

Table of contents

PE Builder Copyright (c) 2002-2006 Bart Lagerweij. All rights reserved.