home *** CD-ROM | disk | FTP | other *** search
- /* -------------------------------------------------------------- */
- /* NetProg Sample program Installation procedure. */
- /* Copyright (c) 1993 IBM Corp. */
- /* IBM Internal Use Only */
- /* */
- /* WARNING: if you use these samples as is, they will take a long*/
- /* time to create because the network will search for an alias */
- /* name that doesn't exist. So, fill in your own names to improve*/
- /* performance. (and so they will run) */
- /* */
- /* the setup strings you pass in here will be used as the default */
- /* when the user hits the default button. */
- /* -------------------------------------------------------------- */
-
- Call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs';
- Call SysLoadFuncs;
-
- /* creating folder to contain network objects and open it*/
-
- rc = SysCreateObject( 'WPFolder', 'NetProg Objects','<WP_DESKTOP>', ,
- 'OBJECTID=<NET_FLDR>;OPEN=ICON', ,
- 'ReplaceIfExists');
-
- /* WARNING: do not put spaces between keywords and the semi colon
- * in your setup strings. workplace doesn't handle that well.
- */
-
-
- /* here is an example of how to create a network program.
- * OBJECTID is used so you can find the object again. Try to
- * avoid using objectids when possible and stick to persistent
- * HOBJECT returned from SysCreateObject.
- * NETNAME is the network location. use UNC format or alias name.
- * USEALIAS Not used anymore. Netprog is smarter now...
- * PROGRAMPATH is path of program w/o net name. starts with '\'
- *
- * VERY IMPORTANT!!! Do not use EXENAME= supported by the WPProgram
- * class... use PROGRAMPATH=
- *
- * LANDRIVE is requested drive to net use for program path.
- * if not specified, set to '*' which means any drive.
- *
- * WDNETNAME same as NETNAME but for working directory. If WD setup
- * is not specified, it defaults to program path.
- * WDUSEALIAS Not used anymore. Netprog is smarter now...
- * WDLANDRIVE same as LANDRIVE for working dir
- * WORKINGDIR Working directory path w/o net name. starts with '\'
- *
- * ENVREPLACE replace following environment string
- * ENVAPPEND append following environment string to current environment
- * of the shell.
- * ENVPREPEND prepend following environment string to current environment
- * of the shell.
- * example: ENVREPLACE PATH=C:\MYPATH^;C:\ANOTHERPATH^;
- * (use ^ before ';' that are included in the string. this is
- * because the separator for setup strings is semi-colon)
- * you must provide proper separator in the BEGINNING of env. string
- * for ENVAPPEND for any env variable other than PATH and DPATH.
- * Also provide proper separator at the END for ENVPREPEND for
- * env variables other than PATH and DPATH.
- *
- * NetProg will automatically fix separator placement for PATH or
- * DPATH on execution.
- *
- * Also, '?' gets replaced on execution with program network drive
- * and '~' gets replaced on executaion with working dir network drive
- * e.g. ENVREPLACE PATH=?:\MYPATH;~:\ANOTHER => PATH=Z:\MYPATH;Y:\ANOTHER;
- *
- *
- *
- *
- * NOTE: env strings only work for OS/2 programs. (not DOS or WIN-OS/2)
- *
- * all these setup key values can also be set by the user through
- * the setup notebook Program page, Working Dir page, and
- * Environment page.
- *
- * RUNBEFORE= fully qualified path for .cmd file to run before starting
- * this network program.
- *
- * RUNAFTER= fully qualified path for .cmd file to run after starting
- * this network program.
- *
- * RUNBEFORESTYLE= INSTALL run only once for this program and never
- * again.
- *
- * (default) ONCE do not run when there is already an instance
- * of the program running. (like for net uses.
- * if there are many instances, the net uses
- * don't need to be done again)
- *
- * MULTIPLE run every time an instance is executed.
- *
- * RUNAFTERSTYLE= ONCE do not run when there is already an instance
- * (default) of the program running. (like for net uses.
- * if there are many instances, the net uses
- * don't need to be done again)
- *
- * MULTIPLE run every time an instance is executed.
- *
- * EXTRADRIVES= specify extra drives to be net used
- * this is in the form of netname^D^n,netname^D^n;
- *
- * netname can be an alias or UNC path
- * D is the drive letter desired ('*' for any) this is required.
- * n is a number to assign this drive if you are using * and want
- * to also use substitution in env strings. (you can only have
- * 9 of these 1-9) the ^n is optional.
- * ^ separates netname, drive letter, and number
- * , separates each separate extra drive requested
- *
- * EXAMPLE: EXTRADRIVES=myalias^*^1,\\myserv\myshare^Q;ENVREPLACE PATH=?1\mypath;
- *
- * here I want myalias assigned to any drive given the drive number
- * 1 so it can be replaced in my PATH statement for ENVREPLACE.
- * note I used ?1\ the '?' tells netprog to substitute the drive
- * and the '1' following directly after means use extra drive 1
- * (if you don't put the number the program path drive will be used)
- * NOTE: don't put a colon. I will replace the '?' with the drive letter
- * and the '1' or whatever number with a ':'. This makes my life
- * easier when substituting characters.
- *
- *
- *
- * RUNIFFAIL = YES if any or all of extra drives fail to get accessed
- * message goes up but program will still run.
- * NO message goes up program does not run.
- * NOTE: this is for extra drives ONLY!!!
- *
- *
- * NOTE: netprog is a descendent from the workplace default WPProgram
- * class. All keywords (except for EXENAME and STARTUPDIR )
- * are supported. One useful one is PARAMETERS=
- *
- * example "PARAMETERS=these are my parameters"
- * specify as many parameters you want with blanks between them
- * (don't put a semi colon in it)
- *
- * RUNBACKGROUND = YES run the command files in the background
- * NO (default) run them in foreground
- *
- */
- rc=SysCreateObject('NetProg','Network Program 1', '<NET_FLDR>', ,
- 'OBJECTID=<NetProg1>;NETNAME=\\server\resource;PROGRAMPATH=\dir1\dir2\program.exe;LANDRIVE=q;WDNETNAME=\\server2\resource2;WDLANDRIVE=r;WORKINGDIR=\temp;', ,
- 'ReplaceIfExists');
-
- /* for above object 1:
- * OBJECTID=<NetProg1> assign object id so we can find this one later
- * NETNAME=\\server\resource UNC path for network name
- * PROGRAMPATH=\dir1\dir2\program.exe program path (must have '\' in front)
- * LANDRIVE=q requested LAN drive
- * WDNETNAME=\\server2\resource2 Working dir path
- * WORKINGDIR=\temp working dir (must have '\' in front)
- */
-
- If rc <> 1
- Then Do;
- Say "NetProg: could not create its object, either an error occured or the object exists";
- End;
- Else Do;
- Say "Network Program object 1 created OK.";
- End;
-
- /* some programs require extra dos settings (see dos settings or
- * windows settings on session page in settings notebook)
- *
- * here's an example that raises the DPMI_MEMORY_LIMIT of a fake
- * windows executable called WINAPP.EXE on a LAN alias called WINAPPS
- */
-
- rc=SysCreateObject('NetProg','Network Program 2', '<NET_FLDR>', ,
- 'SET DPMI_MEMORY_LIMIT=64;OBJECTID=<NetProg2>;NETNAME=WINAPPS;PROGRAMPATH=\APPS\WINAPP.EXE;LANDRIVE=l', ,
- 'ReplaceIfExists');
-
- /* for above object 2:
- * SET DPMI_MEMORY_LIMIT=64 one of many dos settings you could use
- * OBJECTID=<NetProg2> unique object id for this object
- * NETNAME=WINAPPS network alias name
- * PROGRAMPATH=\apps\winapp.exe program path
- * LANDRIVE=l requested lan drive
- *
- * no working dir for this object.
- */
-
-
- If rc <> 1
- Then Do;
- Say "NetProg: could not create its object, either an error occured or the object exists";
- End;
- Else Do;
- Say "Network Program object 2 created OK.";
- End;
-
- rc=SysCreateObject('NetProg','Network Program 3', '<NET_FLDR>', ,
- 'ENVREPLACE PATH=C:\MYPATH^;C:\ANOTHERPATH;ENVPREPEND HELP=C:\MYHELP^;;ENVAPPEND MYVAR=,Var with comma separator;OBJECTID=<NetProg3>;NETNAME=OS2APPS;PROGRAMPATH=\APPS\OS2APP.EXE;LANDRIVE=l', ,
- 'ReplaceIfExists');
-
- /* for above object 3:
- *
- * ENVREPLACE PATH=C:\MYPATH^;C:\ANOTHERPATH replace path in
- * environment. (note '^' to denote ';' in string)
- * ENVPREPEND HELP=C:\MYHELP^; prepend C:\MYHELP; to current env.
- * (note "^;" at end for prepend)
- * ENVAPPEND MYVAR=,Var with comma separator This is a dummy env var
- * that uses ',' as separator. (note: added to
- * beginning for append)
- */
-
-
- If rc <> 1
- Then Do;
- Say "NetProg: could not create its object, either an error occured or the object exists";
- End;
- Else Do;
- Say "Network Program object 3 created OK.";
- End;
-
- rc=SysCreateObject('NetProg','Network Program 4', '<NET_FLDR>', ,
- 'RUNBEFORE=C:\runbef.cmd;RUNAFTER=c:\runaft.cmd param1;RUNBEFORESTYLE=MULTIPLE;RUNAFTERSTYLE=MULTIPLE;RUNFOREGROUND=NO;OBJECTID=<NetProg4>;NETNAME=OS2APPS;PROGRAMPATH=\APPS\OS2APP.EXE;LANDRIVE=l', ,
- 'ReplaceIfExists');
-
- /* for above object 4:
- *
- * RUNBEFORE c:\runbef.cmd will be run before netprog is executed.
- *
- * RUNAFTER c:\runaft.cmd will be run after netprog is executed (param1
- * is passed as parameter. can have any # of params.
- *
- * RUNBEFORESTYLE multiple so even if there is already an instance of
- * the program running, runbef.cmd will still run when
- * a second one is opened.
- *
- * RUNAFTERSTYLE multiple for runaft.cmd (same as above)
- *
- * RUNFOREGROUND =NO - don't run this .cmd file in the foreground.
- */
-
-
- If rc <> 1
- Then Do;
- Say "NetProg: could not create its object, either an error occured or the object exists";
- End;
- Else Do;
- Say "Network Program object 4 created OK.";
- End;
-
- Exit;