|Version 2 (modified by gezakovacs, 4 years ago)|
Building a UNetbootin Plugin
What a plugin does
A UNetbootin plugin will provide custom branding for your distribution's installer, and will allow you to specify the distributions and versions to be displayed under the distribution selection box. It is a simpler process compared to Building a Custom UNetbootin Version as you will NOT have to compile your own version of UNetbootin.
- Can specify up to 9 custom distributions
- Can specify up to 36 versions per distribution
- Can add a diskimage (.iso or floppy/HDD .img) download location for each distribution
- Can add an HTML description for each distribution.
If you absolutely must have one of the following features, you will have to Build a Custom UNetbootin Version instead.
- A plugin cannot load a distribution that the default UNetbootin version can't load via the "Diskimage" option.
- A plugin cannot embed external resources (images, disk images, etc)
- A plugin cannot load custom kernel and initrd files.
This example shows a customized version of UNetbootin for K/X/Ubuntu, with custom descriptions and download locations for each. Other examples can be obtained from the List of Custom UNetbootin Versions and Plugins page. For usage instructions, see Using a UNetbootin Plugin.
Creating a Plugin
Before you will begin, you will need to download and install the open-source version of Qt. Windows users can download the "Qt Open Source Edition for C++ Developers - Desktop " from the Qt Downloads Page, while Linux users can install the qt4-dev-tools package or their distribution's equivalent.
Now, download the example source file and open it in Qt Linguist. You should now see something like this:
The field on the left describes the purpose of the option, while the field on the right is where you can input the options for your customized version and click the green checkbox or press Ctrl-Enter to confirm your changes.
Description of Options
N signifies distribution number, in the order in which they are displayed (1-9)
M signifies version number for a particular distribution, in the order in which they are displayed (1-9)
]|[ separates multiple example entries
|iscustomver-no||Should always be set to "iscustomver-yes"||iscustomver-yes|
|Custom UNetbootin Build||Name you want displayed for your rebranded UNetbootin version.||Ubuntu LiveUSB Creator|
|amd64||Name that corresponds to your distribution's codename for 64-bit processors on download pages.||amd64 ]|[ x86_64|
|i386||Name that correspondes to your distribution's codename for 32-bit processors on download pages.||i386 ]|[ x86|
|Distro Name N||Name of the N-th distribution (1=first, 2=second, etc) you want displayed (The entry corresponding to "Distro Name 1" is shown by default, if you want the others to be hidden then make the second field for those you won't use empty)||Ubuntu ]|[ Kubuntu ]|[ "" (<-- this is an empty entry, meaning this distro won't be shown)|
|<b>Homepage:</b> <a href="http://www.distroNsite.org">http://www.distroNsite.org</a><br/><b>Description:</b> This distro N is unique and great in these ways.<br/><b>Install Notes:</b> You will have to do this to install this distribution N.||HTML description and instructions for the N-th distribution to show when it is selected.||<b>Homepage:</b> <a href="http://www.ubuntu.com/">http://www.ubuntu.com</a><br/><b>Description:</b> Ubuntu is a user-friendly Debian-based distribution. It is currently the most popular Linux desktop distribution.<br/><b>Install Notes:</b> This version allows for booting in Live mode, from which the installer can optionally be launched.|
|default-distroNversion-1.0||Default version of the N-th distribution. If it is a 64-bit version, add _x64 to the end of the name. If distribution number N is enabled (Distro Name N isn't empty), this must NOT be empty, though it can be left empty if the corresponding distribution N is disabled (Distro Name N is empty).||8.04.1 ]|[ 8.04.1_x64 ]|[ "" (<-- this is an empty entry, meaning this version won't be shown)|
|http://distroNsite.org/distro-release-%1/distro-architecture%2.iso||Download location for the ISO or IMG file for the N-th distribution. %1 will be substituted with the specified version name (contents of "default-distroNversion-1.0"), while %2 will be substituted with the text specified in the field i386 if the version name contains "_x64", or with the text specified in the field amd64 if the version name doesn't contain "_x64".||http://releases.ubuntu.com/%1/ubuntu-%1-desktop-%2.iso ]|[ http://archive.ubuntu.com/ubuntu/dists/%1/main/installer-%2/current/images/netboot/boot.img.gz|
|distroNformat-iso||Format of the file specified in the download URL. If it's an ISO file, leave it as "distroNformat-iso", but if it's a floppy/hard disk image, change it to "distroNformat-img"||distro1format-iso ]|[ distro4format-img|
|someotherversionN-M||Same as default-distroNversion-1.0, only for versions other than the first one (M-th version) for distribution number N. If left empty, this version won't be shown.||7.10 ]|[ 7.04_x64 ]|[edgy ]|[ dapper_x64 ]|[ "" (<-- this is an empty entry, meaning this version won't be shown)|
Releasing a Plugin
Once done, you can release your plugin by going to File -> Release As in Qt Linguist, giving it a new name (which must begin with "unetbootin" and have the extension ".qm" to be properly recognized and loaded), then uploading the .qm file and adding it to the List of Custom UNetbootin Versions and Plugins.
Releasing a Standalone Executable
If you'd prefer to bundle together your plugin and the UNetbootin executable as a single downloadable file, rather than releasing a seperate plugin, you can use a variety of self-extractor creators to do this.
For example, for Windows, the 7-zip sfx creator can be used, as described at http://www.msfn.org/board/lofiversion/index.php/t39048.html
First, download the following files:
Then, download the Latest Release for Windows and rename it to unetbootin.exe
Then, create an archive "unetbootin.7z" containing the files "unetbootin.exe" and "unetbootin_custom.qm". On Windows, this can be done via the 7-zip GUI, or if on Linux, install the package p7zip-full or your distribution's equivalent, and enter the command:
7z a unetbootin.7z unetbootin.exe unetbootin_custom.qm
Then, if on Windows, open a command line and enter:
copy /b 7zs.sfx + config.txt + unetbootin.7z unetbootin-customsfx-windows.exe
Or, if on Linux, enter:
cat 7zS.sfx config.txt unetbootin.7z > unetbootin-customsfx-windows.exe
Now, you should have a standalone, self-extracting executable with UNetbootin and your plugin bundled in.
Standalone Executable: unetbootin-ubuntu-customsfx-windows-248.exe