Even though the information on the previous page and the minimal sample script showed you how the basic principles of creating WarpIN scripts, you will probably want to have Workplace Shell objects created for your program.

This is fairly simple. There is a special element called CREATEOBJECT, which does exactly that.

WarpIN considers creating WPS objects part of the "system configuration", which is just a arbitrary term for changes made to the user's system other than unpacking files. (CONFIG.SYS changes, WPS class registration, and profile data fall into this category as well.)

As a general rule, all system configuration is specified in the script on a per-package basis. As a result, the CREATEOBJECT element is a sub-element of the PCK element. This has the consequence that WPS objects are only created if the corresponding package was selected for installation and has successfully been installed.

The CREATEOBJECT element has a number of attributes, which vaguely correspond to the parameters to the REXX SysCreateObject function.

A typical create-object sequence for an application would be like the following:

  1. Create a folder on the desktop. This is done by specifying the WPFolder WPS class with the CLASSNAME attribute of the CREATEOBJECT element. Specify <WP_DESKTOP> with the LOCATION attribute to have the folder created on the WPS Desktop.

    The setup string (specified with the SETUP attribute) must then specify an object ID for the new folder. This is necessary because for one, we need the object ID in step 2 to create a program object in the folder. Secondly, WarpIN needs the object ID to be able to delete the WPS objects on de-installation later.

    The setup string for an object ID looks like OBJECTID=<STRING>. Note that all WPS object ID's must be enclosed in angle brackets. See the documentation for the CREATEOBJECT element for details.

  2. To create a program object in the new folder, use a second CREATEOBJECT element and specify the WPProgram WPS class. For LOCATION, specify the object ID of the folder, as specified above.

    To specify the executable, use the EXENAME setup string. This is probably the first time you will encounter WarpIN macro resolution, which allows you to have the target directory of a package (which was specified by the user before installation) inserted dynamically. This can be done by specifying:

    SETUP="EXENAME=$(1)\bin\suprword.exe;OBJECTID=<SUPERWORD>;"
    The $(1) stands for "target path of package with the index 1". See Macro resolution for details.

    Again, note the object ID given to the program object, so that WarpIN can later delete the object on de-installation.