A CREATEOBJECT element specifies a Workplace Shell object to be created when a package is selected for installation.

This can only be specified in a PCK block and defines that if the package in which the CREATEOBJECT element appears is selected for installation, the specified WPS object should be created.

This element is optional, but can appear more than once per PCK block. If several CREATEOBJECT elements appear, they are processed in the order in which they are specified. This allows you to create a folder first and then objects in the folder. Also note that all REGISTERCLASS elements are processed before the CREATEOBJECT elements so you can create objects of a class that has just been registered.

This element offers the same functionality as the REXX SysCreateObject function.

If any package with a CREATEOBJECT element has been selected for installation, WarpIN will display a corresponding checkbox on the "System Configuration" page (see the PAGE element for more on that).

Syntax:

<CREATEOBJECT
    CLASSNAME="classname"
    TITLE="title"
    LOCATION="location"
    [SETUP="setupstring"]
    [REPLACE="{YES|NO}"]
/>
This is an empty element and must therefore be terminated with a "/" character.

Attributes:

CLASSNAME="classname"
Required. The WPS class of which to create an object. For example, to create a folder, use "WPFolder". To create a program object, use "WPProgram".
TITLE="title"
Required. The title of the new object.
LOCATION="location"
Required. The location where to create the new object. This can either be a full path specification or a WPS object ID. Note that WPS object IDs must be in angle brackets (e.g. LOCATION="<WP_DESKTOP>").

This supports macro resolution.

SETUP="setupstring"
Optional, but strongly recommended. A class-specific setup string for the new object.

For each of its classes, the WPS defines tons of setup strings, each of which has a safe default value if it's not specified at object creation. As a result, you can specify no setup string, one setup string, or several setup strings with this attribute. If you specify several, separate them using semicola (";"). See the example below.

This supports macro resolution.

Note: Even though the config substring is optional, it is strongly recommended to always use an object ID setup string (like "OBJECTID=<APP_OBJECT>"), because otherwise WarpIN will not be able to delete your WPS objects upon de-installation.

Always terminate the entire setup string (even the last part, if you specify several) with a semicolon because some older versions of OS/2 (without fixpaks) get confused otherwise. Also, the OBJECTID= setup string should always be the last setup string for the same reason.

REPLACE="{YES|NO}"
Optional. If REPLACE="YES" is specified, an existing object with the same object ID is deleted before the new object is created. If REPLACE="NO" is specified (which is the default), an existing object only gets updated, but will remain in its old location.

This is the same as the "R" parameter to REXX SysCreateObject.

Example: This will create a "SuperWord" folder on the Desktop and a program object for the "suprword.exe" executable in that new folder, using the target path specified with this package.

<PCK INDEX="2" ...>
<CREATEOBJECT
    CLASSNAME="WPFolder"
    TITLE="SuperWord Installation"
    LOCATION="<WP_DESKTOP>"
    SETUP="OBJECTID=<SUPERWORDFOLDER>;" />
<CREATEOBJECT
    CLASSNAME="WPProgram"
    TITLE="SuperWord"
    LOCATION="<SUPERWORDFOLDER>"
    SETUP="EXENAME=$(1)\bin\suprword.exe;OBJECTID=<SUPERWORD>;" />
...
</PCK>