home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 September / PCO_0998.ISO / filesbbs / os2 / fm2_300.arj / FM2_300.ZIP / install.cmd < prev    next >
Encoding:
Text File  |  1998-07-17  |  48.0 KB  |  1,252 lines

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