moritz-abraham.de

PE Helper

Task:
Build an emergency boot disc with BartPE.

Requirements:

  • all plugins should be clearly arranged and sorted in groups like "free applications", "licensed applications", "Required for System", etc.
  • there should be an easy way to create different versions of the emergency boot disc like a small version only promting commandline and and full version, having all tools included.

Solution:
The first idea was to rename all plugins. So every plugin name gets prefixed with something like APL (licensed aps), APN (free aps), SYS (sytem requirements). So one can easily overlook which plugins are enabled and which are not. And it is easier to enable all plugins needed for one specific cd.

But after renaming some two or three plugins I decided to code a little script. So the first part of PE Helper was born. This perl-script automatically goes through all plugins and renames them. As the prefix it uses the name of the folder the plugin is located in. So at first you have to move all plugins in new folders like "APN" or "SYS". The plugin-directory should look like this afterwards:

+---plugin
+---APL
¦ +---Acronis Disk Director
¦ ¦ Acronis Disk Director.inf
¦ ¦ ...
¦ ¦ +---files
¦ ¦ ...
¦ +---...
+---APN
¦ +---Firefox
¦ +---...
+---DRV
¦ +---IntelExtreme
¦ +---...
+---SYS
+---ramdisk
+---bootfix
+---...

Lets asume that in the inf-file of the IntelExtreme-plugins it says
Name="Driver Video - Intel i915/i945"

Then after running the script this line has changed to
Name="DRV: Driver Video - Intel i915/i945"

Now all plugins are in a nice order on the plugin-screen of PE Builder which makes it easier to switch on and off plugins that belong together.

But to make it easier there should be the possibility to save the on/off state of all plugins. So that one can say build an full version now with all tools. Or just with some tools needed for special purposes. So here the next part of PE Helper comes into play. The script can save the on/off states of all plugins in the plugin-directory. And also the name of the resulting iso. So you can make your setup and then save it into a file. And later on you can reload this setup again and build a new cd based on those settings.

How to use:
PE Helper has no GUI, its just a commandline tool. You have to pass all arguments via commandline when running PE Helper. Here is an overview of the parameters and how to use them:

pe_helper.pl (-p DIRECTORY (-s FILE | -l FILE | -c FILE | -r) [-d]) | -h

-p DIRECTORY: Path to the "PE Builder"-directory without trailing slash
-s FILE : Saves current "enable"-settings of all plugins to FILE
-l FILE : Loads "enable"-settings from FILE and appends them to the plugin
-n : do not load the name of the isofile
-c FILE : Checks FILE for deleted plugins and new one not listed
-r : Renames the plugins based on the directory they are located in
-d : Debug-mode
-h : Help

So if you want to save the current config, i.e. all on/off states, to a file d:\save\config.txt of your PE Builder having its base-dir in d:\pebuilder than you would start it with:

pe_helper -p d:\pebuilder -s d:\save\config.txt

If you later want to go back to this setup just call:

pe_helper -p d:\pebuilder -l d:\save\config.txt

If you are unsure, whether there are new plugins in your PE Builder or if plugins where deleted or renamed just run PE Helper in check mode. It will then do the same like in load mode but without changing anyhing:

pe_helper -p d:\pebuilder -c d:\save\config.txt

If you would like to move your plugins to subfolders and rename them with a prefix you should do this before saving any config, because the path to the plugin is saved in the config file. So if you moved all your plugins just call:

pe_helper -p d:\pebuilder -r

Thats it!

Here is the script! Without any warranty! Copy your files before using the script if you are not really sure what it is doing!

Download