0. Prerequisites
- $BaseDir$ is the directory where WinBuilder is installed
- Paths are relative to $BaseDir$
- <Key> means the actual value of "Key"
- Always keep in mind that path and file names are case sensitive when the project is built in an OS other than Windows.
- In this tutorial paths are written with the Windows backslash separator. When you work in a different host OS, then maybe the separator is a slash
- "INSTALL" means the INSTALL command in the running WinBuilder CLI
- Just a reminder: Empty keys have the format <entry key="KeyName"/>
1. Preparation
- Be sure to have your personal registration key in $BaseDir$, e.g. "thatsme.wbc".
Some developers already have it. Seriously developing members can get it on request (PM to pscEx or Nuno Brito). - Download the plugin template to $BaseDir$\downloads
- Choose an (3 digit numerical) ID and a name for your plugin
- Rename the Template to <ID>-<Name>.zip
- Create a new folder downloads\<ID>-<Name>
- Unzip the contents of <ID>-<Name>.zip into <ID>-<Name>
2. General customization
- Edit $BaseDir$\downloads\<ID>-<Name>\settings.xml
- Change the first part (up to the first blank line) according your project names etc.
3. Add plugin application
Decide for one of three possible methods:
- Attach the application to the plugin.
The user can INSTALL the plugin and has nothing more to to. The plugin is ready to be added to the PE build.
This method is recommended exclusivelly for own applications.
Use step 3.1 - Prepare to download the application and store locally during INSTALL.
The user can INSTALL the plugin and has nothing more to to. The plugin is ready to be added to the PE build.
This method is recommended for applications which can be downloaded and extracted easily by 7-zip (WinBuilder internal extractor)
Use step 3.2 - Applications not covered by 3.1 and 3.2.
Use step 3.3
3.1 Provide the plugin application locally
This method uses a zipped image of the application which during build is unzipped into the wim-boot or bootdisk directory.
- Edit $BaseDir$\downloads\<ID>-<Name>\settings.xml
- Define <entry key="InstallFromLocal">False</entry>
- Define <entry key="IsAttached">True</entry>
- Save <ID>-<Name>\settings.xml
- Create an empty plugin_APP.zip file in $BaseDir$\downloads\<ID>-<Name> folder
- Zip the contents of your plugin application directory into this zip.
3.2 Download the plugin during INSTALL
- Edit $BaseDir$\downloads\<ID>-<Name>\settings.xml
- Define <entry key="InstallFromLocal">True</entry>
- Define: <entry key="DownloadURL">http://app.deliverer.com\myapp.zip</entry> with your actual link
- Define <DoExtract>
-
$Default
-
True
-
False
-
$Default: Extract:
- *.paf.exe
- *.7z
- *.zip
All other files types are copied.
True: Force extract, independent from file type. This can be done e.g. with install *.exe files.
False: Do not extract, independent from file type
This method causes a download during INSTALL, and copying / extracting the app files into <LocalFolder>.
Remark: Usually *.paf.exe files can be extracted. But there is a bug in the used SevenZipBindings, which prohibits some files to be extracted correctly.
Maybe also install *.exe files cannot be extracted into an usable application.
In this case set <DoExtract> = False
3.3 Make the user responsible to provide the plugin application
- Edit $BaseDir$\downloads\<ID>-<Name>\settings.xml
- Define <entry key="InstallFromLocal">False</entry>
- Define: <entry key="DownloadURL"/>
- Define a install message for the user:
Edit $BaseDir$\downloads\<ID>-<Name>\Readme.txt and uncomment the message you want to show, or add your own message.
In this case during INSTALL the user will get a log message like
2014/03/26 15:26:09 [INFO] Before you can add the PiriformClamWinPortable plugin in your project, you have to install it into V:\WB2_A\WB2\winbuilder\run\lib\plugins\AntiVir\PiriformClamWinPortable.
2014/03/26 15:26:09 [INFO] Then run it once in order to do some initialisations / updates, etc.
and has to act accordingly.
Sorry, there is no way that you perform that user's job.
4 Advanced
4.1 Shortcuts
Shortcuts are also defined in $BaseDir$\downloads\<ID>-<Name>\settings.xml.
By default, there is no shortcut on the desktop, and a shortcut with default values in StartMenu\<!Category>.
When you agree to this behaviour, you usually can continue.
There is one exception: When the application executable is different from <!Name>.exe, you must replace $Default by the real exe name in <entry key="ShortcutTarget">$Default</entry>.
All other shortcut definitions may be changed optionally, according your preferences.
4.2 RunFromRAM
There is an entry <entry key="RunFromRAM"> in $BaseDir$\downloads\<ID>-<Name>\settings.xml.
It defines where the applicaton directory is placed
- True: $BaseDir$\output\wim-boot: Is added to the PE's boot.wim
- False: $BaseDir$\output\bootdisk: Is added to the ISO body
That is valid for all three methods 3.1, 3.2 and 3.3.
When there are files to be placed independent of RunFromRAM, zip them into:
- plugin_RAM.zip: Place into $BaseDir$\output\wim-boot.
- plugin_CD.zip: $BaseDir$\output\bootdisk.
Take care, that in this case differently from 3.1 the zip file must contain the complete path inside wim-boot / bootdisk.
Example: Windows\inf\mydriver.inf
4.3 main.bsh
There is a file $BaseDir$\downloads\<ID>-<Name>\main.bsh.
It defines actions of the plugin during INSTALL and during BUILD.
Usually it can be used unchanged. But sometimes you want to have some additional actions when the plugin is added to the PE source.
You can see comments in $BaseDir$\downloads\<ID>-<Name>\main.bsh informing you about the possibilities.
5 Finalise
- IMPORTANT: Close open editors with $BaseDir$\downloads\<ID>-<Name> files and save then on close.
- IMPORTANT: Copy the contents of the $BaseDir$\downloads\cache\settings-<ID>.xml to $BaseDir$\downloads\<ID>-<Name>\settings.xml (overwrite!)
- IMPORTANT: Zip the contents of the $BaseDir$\downloads\<ID>-<Name> directory into $BaseDir$\downloads\<ID>-<Name>.zip
- Upload your plugin to the reboot.pro download center.
6 Examples
- Download examples: http://winbuilder.ex...wCollection.zip
- Unzip into the $BaseDir$\downloads directory and rename as if you would create your own plugin (See above).
- most of the work is already done in the examples. - INSTALL the plugin.