PackageAddon

Introduced

v5.0

Description

Provides a convenient way to package or repackage an .xsiaddon file based on the files you have on disk.

Warning: The files you want to put in the .xsiaddon file must be stored in the correct directory structure. All files and subdirectories must be in a subdirectory of the Addons directory of the User or Workgroup path. For example, the files for an add-on named "MyParticleTool" must be in the "Addons/MyParticleTool" subdirectory. In this subdirectory, the add-on files must be in the standard locations for the different file types. For example, all toolbars must be in ".../Addons/MyParticleTool/Application/toolbars" and all self-installed plug-ins in ".../Addons/MyParticleTool/Application/Plugins".

Any .xsiaddon file that correctly specifies a subdirectory (see Addon.SubDirectory) automatically follows this organization when it is installed.

You can also use the Tree tab of the Plug-in Manager view to create and populate a properly-structured add-on.

If the files that you want to package into an .xsiaddon are not located in an Addons subdirectory, you can either use the "Package Addon" dialog to select the files individually, or you can move files manually (using Windows Explorer or a command shell) into the correct directory structure before you run this command.

The .xsiaddon file supports additional information, such as the author name, which is displayed when a user clicks Advanced in Install Add-On dialog box. This additional information is saved in the optional netview_ADDONNAME.xml file (where ADDONNAME is the name of the Addon.SubDirectory).

Scripting Syntax

oString = PackageAddon( SrcDir, [DestinationPath], [Overwrite], [ExcludeDirs] );

Return Value

An empty String if successful, and an error message otherwise.

Parameters

Parameter Type Description
SrcDir String The full path of an add-on subdirectory. For example, "\\myserver\myworkgroup\Addons\MyParticleTool".
DestinationPath String Full path of the .xsiaddon file to create. For example, "c:\mytools\MyParticleTool.xsiaddon".

Default Value: An .xsiaddon file named after the addon subdirectory is created in the "Addons" directory. For example, "\\myserver\myworkgroup\Addons\MyParticleTool.xsiaddon".

Overwrite Boolean Specifies whether to automatically overwrite any existing file with the same name as the DestinationPath argument.

Default Value: true

ExcludeDirs String A semicolon-separated list of directories to exclude. For example, "Debug;Ship" excludes the content of directories named Debug or Ship from the .xsiaddon file. This is not a relative path, so it excludes both "...Addons/MyAddon/Debug" and "...Addons/MyAddon/Application/Debug". Any subdirectory in an excluded directory is also excluded. When you package C++ plug-ins, this argument allows you to avoid including source code or temporary .obj files in the output file.

See Also

CreateAddonDirectories InstallAddon XSIApplication.CreateAddon Addon