home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 31 / CDASC_31_1996_juillet_aout.iso / vrac_os2 / fm2245.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1996-05-19  |  49KB  |  1,197 lines

  1. /*
  2.  * FM/2 2.x installation program copyright (c) 1994/96 by M. Kimes
  3.  *
  4.  * This program creates folders to hold program and data objects,
  5.  * then creates program objects for each executable.  It only needs to be
  6.  * run once (unless you move the FM/2 directory -- see say notes at end).
  7.  * Run this program in the FM/2 directory (where you unpacked the archive).
  8.  *
  9.  * For unattended installation, remove the lines marked with "NOTE:" below.
  10.  */
  11.  
  12. /* see if we might be in the right directory... */
  13.  
  14. '@Echo off'
  15. 'cls'
  16.  
  17. say'     ┌───────────────────────────────────────────────────────────────────┐'
  18. say'     │                  FM/2 2.x Installation Program                    │'
  19. say'     │             FM/2 is copyright (c) 1993-96 by M. Kimes             │'
  20. say'     │                       All rights reserved                         │'
  21. say'     ├───────────────────────────────────────────────────────────────────┤'
  22. say'     ├───────────────────────────────────────────────────────────────────┤'
  23. say'     │                Have you read the READ.ME file yet?                │'
  24. say'     │        By running this program, you agree to the license          │'
  25. say'     │                     as specified in that file,                    │'
  26. say'     │      and it tells you how to install, so you should read it.      │'
  27. say'     │                             Please?                               │'
  28. say'     └───────────────────────────────────────────────────────────────────┘'
  29.  
  30. /*
  31.  * allow user to eliminate associations from being placed on AV/2.
  32.  * seemed to upset some fellow on CIS (I guess he doesn't know about
  33.  * Settings notebooks on WPS objects).
  34.  */
  35. assocfilter = ';ASSOCFILTER=*.ZIP,*.ARC,*.LZH,*.ARJ,*.ZOO,*.MO0,READ.ME,README,README.1ST,README.OS2,REGISTER.TXT'
  36. existed = ''
  37. parse upper arg dummy
  38. if dummy = 'NOASSOC' then assocfilter = ''
  39.  
  40. rc = stream('fm3.exe','c','query exists')
  41. if rc = '' then
  42. do
  43.   say 'Sorry, FM3.EXE not found.  Must not be right directory.  Terminating.'
  44.   exit
  45. end
  46.  
  47. /* tell user what we're doing, give him a chance to hit CTRL-C */
  48.  
  49. say ''
  50. say 'This program creates objects for FM/2 and does some drudgework for you.'
  51. say ''
  52.  
  53. /* load rexx utility functions */
  54.  
  55. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  56. call SysLoadFuncs
  57.  
  58. /* NOTE:  remove following 6 lines for unattended use... */
  59. call charout ,'  Press [Enter] to continue...'
  60. dummy = ''
  61. do until dummy = '0d'x
  62.   dummy = SysGetKey('NOECHO')
  63. end
  64. call charout ,'0d1b'x'[K'
  65.  
  66. /* save current directory */
  67.  
  68. curdir = directory()
  69.  
  70. /* say it, then do it */
  71.  
  72. say "Creating File Manager/2 folders and objects..."
  73.  
  74. /* first, create FM/2 folder */
  75.  
  76. rc = stream('fm2fldr.ico','c','query exists')
  77. title = "File Manager/2"
  78. classname = 'WPFolder'
  79. location = '<WP_DESKTOP>'
  80. setup = 'OBJECTID=<FM3_Folder>;OPEN=DEFAULT'
  81. if rc \= '' then setup = setup';ICONFILE='rc
  82. result = SysCreateObject(classname,title,location,setup,f)
  83. if rc \= '' then
  84. do
  85.   'DEL 'rc' 1>NUL 2>NUL'
  86. end
  87.  
  88. /* NOTE:  remove following 18 lines for unattended use... */
  89. if result = 0 then
  90. do
  91.   assocfilter = ''
  92.   existed = 'TRUE'
  93.   say ''
  94.   say 'The File Manager/2 folder already exists.'
  95.   call charout ,"Should I update the objects (it's painless)? (Y/N) "
  96.   dummy = ''
  97.   do forever
  98.     dummy = SysGetKey('NOECHO')
  99.     parse upper var dummy dummy
  100.     if dummy = '1b'x then dummy = 'N'
  101.     if dummy = '0d'x then dummy = 'Y'
  102.     if dummy = 'N' then leave
  103.     if dummy = 'Y' then leave
  104.   end
  105.   call charout ,dummy
  106.   say ''
  107.   if dummy = 'N' then exit
  108. end
  109.  
  110. /* create objects in appropriate folders */
  111.  
  112. rc = stream('fm3.exe','c','query exists')
  113. if rc \= '' then
  114. do
  115.   title = "FM/2"
  116.   classname = 'WPProgram'
  117.   location = '<FM3_Folder>'
  118.   setup = 'OBJECTID=<FM/2>;EXENAME='rc';STARTUPDIR='curdir
  119.   if existed = '' then setup = setup';PARAMETERS=%*'
  120.   call SysCreateObject classname,title,location,setup,u
  121. end
  122.  
  123. /* create toolbox folder in FM/2 folder */
  124. rc = stream('toolbox.ico','c','query exists')
  125. title = "FM/2 Tools"
  126. classname = 'WPFolder'
  127. location = '<FM3_Folder>'
  128. setup = 'OBJECTID=<FM3_Tools>;OPEN=DEFAULT'
  129. if rc \= '' then setup = setup';ICONFILE='rc
  130. result = SysCreateObject(classname,title,location,setup,u)
  131. if rc \= '' then
  132. do
  133.   'DEL 'rc' 1>NUL 2>NUL'
  134. end
  135.  
  136. rc = stream('av2.exe','c','query exists')
  137. if rc \= '' then
  138. do
  139.   title = "Archive Viewer/2"
  140.   classname = 'WPProgram'
  141.   location = '<FM3_Tools>'
  142.   setup = 'OBJECTID=<FM/2_AV/2>;EXENAME='rc';STARTUPDIR='curdir''assocfilter
  143.   if existed = '' then setup = setup';PARAMETERS=%*'
  144.   call SysCreateObject classname,title,location,setup,u
  145. end
  146.  
  147. rc = stream('eas.exe','c','query exists')
  148. if rc \= '' then
  149. do
  150.   title = "EA Viewer"
  151.   classname = 'WPProgram'
  152.   location = '<FM3_Tools>'
  153.   setup = 'OBJECTID=<FM/2_EAVIEW>;EXENAME='rc';STARTUPDIR='curdir
  154.   if existed = '' then setup = setup';PARAMETERS=%*'
  155.   call SysCreateObject classname,title,location,setup,u
  156. end
  157.  
  158. rc = stream('dirsize.exe','c','query exists')
  159. if rc \= '' then
  160. do
  161.   title = "Dir Sizes"
  162.   classname = 'WPProgram'
  163.   location = '<FM3_Tools>'
  164.   setup = 'OBJECTID=<FM/2_DIRSIZE>;EXENAME='rc';STARTUPDIR='curdir
  165.   if existed = '' then setup = setup';PARAMETERS=%*'
  166.   call SysCreateObject classname,title,location,setup,u
  167. end
  168.  
  169. rc = stream('makearc.exe','c','query exists')
  170. if rc \= '' then
  171. do
  172.   title = "Make Archive"
  173.   classname = 'WPProgram'
  174.   location = '<FM3_Tools>'
  175.   setup = 'OBJECTID=<FM/2_MAKEARC>;EXENAME='rc';STARTUPDIR='curdir
  176.   if existed = '' then setup = setup';PARAMETERS=%*'
  177.   call SysCreateObject classname,title,location,setup,u
  178. end
  179.  
  180. rc = stream('ini.exe','c','query exists')
  181. if rc \= '' then
  182. do
  183.   if assocfilter \= '' then assocfilter = ';ASSOCFILTER=*.INI'
  184.   title = "INI Viewer"
  185.   classname = 'WPProgram'
  186.   location = '<FM3_Tools>'
  187.   setup = 'OBJECTID=<FM/2_INIVIEW>;EXENAME='rc';STARTUPDIR='curdir''assocfilter
  188.   if existed = '' then setup = setup';PARAMETERS=%*'
  189.   call SysCreateObject classname,title,location,setup,u
  190. end
  191.  
  192. rc = stream('viewinfs.exe','c','query exists')
  193. if rc \= '' then
  194. do
  195.   title = "Bookshelf Viewer"
  196.   classname = 'WPProgram'
  197.   location = '<FM3_Tools>'
  198.   setup = 'OBJECTID=<FM/2_BOOKSHELF>;EXENAME='rc';STARTUPDIR='curdir
  199.   call SysCreateObject classname,title,location,setup,u
  200.   title = "Helpfile Viewer"
  201.   classname = 'WPProgram'
  202.   location = '<FM3_Tools>'
  203.   setup = 'EXENAME='rc';PARAMETERS=DUMMY;STARTUPDIR='curdir
  204.   call SysCreateObject classname,title,location,setup,u
  205. end
  206.  
  207. rc = stream('killproc.exe','c','query exists')
  208. if rc \= '' then
  209. do
  210.   title = "Process Killer"
  211.   classname = 'WPProgram'
  212.   location = '<FM3_Tools>'
  213.   setup = 'OBJECTID=<FM/2_KILLPROC>;EXENAME='rc';PARAMETERS=%;STARTUPDIR='curdir
  214.   call SysCreateObject classname,title,location,setup,u
  215. end
  216.  
  217. rc = stream('undel.exe','c','query exists')
  218. if rc \= '' then
  219. do
  220.   title = "Undeleter"
  221.   classname = 'WPProgram'
  222.   location = '<FM3_Tools>'
  223.   setup = 'OBJECTID=<FM/2_UNDEL>;EXENAME='rc';STARTUPDIR='curdir
  224.   if existed = '' then setup = setup';PARAMETERS=%*'
  225.   call SysCreateObject classname,title,location,setup,u
  226. end
  227.  
  228. rc = stream('vtree.exe','c','query exists')
  229. if rc \= '' then
  230. do
  231.   title = "Visual Tree"
  232.   classname = 'WPProgram'
  233.   location = '<FM3_Tools>'
  234.   setup = 'OBJECTID=<FM/2_VTREE>;EXENAME='rc';STARTUPDIR='curdir
  235.   call SysCreateObject classname,title,location,setup,u
  236. end
  237.  
  238. rc = stream('vdir.exe','c','query exists')
  239. if rc \= '' then
  240. do
  241.   title = "Visual Directory"
  242.   classname = 'WPProgram'
  243.   location = '<FM3_Tools>'
  244.   setup = 'OBJECTID=<FM/2_VDIR>;EXENAME='rc';STARTUPDIR='curdir
  245.   if existed = '' then setup = setup';PARAMETERS=%*'
  246.   call SysCreateObject classname,title,location,setup,u
  247. end
  248.  
  249. rc = stream('vcollect.exe','c','query exists')
  250. if rc \= '' then
  251. do
  252.   title = "Collector"
  253.   classname = 'WPProgram'
  254.   location = '<FM3_Tools>'
  255.   setup = 'OBJECTID=<FM/2_VCOLLECT>;EXENAME='rc';STARTUPDIR='curdir
  256.   call SysCreateObject classname,title,location,setup,u
  257.   title = "Seek and scan"
  258.   classname = 'WPProgram'
  259.   location = '<FM3_Tools>'
  260.   setup = 'OBJECTID=<FM/2_VSEEK>;EXENAME='rc';PARAMETERS=**;STARTUPDIR='curdir
  261.   call SysCreateObject classname,title,location,setup,u
  262. end
  263.  
  264. rc = stream('global.exe','c','query exists')
  265. if rc \= '' then
  266. do
  267.   title = "Global File Viewer"
  268.   classname = 'WPProgram'
  269.   location = '<FM3_Tools>'
  270.   setup = 'OBJECTID=<FM/2_SEEALL>;EXENAME='rc';STARTUPDIR='curdir
  271.   call SysCreateObject classname,title,location,setup,u
  272. end
  273.  
  274. rc = stream('databar.exe','c','query exists')
  275. if rc \= '' then
  276. do
  277.   title = "Databar"
  278.   classname = 'WPProgram'
  279.   location = '<FM3_Tools>'
  280.   setup = 'OBJECTID=<FM/2_DATABAR>;EXENAME='rc';STARTUPDIR='curdir
  281.   call SysCreateObject classname,title,location,setup,u
  282. end
  283.  
  284. rc = stream('sysinfo.exe','c','query exists')
  285. if rc \= '' then
  286. do
  287.   title = "SysInfo"
  288.   classname = 'WPProgram'
  289.   location = '<FM3_Tools>'
  290.   setup = 'OBJECTID=<FM/2_SYSINFO>;EXENAME='rc';STARTUPDIR='curdir
  291.   call SysCreateObject classname,title,location,setup,u
  292. end
  293.  
  294. rc = stream('READ.ME','c','query exists')
  295. if rc \= '' then
  296. do
  297.   title = "Read.Me"
  298.   classname = 'WPShadow'
  299.   location = '<FM3_Folder>'
  300.   setup = 'SHADOWID='rc
  301.   call SysCreateObject classname,title,location,setup,u
  302. end
  303.  
  304. rc = stream('HISTORY.TXT','c','query exists')
  305. if rc \= '' then
  306. do
  307.   title = "History.Txt"
  308.   classname = 'WPShadow'
  309.   location = '<FM3_Folder>'
  310.   setup = 'SHADOWID='rc
  311.   call SysCreateObject classname,title,location,setup,u
  312. end
  313.  
  314. rc = stream('REGISTER.TXT','c','query exists')
  315. if rc \= '' then
  316. do
  317.   title = "Register.Txt"
  318.   classname = 'WPShadow'
  319.   location = '<FM3_Folder>'
  320.   setup = 'SHADOWID='rc
  321.   call SysCreateObject classname,title,location,setup,u
  322. end
  323.  
  324. rc = stream('FM3.HLP','c','query exists')
  325. if rc \= '' then
  326. do
  327.   if assocfilter \= '' then assocfilter=';ASSOCFILTER=*.HLP'
  328.   rc = stream('SEEHELP.EXE','c','query exists')
  329.   if rc \= '' then
  330.   do
  331.     title = "FM/2 Online Help"
  332.     classname = 'WPProgram'
  333.     location = '<FM3_Folder>'
  334.     setup = 'EXENAME='rc';STARTUPDIR='curdir';PARAMETERS= %* 'curdir'\FM3.HLP'
  335.     call SysCreateObject classname,title,location,setup,u
  336.   end
  337. end
  338.  
  339. rc = stream('UTILS\MAKEOBJ.CMD','c','query exists')
  340. if rc \= '' then
  341. do
  342.   title = "Make Object"
  343.   classname = 'WPProgram'
  344.   location = '<FM3_Tools>'
  345.   setup = 'EXENAME='rc';STARTUPDIR='curdir'\UTILS;PARAMETERS=%*'
  346.   call SysCreateObject classname,title,location,setup,u
  347. end
  348.  
  349. rc = stream('UTILS\FM2UTILS.DOC','c','query exists')
  350. if rc \= '' then
  351. do
  352.   title = "FM2UTILS.DOC"
  353.   classname = 'WPShadow'
  354.   location = '<FM3_Tools>'
  355.   setup = 'SHADOWID='rc
  356.   call SysCreateObject classname,title,location,setup,u
  357. end
  358.  
  359. /* create sample customizations for the user so they don't start 'blank' */
  360.  
  361. rc = stream('FM3MENU.DAT','c','query exists')
  362. if rc = '' then
  363. do
  364.   rc = stream('FM2MENU.TMP','c','query exists')
  365.   if rc \= '' then
  366.   do
  367.     say 'Creating a sample FM3MENU.DAT file for you.'
  368.     'REN FM3MENU.TMP FM3MENU.DAT 1>NUL 2>NUL'
  369.   end
  370. end
  371. 'DEL FM3MENU.TMP 1>NUL 2>NUL'
  372. rc = stream('ASSOC.DAT','c','query exists')
  373. if rc = '' then
  374. do
  375.   rc = stream('ASSOC.TMP','c','query exists')
  376.   if rc \= '' then
  377.   do
  378.     say 'Creating a sample ASSOC.DAT file for you.'
  379.     'REN ASSOC.TMP ASSOC.DAT 1>NUL 2>NUL'
  380.   end
  381. end
  382. 'DEL ASSOC.TMP 1>NUL 2>NUL'
  383. rc = stream('COMMANDS.DAT','c','query exists')
  384. if rc = '' then
  385. do
  386.   rc = stream('COMMANDS.TMP','c','query exists')
  387.   if rc \= '' then
  388.   do
  389.     say 'Creating a sample COMMANDS.DAT file for you.'
  390.     'REN COMMANDS.TMP COMMANDS.DAT 1>NUL 2>NUL'
  391.   end
  392. end
  393. 'DEL COMMANDS.TMP 1>NUL 2>NUL'
  394. rc = stream('FILTERS.DAT','c','query exists')
  395. if rc = '' then
  396. do
  397.   rc = stream('FILTERS.TMP','c','query exists')
  398.   if rc \= '' then
  399.   do
  400.     say 'Creating a sample FILTERS.DAT file for you.'
  401.     'REN FILTERS.TMP FILTERS.DAT 1>NUL 2>NUL'
  402.   end
  403. end
  404. 'DEL FILTERS.TMP 1>NUL 2>NUL'
  405. rc = stream('FM3TOOLS.DAT','c','query exists')
  406. if rc = '' then
  407. do
  408.   rc = stream('FM3TOOLS.TMP','c','query exists')
  409.   if rc \= '' then
  410.   do
  411.     say 'Installing an FM3TOOLS.DAT file for you.'
  412.     'REN FM3TOOLS.TMP FM3TOOLS.DAT 1>NUL 2>NUL'
  413.   end
  414. end
  415. 'DEL FM3TOOLS.TMP 1>NUL 2>NUL'
  416. rc = stream('QUICKTLS.DAT','c','query exists')
  417. if rc = '' then
  418. do
  419.   rc = stream('QUICKTLS.TMP','c','query exists')
  420.   if rc \= '' then
  421.   do
  422.     rc = stream('CMDS.TMP','c','query exists')
  423.     if rc \= '' then
  424.     do
  425.       rc = stream('UTILS.TMP','c','query exists')
  426.       if rc \= '' then
  427.       do
  428.         rc = stream('SORT.TMP','c','query exists')
  429.         if rc \= '' then
  430.         do
  431.           rc = stream('SELECT.TMP','c','query exists')
  432.           if rc \= '' then
  433.           do
  434.             say 'Creating a sample QUICKTLS.DAT file and toolboxes for you.'
  435.             'REN QUICKTLS.TMP QUICKTLS.DAT 1>NUL 2>NUL'
  436.             'REN CMDS.TMP CMDS.TLS 1>NUL 2>NUL'
  437.             'REN UTILS.TMP UTILS.TLS 1>NUL 2>NUL'
  438.             'REN SORT.TMP SORT.TLS 1>NUL 2>NUL'
  439.             'REN SELECT.TMP SELECT.TLS 1>NUL 2>NUL'
  440.           end
  441.           'DEL SELECT.TMP 1>NUL 2>NUL'
  442.         end
  443.        'DEL SORT.TMP 1>NUL 2>NUL'
  444.       end
  445.       'DEL UTILS.TMP 1>NUL 2>NUL'
  446.     end
  447.     'DEL CMDS.TMP 1>NUL 2>NUL'
  448.   end
  449. end
  450. 'DEL QUICKTLS.TMP 1>NUL 2>NUL'
  451.  
  452. /*
  453.  * create command files that the user can execute from anywhere (we'll
  454.  * ask the user to put this utils directory on the PATH) and that other
  455.  * programs can execute to use FM/2 as "their" file manager.
  456.  */
  457.  
  458. 'del SETENV.CMD 1>NUL 2>NUL'
  459. dummy = stream('SETENV.CMD','C','open')
  460. if dummy = 'READY:' then
  461. do
  462.   call lineout 'SETENV.CMD','@ECHO OFF'
  463.   call lineout 'SETENV.CMD','REM'
  464.   call lineout 'SETENV.CMD','REM If you prefer, you can call this .CMD file'
  465.   call lineout 'SETENV.CMD','REM instead of altering the PATH= statement in'
  466.   call lineout 'SETENV.CMD','REM CONFIG.SYS to gain access to the FM/2'
  467.   call lineout 'SETENV.CMD','REM command line utilities.'
  468.   call lineout 'SETENV.CMD','REM'
  469.   call lineout 'SETENV.CMD','IF "%FM2ENVSET%" == "" GOTO INSTALL'
  470.   call lineout 'SETENV.CMD','GOTO SKIP'
  471.   call lineout 'SETENV.CMD',':INSTALL'
  472.   call lineout 'SETENV.CMD','SET FM2ENVSET=YES'
  473.   call lineout 'SETENV.CMD','SET PATH=%PATH%;'curdir'\utils;'
  474.   call lineout 'SETENV.CMD','ECHO Path set for FM/2 and utilities.'
  475.   call lineout 'SETENV.CMD','GOTO END'
  476.   call lineout 'SETENV.CMD',':SKIP'
  477.   call lineout 'SETENV.CMD','ECHO Paths already set for FM/2 and utilities.'
  478.   call lineout 'SETENV.CMD',':END'
  479.   call stream 'SETENV.CMD','C','close'
  480. end
  481.  
  482. /*
  483.  * place an object for SETENV.CMD in folder so user doesn't have to diddle
  484.  * their PATH statement if they don't want to for command line work.
  485.  */
  486.  
  487.  
  488. rc = stream('SETENV.CMD','c','query exists')
  489. if rc \= '' then
  490. do
  491.   dummy = value('COMSPEC',,'OS2ENVIRONMENT')
  492.   if dummy = '' then dummy = value('OS2_SHELL',,'OS2ENVIRONMENT')
  493.   if dummy = '' then dummy = 'CMD.EXE'
  494.   title = "FM/2 Utilities command line"
  495.   classname = 'WPProgram'
  496.   location = '<FM3_Tools>'
  497.   setup = 'EXENAME='dummy';PARAMETERS=/K 'rc';STARTUPDIR=C:\'
  498.   call SysCreateObject classname,title,location,setup,u
  499. end
  500.  
  501. call SysMkDir curdir'\UTILS'
  502. dummy = directory(curdir'\UTILS')
  503. if dummy = curdir'\UTILS' then
  504. do
  505.   'set PATH=%PATH%;'curdir'\utils'
  506.   'move ..\example.cmd 1>NUL 2>NUL'
  507.   'del FM2.CMD 1>NUL 2>NUL'
  508.   dummy = stream('FM2.CMD','C','open')
  509.   if dummy = 'READY:' then
  510.   do
  511.     say 'Creating an FM2.CMD file.'
  512.     call lineout 'FM2.CMD', "/* FM/2 command file.  Locate in a directory"
  513.     call lineout 'FM2.CMD', " * on your PATH. */"
  514.     call lineout 'FM2.CMD', "'@echo off'"
  515.       call lineout 'FM2.CMD', "mydir = directory()"
  516.       call lineout 'FM2.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  517.       call lineout 'FM2.CMD', "if arg1 \= '' then "
  518.       call lineout 'FM2.CMD', "do"
  519.       call lineout 'FM2.CMD', "  if left(arg1,1,1) \= '/' then"
  520.       call lineout 'FM2.CMD', "  do"
  521.       call lineout 'FM2.CMD', "    arg0 = arg1"
  522.       call lineout 'FM2.CMD', "    arg1 = stream(arg1,'c','query exists')"
  523.       call lineout 'FM2.CMD', "    if arg1 = '' then"
  524.       call lineout 'FM2.CMD', "    do"
  525.       call lineout 'FM2.CMD', "      arg1 = directory(arg0)"
  526.       call lineout 'FM2.CMD', "      call directory mydir"
  527.       call lineout 'FM2.CMD', "    end"
  528.       call lineout 'FM2.CMD', "  end"
  529.       call lineout 'FM2.CMD', "end"
  530.       call lineout 'FM2.CMD', "else arg1 = mydir"
  531.       call lineout 'FM2.CMD', "if arg2 \= '' then "
  532.       call lineout 'FM2.CMD', "do"
  533.       call lineout 'FM2.CMD', "  if left(arg2,1,1) \= '/' then"
  534.       call lineout 'FM2.CMD', "  do"
  535.       call lineout 'FM2.CMD', "    arg0 = arg2"
  536.       call lineout 'FM2.CMD', "    arg2 = stream(arg2,'c','query exists')"
  537.       call lineout 'FM2.CMD', "    if arg2 = '' then"
  538.       call lineout 'FM2.CMD', "    do"
  539.       call lineout 'FM2.CMD', "      arg2 = directory(arg0)"
  540.       call lineout 'FM2.CMD', "      call directory mydir"
  541.       call lineout 'FM2.CMD', "    end"
  542.       call lineout 'FM2.CMD', "  end"
  543.       call lineout 'FM2.CMD', "end"
  544.       call lineout 'FM2.CMD', "if arg3 \= '' then "
  545.       call lineout 'FM2.CMD', "do"
  546.       call lineout 'FM2.CMD', "  if left(arg3,1,1) \= '/' then"
  547.       call lineout 'FM2.CMD', "  do"
  548.       call lineout 'FM2.CMD', "    arg0 = arg3"
  549.       call lineout 'FM2.CMD', "    arg3 = stream(arg3,'c','query exists')"
  550.       call lineout 'FM2.CMD', "    if arg3 = '' then"
  551.       call lineout 'FM2.CMD', "    do"
  552.       call lineout 'FM2.CMD', "      arg3 = directory(arg0)"
  553.       call lineout 'FM2.CMD', "      call directory mydir"
  554.       call lineout 'FM2.CMD', "    end"
  555.       call lineout 'FM2.CMD', "  end"
  556.       call lineout 'FM2.CMD', "end"
  557.       call lineout 'FM2.CMD', "if arg4 \= '' then "
  558.       call lineout 'FM2.CMD', "do"
  559.       call lineout 'FM2.CMD', "  if left(arg4,1,1) \= '/' then"
  560.       call lineout 'FM2.CMD', "  do"
  561.       call lineout 'FM2.CMD', "    arg0 = arg4"
  562.       call lineout 'FM2.CMD', "    arg4 = stream(arg4,'c','query exists')"
  563.       call lineout 'FM2.CMD', "    if arg4 = '' then"
  564.       call lineout 'FM2.CMD', "    do"
  565.       call lineout 'FM2.CMD', "      arg4 = directory(arg0)"
  566.       call lineout 'FM2.CMD', "      call directory mydir"
  567.       call lineout 'FM2.CMD', "    end"
  568.       call lineout 'FM2.CMD', "  end"
  569.       call lineout 'FM2.CMD', "end"
  570.       call lineout 'FM2.CMD', "if arg5 \= '' then "
  571.       call lineout 'FM2.CMD', "do"
  572.       call lineout 'FM2.CMD', "  if left(arg5,1,1) \= '/' then"
  573.       call lineout 'FM2.CMD', "  do"
  574.       call lineout 'FM2.CMD', "    arg0 = arg5"
  575.       call lineout 'FM2.CMD', "    arg5 = stream(arg5,'c','query exists')"
  576.       call lineout 'FM2.CMD', "    if arg5 = '' then"
  577.       call lineout 'FM2.CMD', "    do"
  578.       call lineout 'FM2.CMD', "      arg5 = directory(arg0)"
  579.       call lineout 'FM2.CMD', "      call directory mydir"
  580.       call lineout 'FM2.CMD', "    end"
  581.       call lineout 'FM2.CMD', "  end"
  582.       call lineout 'FM2.CMD', "end"
  583.       call lineout 'FM2.CMD', "if arg6 \= '' then "
  584.       call lineout 'FM2.CMD', "do"
  585.       call lineout 'FM2.CMD', "  if left(arg6,1,1) \= '/' then"
  586.       call lineout 'FM2.CMD', "  do"
  587.       call lineout 'FM2.CMD', "    arg0 = arg6"
  588.       call lineout 'FM2.CMD', "    arg6 = stream(arg6,'c','query exists')"
  589.       call lineout 'FM2.CMD', "    if arg6 = '' then"
  590.       call lineout 'FM2.CMD', "    do"
  591.       call lineout 'FM2.CMD', "      arg6 = directory(arg0)"
  592.       call lineout 'FM2.CMD', "      call directory mydir"
  593.       call lineout 'FM2.CMD', "    end"
  594.       call lineout 'FM2.CMD', "  end"
  595.       call lineout 'FM2.CMD', "end"
  596.       call lineout 'FM2.CMD', "if arg7 \= '' then "
  597.       call lineout 'FM2.CMD', "do"
  598.       call lineout 'FM2.CMD', "  if left(arg7,1,1) \= '/' then"
  599.       call lineout 'FM2.CMD', "  do"
  600.       call lineout 'FM2.CMD', "    arg0 = arg7"
  601.       call lineout 'FM2.CMD', "    arg7 = stream(arg7,'c','query exists')"
  602.       call lineout 'FM2.CMD', "    if arg7 = '' then"
  603.       call lineout 'FM2.CMD', "    do"
  604.       call lineout 'FM2.CMD', "      arg7 = directory(arg0)"
  605.       call lineout 'FM2.CMD', "      call directory mydir"
  606.       call lineout 'FM2.CMD', "    end"
  607.       call lineout 'FM2.CMD', "  end"
  608.       call lineout 'FM2.CMD', "end"
  609.       call lineout 'FM2.CMD', "if arg8 \= '' then "
  610.       call lineout 'FM2.CMD', "do"
  611.       call lineout 'FM2.CMD', "  if left(arg8,1,1) \= '/' then"
  612.       call lineout 'FM2.CMD', "  do"
  613.       call lineout 'FM2.CMD', "    arg0 = arg8"
  614.       call lineout 'FM2.CMD', "    arg8 = stream(arg8,'c','query exists')"
  615.       call lineout 'FM2.CMD', "    if arg8 = '' then"
  616.       call lineout 'FM2.CMD', "    do"
  617.       call lineout 'FM2.CMD', "      arg8 = directory(arg0)"
  618.       call lineout 'FM2.CMD', "      call directory mydir"
  619.       call lineout 'FM2.CMD', "    end"
  620.       call lineout 'FM2.CMD', "  end"
  621.       call lineout 'FM2.CMD', "end"
  622.       call lineout 'FM2.CMD', "if arg9 \= '' then "
  623.       call lineout 'FM2.CMD', "do"
  624.       call lineout 'FM2.CMD', "  if left(arg9,1,1) \= '/' then"
  625.       call lineout 'FM2.CMD', "  do"
  626.       call lineout 'FM2.CMD', "    arg0 = arg9"
  627.       call lineout 'FM2.CMD', "    arg9 = stream(arg9,'c','query exists')"
  628.       call lineout 'FM2.CMD', "    if arg9 = '' then"
  629.       call lineout 'FM2.CMD', "    do"
  630.       call lineout 'FM2.CMD', "      arg9 = directory(arg0)"
  631.       call lineout 'FM2.CMD', "      call directory mydir"
  632.       call lineout 'FM2.CMD', "    end"
  633.       call lineout 'FM2.CMD', "  end"
  634.       call lineout 'FM2.CMD', "end"
  635.     call lineout 'FM2.CMD', "n = setlocal()"
  636.     call lineout 'FM2.CMD', "n = directory('"curdir"')"
  637.     call lineout 'FM2.CMD', "'start fm3.exe 'arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  638.     call lineout 'FM2.CMD', "n = endlocal()"
  639.     call stream 'FM2.CMD','C','close'
  640.     'del AV2.CMD 1>NUL 2>NUL'
  641.     dummy = stream('AV2.CMD','C','open')
  642.     if dummy = 'READY:' then
  643.     do
  644.       say 'Creating an AV2.CMD file.'
  645.       call lineout 'AV2.CMD', "/* AV/2 command file.  Locate in a directory"
  646.       call lineout 'AV2.CMD', " * on your PATH. */"
  647.       call lineout 'AV2.CMD', "'@echo off'"
  648.       call lineout 'AV2.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  649.       call lineout 'AV2.CMD', "if arg1 \= '' then "
  650.       call lineout 'AV2.CMD', "do"
  651.       call lineout 'AV2.CMD', "  if left(arg1,1,1) \= '/' then"
  652.       call lineout 'AV2.CMD', "  do"
  653.       call lineout 'AV2.CMD', "    arg1 = stream(arg1,'c','query exists')"
  654.       call lineout 'AV2.CMD', "  end"
  655.       call lineout 'AV2.CMD', "end"
  656.       call lineout 'AV2.CMD', "else arg1 = directory()"
  657.       call lineout 'AV2.CMD', "if arg2 \= '' then "
  658.       call lineout 'AV2.CMD', "do"
  659.       call lineout 'AV2.CMD', "  if left(arg2,1,1) \= '/' then"
  660.       call lineout 'AV2.CMD', "  do"
  661.       call lineout 'AV2.CMD', "    arg2 = stream(arg2,'c','query exists')"
  662.       call lineout 'AV2.CMD', "  end"
  663.       call lineout 'AV2.CMD', "end"
  664.       call lineout 'AV2.CMD', "if arg3 \= '' then "
  665.       call lineout 'AV2.CMD', "do"
  666.       call lineout 'AV2.CMD', "  if left(arg3,1,1) \= '/' then"
  667.       call lineout 'AV2.CMD', "  do"
  668.       call lineout 'AV2.CMD', "    arg3 = stream(arg3,'c','query exists')"
  669.       call lineout 'AV2.CMD', "  end"
  670.       call lineout 'AV2.CMD', "end"
  671.       call lineout 'AV2.CMD', "if arg4 \= '' then "
  672.       call lineout 'AV2.CMD', "do"
  673.       call lineout 'AV2.CMD', "  if left(arg4,1,1) \= '/' then"
  674.       call lineout 'AV2.CMD', "  do"
  675.       call lineout 'AV2.CMD', "    arg4 = stream(arg4,'c','query exists')"
  676.       call lineout 'AV2.CMD', "  end"
  677.       call lineout 'AV2.CMD', "end"
  678.       call lineout 'AV2.CMD', "if arg5 \= '' then "
  679.       call lineout 'AV2.CMD', "do"
  680.       call lineout 'AV2.CMD', "  if left(arg5,1,1) \= '/' then"
  681.       call lineout 'AV2.CMD', "  do"
  682.       call lineout 'AV2.CMD', "    arg5 = stream(arg5,'c','query exists')"
  683.       call lineout 'AV2.CMD', "  end"
  684.       call lineout 'AV2.CMD', "end"
  685.       call lineout 'AV2.CMD', "if arg6 \= '' then "
  686.       call lineout 'AV2.CMD', "do"
  687.       call lineout 'AV2.CMD', "  if left(arg6,1,1) \= '/' then"
  688.       call lineout 'AV2.CMD', "  do"
  689.       call lineout 'AV2.CMD', "    arg6 = stream(arg6,'c','query exists')"
  690.       call lineout 'AV2.CMD', "  end"
  691.       call lineout 'AV2.CMD', "end"
  692.       call lineout 'AV2.CMD', "if arg7 \= '' then "
  693.       call lineout 'AV2.CMD', "do"
  694.       call lineout 'AV2.CMD', "  if left(arg7,1,1) \= '/' then"
  695.       call lineout 'AV2.CMD', "  do"
  696.       call lineout 'AV2.CMD', "    arg7 = stream(arg7,'c','query exists')"
  697.       call lineout 'AV2.CMD', "  end"
  698.       call lineout 'AV2.CMD', "end"
  699.       call lineout 'AV2.CMD', "if arg8 \= '' then "
  700.       call lineout 'AV2.CMD', "do"
  701.       call lineout 'AV2.CMD', "  if left(arg8,1,1) \= '/' then"
  702.       call lineout 'AV2.CMD', "  do"
  703.       call lineout 'AV2.CMD', "    arg8 = stream(arg8,'c','query exists')"
  704.       call lineout 'AV2.CMD', "  end"
  705.       call lineout 'AV2.CMD', "end"
  706.       call lineout 'AV2.CMD', "if arg9 \= '' then "
  707.       call lineout 'AV2.CMD', "do"
  708.       call lineout 'AV2.CMD', "  if left(arg9,1,1) \= '/' then"
  709.       call lineout 'AV2.CMD', "  do"
  710.       call lineout 'AV2.CMD', "    arg9 = stream(arg9,'c','query exists')"
  711.       call lineout 'AV2.CMD', "  end"
  712.       call lineout 'AV2.CMD', "end"
  713.       call lineout 'AV2.CMD', "n = setlocal()"
  714.       call lineout 'AV2.CMD', "n = directory('"curdir"')"
  715.       call lineout 'AV2.CMD', "'start av2.exe 'arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  716.       call lineout 'AV2.CMD', "n = endlocal()"
  717.       call stream 'AV2.CMD','C','close'
  718.     end
  719.     else say "Couldn't create AV2.CMD file."
  720.     'del VDIR.CMD 1>NUL 2>NUL'
  721.     dummy = stream('VDIR.CMD','C','open')
  722.     if dummy = 'READY:' then
  723.     do
  724.       say 'Creating a VDIR.CMD file.'
  725.       call lineout 'VDIR.CMD', "/* VDIR (FM/2) command file.  Locate in a directory"
  726.       call lineout 'VDIR.CMD', " * on your PATH. */"
  727.       call lineout 'VDIR.CMD', "'@echo off'"
  728.       call lineout 'VDIR.CMD', "mydir = directory()"
  729.       call lineout 'VDIR.CMD', "arg arg1 arg2"
  730.       call lineout 'VDIR.CMD', "if arg1 \= '' then "
  731.       call lineout 'VDIR.CMD', "do"
  732.       call lineout 'VDIR.CMD', "  if left(arg1,1,1) \= '/' then"
  733.       call lineout 'VDIR.CMD', "  do"
  734.       call lineout 'VDIR.CMD', "    arg0 = arg1"
  735.       call lineout 'VDIR.CMD', "    arg1 = stream(arg1,'c','query exists')"
  736.       call lineout 'VDIR.CMD', "    if arg1 = '' then"
  737.       call lineout 'VDIR.CMD', "    do"
  738.       call lineout 'VDIR.CMD', "      arg1 = directory(arg0)"
  739.       call lineout 'VDIR.CMD', "      call directory mydir"
  740.       call lineout 'VDIR.CMD', "    end"
  741.       call lineout 'VDIR.CMD', "  end"
  742.       call lineout 'VDIR.CMD', "end"
  743.       call lineout 'VDIR.CMD', "else arg1 = mydir"
  744.       call lineout 'VDIR.CMD', "n = setlocal()"
  745.       call lineout 'VDIR.CMD', "n = directory('"curdir"')"
  746.       call lineout 'VDIR.CMD', "'start vdir.exe 'arg1 '%2 %3 %4 %5 %6 %7 %8 %9'"
  747.       call lineout 'VDIR.CMD', "n = endlocal()"
  748.       call stream 'VDIR.CMD','C','close'
  749.     end
  750.     else say "Couldn't create VDIR.CMD file."
  751.     'del VTREE.CMD 1>NUL 2>NUL'
  752.     dummy = stream('VTREE.CMD','C','open')
  753.     if dummy = 'READY:' then
  754.     do
  755.       say 'Creating a VTREE.CMD file.'
  756.       call lineout 'VTREE.CMD', "/* VTREE (FM/2) command file.  Locate in a directory"
  757.       call lineout 'VTREE.CMD', " * on your PATH. */"
  758.       call lineout 'VTREE.CMD', "'@echo off'"
  759.       call lineout 'VTREE.CMD', "n = setlocal()"
  760.       call lineout 'VTREE.CMD', "n = directory('"curdir"')"
  761.       call lineout 'VTREE.CMD', "'start vtree.exe %1 %2 %3 %4 %5 %6 %7 %8 %9'"
  762.       call lineout 'VTREE.CMD', "n = endlocal()"
  763.       call stream 'VTREE.CMD','C','close'
  764.     end
  765.     else say "Couldn't create VTREE.CMD file."
  766.     'del VCOLLECT.CMD 1>NUL 2>NUL'
  767.     dummy = stream('VCOLLECT.CMD','C','open')
  768.     if dummy = 'READY:' then
  769.     do
  770.       say 'Creating a VCOLLECT.CMD file.'
  771.       call lineout 'VCOLLECT.CMD', "/* VCOLLECT (FM/2) command file.  Locate in a directory"
  772.       call lineout 'VCOLLECT.CMD', " * on your PATH. */"
  773.       call lineout 'VCOLLECT.CMD', "'@echo off'"
  774.       call lineout 'VCOLLECT.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  775.       call lineout 'VCOLLECT.CMD', "if arg1 \= '' then "
  776.       call lineout 'VCOLLECT.CMD', "do"
  777.       call lineout 'VCOLLECT.CMD', "  if left(arg1,1,1) \= '/' then"
  778.       call lineout 'VCOLLECT.CMD', "  do"
  779.       call lineout 'VCOLLECT.CMD', "    arg1 = stream(arg1,'c','query exists')"
  780.       call lineout 'VCOLLECT.CMD', "  end"
  781.       call lineout 'VCOLLECT.CMD', "end"
  782.       call lineout 'VCOLLECT.CMD', "if arg2 \= '' then "
  783.       call lineout 'VCOLLECT.CMD', "do"
  784.       call lineout 'VCOLLECT.CMD', "  if left(arg2,1,1) \= '/' then"
  785.       call lineout 'VCOLLECT.CMD', "  do"
  786.       call lineout 'VCOLLECT.CMD', "    arg2 = stream(arg2,'c','query exists')"
  787.       call lineout 'VCOLLECT.CMD', "  end"
  788.       call lineout 'VCOLLECT.CMD', "end"
  789.       call lineout 'VCOLLECT.CMD', "if arg3 \= '' then "
  790.       call lineout 'VCOLLECT.CMD', "do"
  791.       call lineout 'VCOLLECT.CMD', "  if left(arg3,1,1) \= '/' then"
  792.       call lineout 'VCOLLECT.CMD', "  do"
  793.       call lineout 'VCOLLECT.CMD', "    arg3 = stream(arg3,'c','query exists')"
  794.       call lineout 'VCOLLECT.CMD', "  end"
  795.       call lineout 'VCOLLECT.CMD', "end"
  796.       call lineout 'VCOLLECT.CMD', "if arg4 \= '' then "
  797.       call lineout 'VCOLLECT.CMD', "do"
  798.       call lineout 'VCOLLECT.CMD', "  if left(arg4,1,1) \= '/' then"
  799.       call lineout 'VCOLLECT.CMD', "  do"
  800.       call lineout 'VCOLLECT.CMD', "    arg4 = stream(arg4,'c','query exists')"
  801.       call lineout 'VCOLLECT.CMD', "  end"
  802.       call lineout 'VCOLLECT.CMD', "end"
  803.       call lineout 'VCOLLECT.CMD', "if arg5 \= '' then "
  804.       call lineout 'VCOLLECT.CMD', "do"
  805.       call lineout 'VCOLLECT.CMD', "  if left(arg5,1,1) \= '/' then"
  806.       call lineout 'VCOLLECT.CMD', "  do"
  807.       call lineout 'VCOLLECT.CMD', "    arg5 = stream(arg5,'c','query exists')"
  808.       call lineout 'VCOLLECT.CMD', "  end"
  809.       call lineout 'VCOLLECT.CMD', "end"
  810.       call lineout 'VCOLLECT.CMD', "if arg6 \= '' then "
  811.       call lineout 'VCOLLECT.CMD', "do"
  812.       call lineout 'VCOLLECT.CMD', "  if left(arg6,1,1) \= '/' then"
  813.       call lineout 'VCOLLECT.CMD', "  do"
  814.       call lineout 'VCOLLECT.CMD', "    arg6 = stream(arg6,'c','query exists')"
  815.       call lineout 'VCOLLECT.CMD', "  end"
  816.       call lineout 'VCOLLECT.CMD', "end"
  817.       call lineout 'VCOLLECT.CMD', "if arg7 \= '' then "
  818.       call lineout 'VCOLLECT.CMD', "do"
  819.       call lineout 'VCOLLECT.CMD', "  if left(arg7,1,1) \= '/' then"
  820.       call lineout 'VCOLLECT.CMD', "  do"
  821.       call lineout 'VCOLLECT.CMD', "    arg7 = stream(arg7,'c','query exists')"
  822.       call lineout 'VCOLLECT.CMD', "  end"
  823.       call lineout 'VCOLLECT.CMD', "end"
  824.       call lineout 'VCOLLECT.CMD', "if arg8 \= '' then "
  825.       call lineout 'VCOLLECT.CMD', "do"
  826.       call lineout 'VCOLLECT.CMD', "  if left(arg8,1,1) \= '/' then"
  827.       call lineout 'VCOLLECT.CMD', "  do"
  828.       call lineout 'VCOLLECT.CMD', "    arg8 = stream(arg8,'c','query exists')"
  829.       call lineout 'VCOLLECT.CMD', "  end"
  830.       call lineout 'VCOLLECT.CMD', "end"
  831.       call lineout 'VCOLLECT.CMD', "if arg9 \= '' then "
  832.       call lineout 'VCOLLECT.CMD', "do"
  833.       call lineout 'VCOLLECT.CMD', "  if left(arg9,1,1) \= '/' then"
  834.       call lineout 'VCOLLECT.CMD', "  do"
  835.       call lineout 'VCOLLECT.CMD', "    arg9 = stream(arg9,'c','query exists')"
  836.       call lineout 'VCOLLECT.CMD', "  end"
  837.       call lineout 'VCOLLECT.CMD', "end"
  838.       call lineout 'VCOLLECT.CMD', "n = setlocal()"
  839.       call lineout 'VCOLLECT.CMD', "n = directory('"curdir"')"
  840.       call lineout 'VCOLLECT.CMD', "'start vcollect.exe 'arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  841.       call lineout 'VCOLLECT.CMD', "n = endlocal()"
  842.       call stream 'VCOLLECT.CMD','C','close'
  843.     end
  844.     else say "Couldn't create VCOLLECT.CMD file."
  845.     'del INI.CMD 1>NUL 2>NUL'
  846.     dummy = stream('INI.CMD','C','open')
  847.     if dummy = 'READY:' then
  848.     do
  849.       say 'Creating an INI.CMD file.'
  850.       call lineout 'INI.CMD', "/* INI (FM/2) command file.  Locate in a directory"
  851.       call lineout 'INI.CMD', " * on your PATH. */"
  852.       call lineout 'INI.CMD', "'@echo off'"
  853.       call lineout 'INI.CMD', "arg arg1"
  854.       call lineout 'INI.CMD', "if arg1 \= '' then arg1 = stream(arg1,'c','query exists')"
  855.       call lineout 'INI.CMD', "n = setlocal()"
  856.       call lineout 'INI.CMD', "n = directory('"curdir"')"
  857.       call lineout 'INI.CMD', "'start INI.exe 'arg1"
  858.       call lineout 'INI.CMD', "n = endlocal()"
  859.       call stream 'INI.CMD','C','close'
  860.     end
  861.     else say "Couldn't create INI.CMD file."
  862.     'del EAS.CMD 1>NUL 2>NUL'
  863.     dummy = stream('EAS.CMD','C','open')
  864.     if dummy = 'READY:' then
  865.     do
  866.       say 'Creating an EAS.CMD file.'
  867.       call lineout 'EAS.CMD', "/* EAS (FM/2) command file.  Locate in a directory"
  868.       call lineout 'EAS.CMD', " * on your PATH. */"
  869.       call lineout 'EAS.CMD', "'@echo off'"
  870.       call lineout 'EAS.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  871.       call lineout 'EAS.CMD', "if arg1 \= '' then "
  872.       call lineout 'EAS.CMD', "do"
  873.       call lineout 'EAS.CMD', "  if left(arg1,1,1) \= '/' then"
  874.       call lineout 'EAS.CMD', "  do"
  875.       call lineout 'EAS.CMD', "    arg1 = stream(arg1,'c','query exists')"
  876.       call lineout 'EAS.CMD', "  end"
  877.       call lineout 'EAS.CMD', "end"
  878.       call lineout 'EAS.CMD', "else arg1 = directory()"
  879.       call lineout 'EAS.CMD', "if arg2 \= '' then "
  880.       call lineout 'EAS.CMD', "do"
  881.       call lineout 'EAS.CMD', "  if left(arg2,1,1) \= '/' then"
  882.       call lineout 'EAS.CMD', "  do"
  883.       call lineout 'EAS.CMD', "    arg2 = stream(arg2,'c','query exists')"
  884.       call lineout 'EAS.CMD', "  end"
  885.       call lineout 'EAS.CMD', "end"
  886.       call lineout 'EAS.CMD', "if arg3 \= '' then "
  887.       call lineout 'EAS.CMD', "do"
  888.       call lineout 'EAS.CMD', "  if left(arg3,1,1) \= '/' then"
  889.       call lineout 'EAS.CMD', "  do"
  890.       call lineout 'EAS.CMD', "    arg3 = stream(arg3,'c','query exists')"
  891.       call lineout 'EAS.CMD', "  end"
  892.       call lineout 'EAS.CMD', "end"
  893.       call lineout 'EAS.CMD', "if arg4 \= '' then "
  894.       call lineout 'EAS.CMD', "do"
  895.       call lineout 'EAS.CMD', "  if left(arg4,1,1) \= '/' then"
  896.       call lineout 'EAS.CMD', "  do"
  897.       call lineout 'EAS.CMD', "    arg4 = stream(arg4,'c','query exists')"
  898.       call lineout 'EAS.CMD', "  end"
  899.       call lineout 'EAS.CMD', "end"
  900.       call lineout 'EAS.CMD', "if arg5 \= '' then "
  901.       call lineout 'EAS.CMD', "do"
  902.       call lineout 'EAS.CMD', "  if left(arg5,1,1) \= '/' then"
  903.       call lineout 'EAS.CMD', "  do"
  904.       call lineout 'EAS.CMD', "    arg5 = stream(arg5,'c','query exists')"
  905.       call lineout 'EAS.CMD', "  end"
  906.       call lineout 'EAS.CMD', "end"
  907.       call lineout 'EAS.CMD', "if arg6 \= '' then "
  908.       call lineout 'EAS.CMD', "do"
  909.       call lineout 'EAS.CMD', "  if left(arg6,1,1) \= '/' then"
  910.       call lineout 'EAS.CMD', "  do"
  911.       call lineout 'EAS.CMD', "    arg6 = stream(arg6,'c','query exists')"
  912.       call lineout 'EAS.CMD', "  end"
  913.       call lineout 'EAS.CMD', "end"
  914.       call lineout 'EAS.CMD', "if arg7 \= '' then "
  915.       call lineout 'EAS.CMD', "do"
  916.       call lineout 'EAS.CMD', "  if left(arg7,1,1) \= '/' then"
  917.       call lineout 'EAS.CMD', "  do"
  918.       call lineout 'EAS.CMD', "    arg7 = stream(arg7,'c','query exists')"
  919.       call lineout 'EAS.CMD', "  end"
  920.       call lineout 'EAS.CMD', "end"
  921.       call lineout 'EAS.CMD', "if arg8 \= '' then "
  922.       call lineout 'EAS.CMD', "do"
  923.       call lineout 'EAS.CMD', "  if left(arg8,1,1) \= '/' then"
  924.       call lineout 'EAS.CMD', "  do"
  925.       call lineout 'EAS.CMD', "    arg8 = stream(arg8,'c','query exists')"
  926.       call lineout 'EAS.CMD', "  end"
  927.       call lineout 'EAS.CMD', "end"
  928.       call lineout 'EAS.CMD', "if arg9 \= '' then "
  929.       call lineout 'EAS.CMD', "do"
  930.       call lineout 'EAS.CMD', "  if left(arg9,1,1) \= '/' then"
  931.       call lineout 'EAS.CMD', "  do"
  932.       call lineout 'EAS.CMD', "    arg9 = stream(arg9,'c','query exists')"
  933.       call lineout 'EAS.CMD', "  end"
  934.       call lineout 'EAS.CMD', "end"
  935.       call lineout 'EAS.CMD', "n = setlocal()"
  936.       call lineout 'EAS.CMD', "n = directory('"curdir"')"
  937.       call lineout 'EAS.CMD', "'start eas.exe 'arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  938.       call lineout 'EAS.CMD', "n = endlocal()"
  939.       call stream 'EAS.CMD','C','close'
  940.     end
  941.     else say "Couldn't create EAS.CMD file."
  942.     'del DIRSIZE.CMD 1>NUL 2>NUL'
  943.     dummy = stream('DIRSIZE.CMD','C','open')
  944.     if dummy = 'READY:' then
  945.     do
  946.       say 'Creating a DIRSIZE.CMD file.'
  947.       call lineout 'DIRSIZE.CMD', "/* DIRSIZE (FM/2) command file.  Locate in a directory"
  948.       call lineout 'DIRSIZE.CMD', " * on your PATH. */"
  949.       call lineout 'DIRSIZE.CMD', "'@echo off'"
  950.       call lineout 'DIRSIZE.CMD', "mydir = directory()"
  951.       call lineout 'DIRSIZE.CMD', "arg arg1 arg2"
  952.       call lineout 'DIRSIZE.CMD', "if arg1 \= '' then "
  953.       call lineout 'DIRSIZE.CMD', "do"
  954.       call lineout 'DIRSIZE.CMD', "  if left(arg1,1,1) \= '/' then"
  955.       call lineout 'DIRSIZE.CMD', "  do"
  956.       call lineout 'DIRSIZE.CMD', "    arg0 = arg1"
  957.       call lineout 'DIRSIZE.CMD', "    arg1 = stream(arg1,'c','query exists')"
  958.       call lineout 'DIRSIZE.CMD', "    if arg1 = '' then"
  959.       call lineout 'DIRSIZE.CMD', "    do"
  960.       call lineout 'DIRSIZE.CMD', "      arg1 = directory(arg0)"
  961.       call lineout 'DIRSIZE.CMD', "      call directory mydir"
  962.       call lineout 'DIRSIZE.CMD', "    end"
  963.       call lineout 'DIRSIZE.CMD', "  end"
  964.       call lineout 'DIRSIZE.CMD', "end"
  965.       call lineout 'DIRSIZE.CMD', "else arg1 = mydir"
  966.       call lineout 'DIRSIZE.CMD', "n = setlocal()"
  967.       call lineout 'DIRSIZE.CMD', "n = directory('"curdir"')"
  968.       call lineout 'DIRSIZE.CMD', "'start dirsize.exe 'arg1 '%2 %3 %4 %5 %6 %7 %8 %9'"
  969.       call lineout 'DIRSIZE.CMD', "n = endlocal()"
  970.       call stream 'DIRSIZE.CMD','C','close'
  971.     end
  972.     else say "Couldn't create DIRSIZE.CMD file."
  973.     'del UNDEL.CMD 1>NUL 2>NUL'
  974.     dummy = stream('UNDEL.CMD','C','open')
  975.     if dummy = 'READY:' then
  976.     do
  977.       say 'Creating an UNDEL.CMD file.'
  978.       call lineout 'UNDEL.CMD', "/* UNDEL (FM/2) command file.  Locate in a directory"
  979.       call lineout 'UNDEL.CMD', " * on your PATH. */"
  980.       call lineout 'UNDEL.CMD', "'@echo off'"
  981.       call lineout 'UNDEL.CMD', "n = setlocal()"
  982.       call lineout 'UNDEL.CMD', "n = directory('"curdir"')"
  983.       call lineout 'UNDEL.CMD', "'start undel.exe %1'"
  984.       call lineout 'UNDEL.CMD', "n = endlocal()"
  985.       call stream 'UNDEL.CMD','C','close'
  986.     end
  987.     else say "Couldn't create UNDEL.CMD file."
  988.     'del KILLPROC.CMD 1>NUL 2>NUL'
  989.     dummy = stream('KILLPROC.CMD','C','open')
  990.     if dummy = 'READY:' then
  991.     do
  992.       say 'Creating a KILLPROC.CMD file.'
  993.       call lineout 'KILLPROC.CMD', "/* KILLPROC (FM/2) command file.  Locate in a directory"
  994.       call lineout 'KILLPROC.CMD', " * on your PATH. */"
  995.       call lineout 'KILLPROC.CMD', "'@echo off'"
  996.       call lineout 'KILLPROC.CMD', "n = setlocal()"
  997.       call lineout 'KILLPROC.CMD', "n = directory('"curdir"')"
  998.       call lineout 'KILLPROC.CMD', "'start killproc.exe'"
  999.       call lineout 'KILLPROC.CMD', "n = endlocal()"
  1000.       call stream 'KILLPROC.CMD','C','close'
  1001.     end
  1002.     else say "Couldn't create KILLPROC.CMD file."
  1003.     'del VIEWINFS.CMD 1>NUL 2>NUL'
  1004.     dummy = stream('VIEWINFS.CMD','C','open')
  1005.     if dummy = 'READY:' then
  1006.     do
  1007.       say 'Creating a VIEWINFS.CMD file.'
  1008.       call lineout 'VIEWINFS.CMD', "/* VIEWINFS (FM/2) command file.  Locate in a directory"
  1009.       call lineout 'VIEWINFS.CMD', " * on your PATH. */"
  1010.       call lineout 'VIEWINFS.CMD', "'@echo off'"
  1011.       call lineout 'VIEWINFS.CMD', "n = setlocal()"
  1012.       call lineout 'VIEWINFS.CMD', "n = directory('"curdir"')"
  1013.       call lineout 'VIEWINFS.CMD', "'start viewinfs.exe'"
  1014.       call lineout 'VIEWINFS.CMD', "n = endlocal()"
  1015.       call stream 'VIEWINFS.CMD','C','close'
  1016.     end
  1017.     else say "Couldn't create VIEWINFS.CMD file."
  1018.     'del VIEWHELP.CMD 1>NUL 2>NUL'
  1019.     dummy = stream('VIEWHELP.CMD','C','open')
  1020.     if dummy = 'READY:' then
  1021.     do
  1022.       say 'Creating a VIEWHELP.CMD file.'
  1023.       call lineout 'VIEWHELP.CMD', "/* VIEWHELP (FM/2) command file.  Locate in a directory"
  1024.       call lineout 'VIEWHELP.CMD', " * on your PATH. */"
  1025.       call lineout 'VIEWHELP.CMD', "'@echo off'"
  1026.       call lineout 'VIEWHELP.CMD', "n = setlocal()"
  1027.       call lineout 'VIEWHELP.CMD', "n = directory('"curdir"')"
  1028.       call lineout 'VIEWHELP.CMD', "'start viewinfs.exe DUMMY'"
  1029.       call lineout 'VIEWHELP.CMD', "n = endlocal()"
  1030.       call stream 'VIEWHELP.CMD','C','close'
  1031.     end
  1032.     else say "Couldn't create VIEWHELP.CMD file."
  1033.     'del GLOBAL.CMD 1>NUL 2>NUL'
  1034.     dummy = stream('GLOBAL.CMD','C','open')
  1035.     if dummy = 'READY:' then
  1036.     do
  1037.       say 'Creating a GLOBAL.CMD file.'
  1038.       call lineout 'GLOBAL.CMD', "/* GLOBAL (FM/2) command file.  Locate in a directory"
  1039.       call lineout 'GLOBAL.CMD', " * on your PATH. */"
  1040.       call lineout 'GLOBAL.CMD', "'@echo off'"
  1041.       call lineout 'GLOBAL.CMD', "arg arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  1042.       call lineout 'GLOBAL.CMD', "if arg1 \= '' then "
  1043.       call lineout 'GLOBAL.CMD', "do"
  1044.       call lineout 'GLOBAL.CMD', "  if left(arg1,1,1) \= '/' then"
  1045.       call lineout 'GLOBAL.CMD', "  do"
  1046.       call lineout 'GLOBAL.CMD', "    arg1 = stream(arg1,'c','query exists')"
  1047.       call lineout 'GLOBAL.CMD', "  end"
  1048.       call lineout 'GLOBAL.CMD', "end"
  1049.       call lineout 'GLOBAL.CMD', "else arg1 = directory()"
  1050.       call lineout 'GLOBAL.CMD', "if arg2 \= '' then "
  1051.       call lineout 'GLOBAL.CMD', "do"
  1052.       call lineout 'GLOBAL.CMD', "  if left(arg2,1,1) \= '/' then"
  1053.       call lineout 'GLOBAL.CMD', "  do"
  1054.       call lineout 'GLOBAL.CMD', "    arg2 = stream(arg2,'c','query exists')"
  1055.       call lineout 'GLOBAL.CMD', "  end"
  1056.       call lineout 'GLOBAL.CMD', "end"
  1057.       call lineout 'GLOBAL.CMD', "if arg3 \= '' then "
  1058.       call lineout 'GLOBAL.CMD', "do"
  1059.       call lineout 'GLOBAL.CMD', "  if left(arg3,1,1) \= '/' then"
  1060.       call lineout 'GLOBAL.CMD', "  do"
  1061.       call lineout 'GLOBAL.CMD', "    arg3 = stream(arg3,'c','query exists')"
  1062.       call lineout 'GLOBAL.CMD', "  end"
  1063.       call lineout 'GLOBAL.CMD', "end"
  1064.       call lineout 'GLOBAL.CMD', "if arg4 \= '' then "
  1065.       call lineout 'GLOBAL.CMD', "do"
  1066.       call lineout 'GLOBAL.CMD', "  if left(arg4,1,1) \= '/' then"
  1067.       call lineout 'GLOBAL.CMD', "  do"
  1068.       call lineout 'GLOBAL.CMD', "    arg4 = stream(arg4,'c','query exists')"
  1069.       call lineout 'GLOBAL.CMD', "  end"
  1070.       call lineout 'GLOBAL.CMD', "end"
  1071.       call lineout 'GLOBAL.CMD', "if arg5 \= '' then "
  1072.       call lineout 'GLOBAL.CMD', "do"
  1073.       call lineout 'GLOBAL.CMD', "  if left(arg5,1,1) \= '/' then"
  1074.       call lineout 'GLOBAL.CMD', "  do"
  1075.       call lineout 'GLOBAL.CMD', "    arg5 = stream(arg5,'c','query exists')"
  1076.       call lineout 'GLOBAL.CMD', "  end"
  1077.       call lineout 'GLOBAL.CMD', "end"
  1078.       call lineout 'GLOBAL.CMD', "if arg6 \= '' then "
  1079.       call lineout 'GLOBAL.CMD', "do"
  1080.       call lineout 'GLOBAL.CMD', "  if left(arg6,1,1) \= '/' then"
  1081.       call lineout 'GLOBAL.CMD', "  do"
  1082.       call lineout 'GLOBAL.CMD', "    arg6 = stream(arg6,'c','query exists')"
  1083.       call lineout 'GLOBAL.CMD', "  end"
  1084.       call lineout 'GLOBAL.CMD', "end"
  1085.       call lineout 'GLOBAL.CMD', "if arg7 \= '' then "
  1086.       call lineout 'GLOBAL.CMD', "do"
  1087.       call lineout 'GLOBAL.CMD', "  if left(arg7,1,1) \= '/' then"
  1088.       call lineout 'GLOBAL.CMD', "  do"
  1089.       call lineout 'GLOBAL.CMD', "    arg7 = stream(arg7,'c','query exists')"
  1090.       call lineout 'GLOBAL.CMD', "  end"
  1091.       call lineout 'GLOBAL.CMD', "end"
  1092.       call lineout 'GLOBAL.CMD', "if arg8 \= '' then "
  1093.       call lineout 'GLOBAL.CMD', "do"
  1094.       call lineout 'GLOBAL.CMD', "  if left(arg8,1,1) \= '/' then"
  1095.       call lineout 'GLOBAL.CMD', "  do"
  1096.       call lineout 'GLOBAL.CMD', "    arg8 = stream(arg8,'c','query exists')"
  1097.       call lineout 'GLOBAL.CMD', "  end"
  1098.       call lineout 'GLOBAL.CMD', "end"
  1099.       call lineout 'GLOBAL.CMD', "if arg9 \= '' then "
  1100.       call lineout 'GLOBAL.CMD', "do"
  1101.       call lineout 'GLOBAL.CMD', "  if left(arg9,1,1) \= '/' then"
  1102.       call lineout 'GLOBAL.CMD', "  do"
  1103.       call lineout 'GLOBAL.CMD', "    arg9 = stream(arg9,'c','query exists')"
  1104.       call lineout 'GLOBAL.CMD', "  end"
  1105.       call lineout 'GLOBAL.CMD', "end"
  1106.       call lineout 'GLOBAL.CMD', "n = setlocal()"
  1107.       call lineout 'GLOBAL.CMD', "n = directory('"curdir"')"
  1108.       call lineout 'GLOBAL.CMD', "'start global.exe' arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9"
  1109.       call lineout 'GLOBAL.CMD', "n = endlocal()"
  1110.       call stream 'GLOBAL.CMD','C','close'
  1111.     end
  1112.     else say "Couldn't create GLOBAL.CMD file."
  1113.     say ""
  1114.     parse upper var curdir curdir
  1115.     say "Please add the directory"
  1116.     say "  "curdir"\UTILS"
  1117.     say "to your PATH in CONFIG.SYS."
  1118.     say "┌──────────────────────────────────────────────────────────────────┐"
  1119.     say "│Remember, you'll need to reboot before such a change takes effect.│"
  1120.     say "│FM/2 will run fine from its WPS objects without this change; the  │"
  1121.     say "│proposed change allows it to be run from any command line, and for│"
  1122.     say "│other programs that might want to use FM/2 as its file manager to │"
  1123.     say "│find and run it easily.                                           │"
  1124.     say "└──────────────────────────────────────────────────────────────────┘"
  1125.     say "While you're in there, check your LIBPATH statement for a '.' entry..."
  1126.     if existed \= "TRUE" then
  1127.     do
  1128.       say ""
  1129.       /* remove next 6 lines for unattended use */
  1130.       call charout ,'  Press [Enter] for more...'
  1131.       dummy = ''
  1132.       do until dummy = '0d'x
  1133.         dummy = SysGetKey('NOECHO')
  1134.       end
  1135.       call charout ,'0d1b'x'[K'
  1136.       rc = stream('fatopt.exe','c','query exists')
  1137.       say   "┌────────────────────────────────────────────────────────────────┐"
  1138.       if rc = '' then
  1139.       do
  1140.         say "│I suggest that you place the utilities from the FM/2 Utilities  │"
  1141.         say "│archive in this directory, also, in which case you should       │"
  1142.         say "│_definitely_ make the change to PATH so that FM/2 can find them.│"
  1143.       end
  1144.       say   "│You may want to tweak the command lines in the .CMD files I just│"
  1145.       say   "│built and/or those in the WPS objects in the FM/2 folder for    │"
  1146.       say   "│desired specific behaviors.  The READ.ME file will tell you how.│"
  1147.       say   "└────────────────────────────────────────────────────────────────┘"
  1148.     end
  1149.     if existed = 'TRUE' then
  1150.     do
  1151.       say ''
  1152.       say "If you have previously altered your CONFIG.SYS's PATH statement"
  1153.       say 'as instructed above, please ignore this rambling.'
  1154.     end
  1155.     say ""
  1156.     /* remove next 6 lines for unattended use */
  1157.     call charout ,'  Press [Enter] to continue...'
  1158.     dummy = ''
  1159.     do until dummy = '0d'x
  1160.       dummy = SysGetKey('NOECHO')
  1161.     end
  1162.     call charout ,'0d1b'x'[K'
  1163.   end
  1164.   else say "Couldn't create FM2.CMD file.  Panic."
  1165.   dummy = directory(curdir)
  1166. end
  1167. else say "Couldn't switch to "curdir"\utils"
  1168.  
  1169. /* type the install.dat file to show any critical info/notices */
  1170.  
  1171. /* NOTE:  remove following 8 lines for unattended use... */
  1172. rc = stream('install.dat','c','query exists')
  1173. if rc \= '' then
  1174. do
  1175.   'type install.dat'
  1176.   'DEL INSTALL.DAT 1>NUL 2>NUL'
  1177.   /* remove next 6 lines for unattended use */
  1178.   call charout ,'  Press [Enter] to continue...'
  1179.   dummy = ''
  1180.   do until dummy = '0d'x
  1181.     dummy = SysGetKey('NOECHO')
  1182.   end
  1183.   call charout ,'0d1b'x'[K'
  1184. end
  1185.  
  1186. /* Final words */
  1187.  
  1188. say '┌──────────────────────────────────────────────────────────────────────────┐'
  1189. say '│To move FM/2 to another directory, move the files, delete the FM/2 folder,│'
  1190. say '│then rerun INSTALL.  There is no need to "uninstall" to move FM/2.        │'
  1191. say '│                                                                          │'
  1192. say '│To remove FM/2 completely, run UNINSTAL and follow its directions.        │'
  1193. say '└──────────────────────────────────────────────────────────────────────────┘'
  1194. say "I'm done now."
  1195. say ''
  1196.  
  1197.