home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / fm2_267.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1998-05-26  |  49KB  |  1,255 lines

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