PCK
element accepts so-called macros.
Macros are WarpIN-specific and not defined by XML, but does not violate XML specifications. Unlike XML internal entities, macros are resolved only after the entire script has been successfully parsed. They can be used to insert variable data which is unknown until installation time on a user's machine.
The list below shows the macros which are currently defined. Note that macros are only resolved if this documentation explicitly states that macro resolution is supported for an element.
WarpIN resolves macros in the order of this list. Note that the quotes are not part of the macro definition.
"?:\"
: if this is found, the "?" character
will be replaced with the letter of the
OS/2 boot drive.
This is useful if you need to put files in the OS/2 system directories.
Example:
<PCK ... TARGET="?:\OS2\DLL" FIXEDPATH="YES">
This specifies the \OS2\DLL
directory as the target path for
a package, which cannot be changed.
"$(i)"
"$(/i)"
i
being a package index):
this will be replaced with the target path of the package which has
the index i
.
If the first character is a forward slash ("/"
), the resulting
path will be converted to the UNIX convention, i.e. all backslashes will be
converted to forward slashes. This is useful if you need paths in UNIX style,
e.g. for environment variables and EMX ports (V0.9.6).
Example:
<PCK ... > <CREATEOBJECT CLASSNAME="WPProgram" TITLE="SuperWord" LOCATION="<WP_DESKTOP>" SETUP="EXENAME=$(1)\bin\suprword.exe;OBJECTID=<SUPERWORD>" /> </PCK>creates a program object on the Desktop for the executable residing in the
bin
subdirectory of the install path of package 1.
"$(vendor\application\package)"
"$(/vendor\application\package)"
REQUIRES
element to the
PCK
element
so that a proper error message can be displayed if this package is not installed.
If the first character is a forward slash ("/"
), the resulting
path will be converted to the UNIX convention, i.e. all backslashes will be
converted to forward slashes. This is useful if you need paths in UNIX style,
e.g. for environment variables and EMX ports (V0.9.6).
This can only be used to reference packages which have previously been installed, not to reference packages in the same archive. Use the decimal index instead, as described above.
$(env)
(with env
being an
environment variable):
this will be replaced with the value of the environment variable env
.
Note that whenever WarpIN encounters a "$(xxx)"
string in a place where macro
resolution is allowed, and if "xxx" is not decimal (as above) and contains no
backslash (\
), it is assumed to be an environment variable.
If the environment variable cannot be resolved, WarpIN prompts the user
for entering a value. It is recommended to declare such environment variables
using the VARPROMPT
element.
WarpIN predefines a number of environment variables which can safely be used from install scripts. See "Script variables" for details.
Example:
<PCK ... TARGET="$(MMBASE)\DLL" FIXEDPATH="YES"> ... </PCK>specifies the
DLL
subdirectory of the MMPM/2 system directory
as the target path for a package. This variable is normally specified
in CONFIG.SYS
if MMPM/2 is installed.