A CONFIGSYS element specifies how the user's CONFIG.SYS file is to be changed 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 CONFIGSYS element appears is selected for installation, the CONFIG.SYS file should be changed and how it should be changed.

This element is optional, but can appear more than once per PCK block. If several CONFIGSYS elements appear, they are processed in the order in which they are specified.

If any package with a CONFIGSYS 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).

Words of Wisdom:

Note that we do not recommend changing CONFIG.SYS in the first place. With many applications, CONFIG.SYS changes are the result of a lack of conceptual design on the programmer's part. Especially if you think of changing the system paths to point to your installation directory, think again. This forces the user to reboot, slows down the system, makes de-installation more difficult, and moving application directories on the hard disk becomes a real hassle. 99% of all applications do NOT need to have system paths changed if you simply use the OS/2 APIs to query information about your executable.

Basically, I can only think of four situations where changing CONFIG.SYS would actually be necessary:

  1. Device drivers, of course.

  2. Applications which replace parts of the system (such as command shells, system DLL replacements, and such). For registering WPS classes however, changing CONFIG.SYS is almost never necessary, since the WPS class list supports specifying full paths. To prove this thesis: XWorkplace is one of the most complex WPS class replacements available and it does not need CONFIG.SYS to be changed.

  3. Registering global system DLLs with the SYS_DLLS keyword in OS2.INI to modify the behavior of Presentation manager. Those DLLs have to be on the LIBPATH.

  4. Large system extensions which add lots of new functionality and are a base for other programs, such as Odin, EMX or XFree/2. These create a complete directory tree, including BIN and DLL directories, into which other software will insert their stuff as well. But then again, much of the environment which these packages need can be created using CMD scripts, which saves the user from rebooting every time the environment changes.
Syntax:
<CONFIGSYS
    STATEMENT="statement"
    [   MODIFIES="NOTHING"              // default
             |   "REPLACEKEY"
             |   "REPLACEPARAM(param)"
             |   "ADDLEFT"
             |   "ADDRIGHT"
    ]
    [   ADDTOFILE="BOTTOM"              // default
             |    "TOP"
             |    "AFTER(searchstr)"
             |    "BEFORE(searchstr)"
    ]
    [   REMOVE="NO"                     // default
             | "LINE(searchstr)"
             | "PART(searchstr)"
    ]
/>

Attributes:

STATEMENT="statement"
Required. This specifies the statement that should be added to the CONFIG.SYS file.

This supports macro resolution.

Per default (that is, if no other attributes are specified), the statement will simply be added in a new line to the end of the user's CONFIG.SYS file without any further checking, even if that line already existed.

Example:

<CONFIGSYS
    STATEMENT="SET RESTARTOBJECTS=NO" />
would add that line to the bottom of CONFIG.SYS (even if another SET RESTARTOBJECTS statement already existed).

This behavior can be changed with the other attributes (see below):

UNIQUE[(statement2)]
This makes sure that the statement part of the CONFIGSYS attribute occurs only once, i.e. will be unique in CONFIG.SYS, by searching for a similar line and replacing that line with the new line. If no such similar line is found, the new line is appended to the bottom of CONFIG.SYS (that position can be changed with ADDTOP, ADDBEFORE, ADDAFTER).

All searching is case-insensitive.

This assumes that statement contains a "=" character, as all CONFIG.SYS statements do. The exact behavior of UNIQUE depends on the syntax:


ADDRIGHT
This assumes that statement contains a "=" character and searches CONFIG.SYS for that first part. This is useful for path statements (SET PATH and the like).

If the first part of statement is found, the part after the "=" character is appended to that line in CONFIG.SYS. If no corresponding line is found, a new line is added to the bottom of CONFIG.SYS (that position can be changed with ADDTOP, ADDBEFORE, ADDAFTER).

This cannot be used with UNIQUE or ADDLEFT.

Example:

CONFIGSYS="SET PATH=$(1)\BIN | ADDRIGHT"
appends the BIN subdirectory of the target path of package 1 to the system path, using macro resolution.
ADDLEFT
Same as ADDRIGHT, but the part after the "=" character is inserted at the beginning of the list. This is only recommended if your data needs to appear first in the list (e.g. for replacing system DLLs). Be very careful with this one, this can lead to real problems.

This cannot be used with UNIQUE or ADDRIGHT.

ADDTOP or ADDAFTER(xxx) or ADDBEFORE(xxx)
Per default, lines are added to the bottom of CONFIG.SYS. These keywords modify this behavior so that lines are inserted at the very top, before, or after a line containing the specified search string "xxx".

Examples:

CONFIGSYS="BASEDEV=CRASHSYS.ADD /DOCRASH | UNIQUE(CRASHSYS.ADD) ADDBEFORE(IBM1S506.ADD)"
searches CONFIG.SYS for the line containing IBM1S506.ADD (the IBM IDE driver) and inserts BASEDEV=CRASHSYS.ADD / DOCRASH right before that line.
CONFIGSYS="SET INCLUDE=$(1)\INCLUDE | ADDRIGHT ADDAFTER(SET BOOKSHELF)"
searches CONFIG.SYS for a line starting with SET INCLUDE=. If such a line is found, assuming that the target path of package 1 is "F:\WHATEVER", "F:\WHATEVER\INCLUDE" is appended to that line. If that line is not found, a new line containing SET INCLUDE=F:\WHATEVER\INCLUDE is added before the line which contains SET BOOKSHELF=. Whoa.
REMOVELINE
This removes a whole line from CONFIG.SYS. In this case, statement is taken as a search string. If that string is found, the whole line which contains it is removed.

Example:

CONFIGSYS="BASEDEV=CRASHSYS.ADD | UNIQUE(CRASHSYS.ADD) ADDBEFORE(IBM1S506.ADD)"
CONFIGSYS="BASEDEV=IBM1S506.ADD | REMOVELINE"
replaces IBM1S506.ADD with CRASHSYS.ADD.
REMOVEPART
This removes some data from a line in CONFIG.SYS.

If a "=" character is found in statement, the CONFIG.SYS line starting with the first part of statement is searched, and the second part of statement is removed. (Useful for SET PATH=WHATEVER and the like.)