Package Information File

The file package-info.xml is predefined file, which is located in each HippoEDIT bundle and contains bundle description and installation/uninstallation instruction for HippoEDIT which are executed in time when HippoEDIT bundle is installed, reinstalled or uninstalled. If HippoEDIT bundle does not include the package-info.xml, HippoEDIT will extract all files (with corresponding file hierarchy from archive) into user directory.

The file content is an XML document, that can be split into 3 parts:

package-info.xml
<?xml version="1.0"?>
<package-info xmlns="http://www.hippoedit.com/xml/package-info" xmlns:smf="http://www.hippoedit.com/">
	<id>CAD932AC-894A-48F2-BAAD-D270B2B28C51</id>
	<name>View Editor ToolBar</name>
	<version>1.1</version>
	<description>Simple plug-in that extends standard ToolBar by View -> Editor buttons</description>
	<author>HippoEDIT.com</author>
	<email>supportbox@hippoedit.com</email>
	<homepage>http://wiki.hippoedit.com/plugins/view-editor-toolbar</homepage>
	<memo></memo>
	<install>
		<readme type="inline">This will install ViewEditorToolbar plug-in for HippoEDIT.</readme>
		<require-file name="main.hejs" destination="%{plugins}%/view-editor-toolbar/main.hejs" />
		<install-plugin path="%{plugins}%/view-editor-toolbar/main.hejs"/>
	</install>
	<uninstall>
		<readme type="inline">This will uninstall View Editor ToolBar plug-in for HippoEDIT.</readme>
		<uninstall-plugin id="CAD932AC-894A-48F2-BAAD-D270B2B28C51"/>
		<remove-dir name="%{plugins}%/view-editor-toolbar" />
	</uninstall>
</package-info>
There is an easy way to create package-info.xml in case you need it for plugin bundle. Just install/use Scripting Tools Plugin and create a New Service Script with it.

