~~ Listen to previous Podcast on: BartPE Setup, Configuration, and Use
~~ How to make a BartPE CD
~~ How to add network cards to your BartPE
BartPE will add any network drivers you need as long as it is configured correctly.
~~ How to edit the BartPE Menu systems
BartPE uses XML files to handle its menu system. The primary plugin menu for a default install of BartPE is located at: C:\pebuilder\plugin\nu2menu. Nu2Menu has multiple files but the primary one to look at is: nu2menu.xml. There are other menu systems that can be used if you download them.
Inside the XML file are the lines needed to make the menu system for BartPE. Here is an example mini menu file:
<NU2MENU> <MENU ID="Startmenu"> <MITEM TYPE="ITEM" DISABLED="1">BartPE version 3/19/2007</MITEM> <MITEM TYPE="SEPARATOR"></MITEM> <MITEM TYPE="ITEM" CMD="RUN" FUNC="@GetProgramDrive()\Programs\A43\A43.exe">File Manager</MITEM> <MITEM TYPE="POPUP" MENUID="Programs">Programs</MITEM> <MITEM TYPE="POPUP" MENUID="About">About</MITEM> </MENU> <MENU ID="Programs"> <MITEM TYPE="POPUP" MENUID="Accessories">Accessories</MITEM> </MENU> <MENU ID="Accessories"> <MITEM TYPE="ITEM" CMD="RUN" FUNC="@GetWinDir()\system32\wordpad.exe">Wordpad</MITEM> </MENU> <MENU ID="Spyware"> </MENU> <MENU ID="About"> <MITEM TYPE="ITEM" DISABLED="1">BartPE and PE Builder are Copyright (c) 2002-2004 Bart Lagerweij.</MITEM> <MITEM TYPE="ITEM" DISABLED="1">http://www.nu2.nu/pebuilder/</MITEM> </MENU> </NU2MENU>
The menu system has specific commands that use basic XML type look and feel.
You can put all your menus together into one file or you can break them out. BartPE will take the menu XML files from each of the plugin folders and compile them into the menu system in sequence as it gets the files. Each plugin folder can have a file named usually after the plugin name followed by "_nu2menu.xml". An example might be "firefox_nu2menu.xml".
These files have the same basic format as the main file. In fact if you take the Menu ID from the primary menu you can adjust where you want your menu entries to be shown as BartPE builds the menu system during it being compiled.
~~ How to create BartPE plugins
Creating a BartPE plugin can be easy or hard. It really matters how complex of a program you are trying to create a plugin for. I suggest you start with simple programs so that you get a good understanding of how it work before you attempt a harder program like Adobe Photoshop or something.
Plugin folders contain many files with the most important of them being the pluginname.inf file and the pluginname_nu2menu.xml file for the menu system unless you want to put those entries into the main BartPE menu file. Additionally you will have other files that are needed to do the install. These could be .reg, .cmd, folders with program and DLLs, etc.
The pluginname.inf file contains all the information needed to get the program installed into BartPE as it is in the building process. This file must be an ascii file and not unicode. Lines that start with a ";" are ignored and used as comments. Here is an example plugin that I created for my SafeBoot install at work:
; SafeBoot BartPE [Version] Signature= "$Windows NT$" [PEBuilder] Name="SafeBoot" Enable=1 Help="safeboot.txt" [WinntDirectories] a="System32\SafeBoot",1 [SourceDisksFiles] files\SafeBoot.sys=4,,1 files\sbalg.sys=4,,1 files\rsvlock.sys=4,,1 files\sbtag=a,,1 files\TxtSetup.OEM=a,,1 [SetupReg.AddReg] 0x7,"ControlSet001\Control\Class\ {4D36E967-E325-11CE-BFC1-08002BE10318}","UpperFilters", "PartMGR","SafeBoot" 0x4,"ControlSet001\Services\RsvLock","Type",0x1 0x4,"ControlSet001\Services\RsvLock","Start", 0x1 0x4,"ControlSet001\Services\RsvLock","ErrorControl", 0x1 0x4,"ControlSet001\Services\SafeBoot","Type", 0x1 0x4,"ControlSet001\Services\SafeBoot","Start", 0x0 0x4,"ControlSet001\Services\SafeBoot","ErrorControl",0x3 0x4,"ControlSet001\Services\SBAlg","Type",0x1 0x4,"ControlSet001\Services\SBAlg","Start",0x0 0x4,"ControlSet001\Services\SBAlg","ErrorControl",0x3 0x1,"ControlSet001\Services\SBAlg","Group","Primary Disk" [Append] ; "winpeoem.sif","sb_winpeoem.sif" "txtsetup.sif","sb_txtsetup.sif" [SetValue] ; Adjust txtsetup.sif "txtsetup.sif", "SetupData", "loaderprompt", """Starting BartPE with SafeBoot Support..."""
Each section (identified by the [ ] characters) is used to help install the program into BartPE. As you can see this file has a lot of lines and that is why I recommend starting with a very simple program first. The basic steps to create a BartPE plugin are:
As you can see it can be quite complicated so I suggest looking at how other plugins were created and configured so they could be installed so that you can use these steps to help you create your own.
These lines are very important and must be in each plugin file. I have noted what you should change with your information.
[Version] Signature= "$Windows NT$" [PEBuilder] Name="Put Name Of Your Plugin Here" Enable=1 Help="Put Your Help File Here.txt"
The other sections have specific reasons and settings:
Here are two great sites that will help you create your first BartPE Plugin:
http://www.bootcd.us/Create_PEBuilder_Plugin.php
http://users.telenet.be/Robvdb/how_plugin.htm