Description of the bundle. Please take care, that you give here the same information as you expose dynamically by plugins (AddScriptInfo API or by native calls of IPlugin, or in syntax schemes, overwise one may get an inconsistence in display of information in Update Manager and in extension info when it is installed (plugin, syntax).

All following parameters (nodes values) are strings.

id

<id>CAD932AC-894A-48F2-BAAD-D270B2B28C51</id>

Global Unique ID of the bundle/package. Often used as a file name, when a package is download from the onlne repository, so shall satisfy constraints on Windows file names and preferably be in English.

name

<name>View Editor ToolBar</name>

Name of the Bundle, to be displayed in Update Manager, download section on HippoEDIT website and in case if readme for install/uninstall section is not provided, in installation/uninstallation information popups.

version

<version>1.1</version>

The version of the bundle, to be displayed in Update Manager and download section on HippoEDIT website.

description (opional)

<description>Simple plug-in that extends standard ToolBar by View -&gt; Editor buttons</description>

The description of the bundle, to be displayed in Update Manager and download section on HippoEDIT website.

author (opional)

<author>HippoEDIT.com</author>

The author of the bundle and content, to be displayed in Update Manager and download section on HippoEDIT website.

email (opional)

<email>supportbox@hippoedit.com</email>

The author of the bundle and content, to be displayed in Update Manager and download section on HippoEDIT website. The email address would be obfuscated when displayed on web pages.

homepage (opional)

<homepage>http://wiki.hippoedit.com/plugins/view-editor-toolbar</homepage>

The bundle homepage addressб to be displayed in Update Manager and download section on HippoEDIT website. The page may contain more information/documentation about the extension.

memo (opional)

<memo></memo>

Multiline description of the extension. Currently not used.

All instructions found inside of the <install>…</install> block will be executed by HippoEDIT when a user triggers the installation of the bundle (from Update Manager, from locally executing the bundle by double click etc). The instructions are executed in the sequence they are located in package-info.xml file.

readme

<readme type="inline">This will install ViewEditorToolbar plug-in for HippoEDIT.</readme>

The node defines information to be displayed to a user in the popup, before the bundle is installed. Attributes:

  • type [inline] - the way the information is presented. Currently only inline type is supported, leading to display the information in message box.

require-file

<require-file name="main.hejs" destination="%{plugins}%/view-editor-toolbar/main.hejs" />

Triggers extraction of single file from the bundle in desired destination on target machine.

Attributes:

  • name - location of the file inside of the bundle (zip archive)
  • destination - location, where the file shall be extracted. If the destination already contains the file with the same name, existing file will be overwritten. You can use installer variables withing destination name. If the destination file directory(ies) not exists, it will be created automatically.
  • create_only = [true|false], default = false - when attribute set, existing file is not overwritten.

require-dir

<require-dir name="core" destination="%{plugins}%/emmet/core"/>

Triggers extraction of the directory from within the bundle archive with respect to bundle hierarchy into destination directory on target machine.

Attributes:

  • name - location of the directory inside of the bundle (zip archive)
  • destination - location, in which the directory shall be extracted. If the destination already contains the directory with the same name which has files inside, existing files from the directory will be overwritten by new files from the bundle. You can use installer variables withing destination name. If the destination file directory(ies) not exists, it will be created automatically.
  • create_only = [true|false], default = false - when attribute set, existing files in destination directory are not overwritten.
  • mask - a mask of files to be extracted from the bundle directory (for example *.xml).

require-zip

<require-zip name="module.zip" destination="%{plugins}%/view-editor-toolbar/" />

Triggers extaction of the embedded zip archive into temporary file and then subsequent extraction of the embedded zip into destination directory.

Attributes:

  • name - location of the file inside of the bundle (zip archive)
  • destination - location, in which files from the embedded zip to be extracted. If the destination already contains files with same names as extracted, existing files from the directory will be overwritten by new files from the bundle. You can use installer variables withing destination name. If the destination file directory(ies) not exists, it will be created automatically.
  • create_only = [true|false], default = false - when attribute set, existing files in destination directory are not overwritten.

install-plugin

<install-plugin path="%{plugins}%/view-editor-toolbar/main.hejs"/>

Register and activate a plugin from the given path - it shall be path to main plugin file. The plugin file and all dependencies shall be already installed on target machine by require-file/require-dir instructions.

install-syntax

<install-syntax path="%{syntax}%/json_spec.xml"/>

Registers and activates syntax schema from the given path on target machine. The instruction shall be called after all necessary files are already copied to target directory.

  • path - path to syntax scheme to install on the target machine. You can use installer variables withing destination name.

install-macro

<install-macro path="%{macros}%/format.hemcr"/>

Registers and activates macro from the given path on target machine. The instruction shall be called after all necessary files are already copied to target directory.

  • path - path to macro to install on the target machine. You can use installer variables withing destination name.

install-keymap

<install-keymap path="%{keymaps}%/vim.xml"/>

Registers and activates keyboard mapping from the given path on target machine. The instruction shall be called after all necessary files are already copied to target directory.

Attributes:

  • path - path to keyboard mapping to install on the target machine. You can use installer variables withing destination name.

install-color

<install-color path="%{colors}%/color_highcontrast.xml"/>

Registers and activates color palette from the given path on target machine. The instruction shall be called after all necessary files are already copied to target directory.

  • path - path to keyboard mapping to install on the target machine. You can use installer variables withing destination name.

install-template

<install-template path="%{colors}%/default.cpp"/>

Registers and activates file template from the given path on target machine. The instruction shall be executed after all necessary files are already copied to target directory.

  • path - path to file template to install on the target machine. You can use installer variables withing destination name.

All instructions found inside of the <uninstall>…</uninstall> block will be executed by HippoEDIT when an uninstallation of the bundle (from Update Manager) happens. The instructions are executed in the sequence they are located in package-info.xml file.

readme

<readme type="inline">This will uninstall View Editor ToolBar plug-in for HippoEDIT.</readme>

The node defines information to be displayed to a user in the popup, before the bundle is uninstalled. Attributes:

  • type [inline] - the way the information is presented. Currently only inline type is supported, leading to display the information in message box.

uninstall-plugin

<uninstall-plugin id="CAD932AC-894A-48F2-BAAD-D270B2B28C51"/>

Deactives and unregister the plugin by ID. Shall be done before the plugin files are deleted.

  • id - unique ID of the plugin (defined in plugin bundle and in the plugin itself).

uninstall-syntax

<uninstall-syntax id="json"/>

Deactives and unregister the syntax scheme by ID. Shall be done before the syntax files are deleted.

  • id - unique ID of the syntax (defined in plugin bundle and in the syntax scheme itself).

uninstall-macro

<uninstall-macro name="%macros%/format.hemcr"/>

Deactives and unregister the macro by path. Shall be done before the macro file is deleted.

  • name - path to the macro file on the target machine. You can use installer variables withing destination name.

uninstall-keymap

<uninstall-keymap name="%keympas%/vim.xml"/>

Deactives and unregisters the keymap by path. Shall be done before the keymap file is deleted.

  • name - path to the keymap file on the target machine (normally %keymaps%/<keymap name>.xml). You can use installer variables withing destination name.

uninstall-color

<uninstall-color name="%colors%/color_highcontrast.xml"/>

Deactives and unregisters the color palette by path. Shall be done before the color palette file is deleted.

  • name - path to the color palette file on the target machine (normally %colors%/color_<palette name>.xml). You can use installer variables withing destination name.

uninstall-template

<uninstall-template name="%templates%/default.cpp"/>

Deactives and unregisters the file template by path. Shall be done before the file template file is deleted.

  • name - path to the template file on the target machine (normally %templates%/default.<ext>). You can use installer variables withing destination name.

remove-dir

<remove-dir name="%{plugins}%/view-editor-toolbar"/>

Recursively removes directory.

  • name - path to the directory to be deleted on the target machine. You may use installer variables withing name attribute.

remove-file

<remove-file name="%{plugins}%/view-editor-toolbar/main.hejs"/>

Removes a file on target machine.

  • name - path to a file to be deleted on the target machine. You may use installer variables withing name attribute.

There are some buil-in variables, that can be used in installer instructions and which may simplify building of the file paths on destiantion side:

Description
%user% user directory location
%install% installation directory location
%data% location of the editor data files, normally under %user%\data
%templates% directory for file templates, normally under %user%\templates
%colors% directory for color schemes, normally under %data%\colors
%keymaps% directory for keyboard mappings, normally under %data%\keymaps
%syntax% directory for syntax definitions, normally under %data%\syntax
%dictionaries% directory for spell checker dictionaries, normally under %user%\dictionaries
%workspaces% directory for editor workspaces, normally under %user%\workspaces
%plugins% directory for plugins, normally under %install%\plugins
%user-plugins% directory for user plugins, normally under %user%\plugins
%macros% directory for macros, normally under %user%\macros
%scripts% directory for common scripts, normally under %user%\scripts