home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / goswish5.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1999-06-07  |  19KB  |  657 lines

  1. /* this is the installation program for goswish */
  2.  
  3. parse arg defdir     /* install here as default, otherwise default is current*/
  4. dd0=defdir
  5.  
  6. /* Load up advanced REXX functions */
  7. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  8. call SysLoadFuncs
  9.  
  10. /*  call check_emx - no longer required */
  11.  
  12.  
  13. crlf='0d0a'x
  14. copyall=0
  15.  
  16. ansion=checkansi()
  17. if ansion=1 then do
  18.   aesc='1B'x
  19.   cy_ye=aesc||'[37;46;m'
  20.   normal=aesc||'[0;m'
  21.   bold=aesc||'[1;m'
  22.   re_wh=aesc||'[31;47;m'
  23.   reverse=aesc||'[7;m'
  24. end
  25. else do
  26.   say " >>  Warning: Could not detect ANSI....  Install will look ugly ! "
  27.   parse pull .
  28.   cy_ye="" ; normal="" ; bold="" ;re_wh="" ;
  29.   reverse=""
  30. end  /* Do */
  31.  
  32. cls
  33. say  " " ; say
  34.  
  35. call lineout, bold cy_ye
  36. call lineout, "This is the GoSwish 1.4 installation program (June 1999).     "
  37. call lineout, "      (for use as a SRE-http addon, or as a CGI-BIN script)  "
  38. call lineout, normal
  39. call lineout,"      For those who like to do it themselve, please see "
  40. call lineout,'      the installation instructions in GoSwish.DOC.     '
  41. say "" 
  42. say " This program will ask for the names of a few directories,"
  43. say " and will copy a number of files to these directories.    "
  44. say "  "
  45.  
  46. if yesno(" Are you ready to continue ")=1 then
  47.  nop
  48. else do
  49.  say " See you later?.. "
  50.  exit
  51. end
  52.  
  53.  
  54. ascgi=yesno(" Install as:  C= CGI-BIN script, or S=SRE-http addon ",,'CGI-BIN SRE')
  55. nowdir=defdir
  56. if defdir='' then
  57.   nowdir=directory()
  58.  
  59. if ascgi=0 then do
  60.    if defdir='' then do
  61.      godir=filespec('d',nowdir)||'\GOSERVE'
  62.      webdir=filespec('d',godir)||'\WWW'
  63.    end
  64.    else do
  65.      godir=defdir'\goserve'
  66.      webdir=defdir'\www'
  67.    end
  68. end
  69. else do
  70.   if defdir='' then do
  71.      godir=filespec('d',nowdir)||'\SERVER'
  72.      if dd0<>'' then godir=filespec('d',nowdir)||'\goserve'
  73.      webdir=filespec('d',godir)||'\WWW'
  74.   end
  75.   else do
  76.      godir=defdir||'\GOSERVE'
  77.      webdir=defdir||'\WWW'
  78.   end /* do */
  79. end /* do */
  80.  
  81. gunky2:
  82. say " "
  83. if ascgi=0 then do
  84.    call charout,  bold " Enter the GoServe working directory (that contains SREFILTR.80)" normal crlf
  85.    call charout,"  ENTER= " godir  " ? "
  86.   parse pull work_dir
  87.   if work_dir="" then work_Dir=godir
  88.   work_dir=strip(work_dir,'t','\')
  89.   foo=aisdir(work_dir)
  90.   if foo=0 then do
  91.     say " >> Could not find directory: " work_dir
  92.     signal gunky2
  93.   end
  94.   foo=work_dir||'\SREFILTR.80'
  95.   if stream(foo,'c','query exists')=' ' then do
  96.      say " >> Could not find SREFILTR.80.  Please reenter "
  97.      signal gunky2
  98.   end  /* Do */
  99. end
  100. else do
  101.  
  102.    call charout,  bold " Enter your server's root directory " normal crlf
  103.    call charout,"  ENTER= " godir  " ? "
  104.    parse pull work_dir
  105.    if work_dir="" then work_Dir=godir
  106.    work_dir=strip(work_dir,'t','\')
  107.    foo=aisdir(work_dir)
  108.    if foo=0 then do
  109.       say " >> Could not find directory: " work_dir
  110.       signal gunky2
  111.    end
  112.    godir=work_dir
  113.   call charout,  bold " Enter your cgi-bin directory  " normal crlf
  114.   say       '   (GOSWISH.CMD will be copied to it) '
  115.    call charout,"  ENTER= " godir'\CGI-BIN  ? '
  116.   parse pull work_dir
  117.   if work_dir="" then work_Dir=godir'\CGI-BIN'
  118.   work_dir=strip(work_dir,'t','\')
  119.   foo=aisdir(work_dir)
  120.   if foo=0 then do
  121.     say " >> Could not find directory: " work_dir
  122.     signal gunky2
  123.   end
  124.   addon_dir=work_dir
  125.   call charout, bold" What is your server's CGI prefix " normal '(for some servers, this is case sensitive)' crlf
  126.   call charout,"  ENTER= cgi-bin  ? "
  127.   parse pull cgiprefix
  128.   if  cgiprefix='' then cgiprefix='cgi-bin'
  129. end /* do */
  130.  
  131. gunky2a:
  132. if ascgi=0 then do
  133.    addondir=work_dir||'\ADDON'
  134.    say " "
  135.    say  bold " Enter the SRE-http " normal reverse " addon " normal bold " directory " normal 
  136.    call charout,"  ENTER= " addondir  " ? "
  137.    parse pull addon_dir
  138.    if addon_dir="" then addon_Dir=addondir
  139.    addon_dir=strip(addon_dir,'t','\')
  140.    foo=aisdir(addon_dir)
  141.    if foo=0 then do
  142.       say " >> Could not find directory: " addon_dir
  143.       signal gunky2a
  144.    end
  145. end
  146.  
  147. gunky3a:
  148. say " "
  149. if ascgi=0 then
  150.   say  bold " Enter the GoServe data directory (the root of your web tree)" normal
  151. else
  152.   say  bold " Enter your home-page's directory (the root of your web tree)" normal
  153.   say  "     This is the directory that requests of the form "
  154.   say  "     "bold"http://www.myserver.com/filename.ext"normal" point to"
  155. call charout,"  ENTER= " webdir  " ? "
  156. parse pull web_dir ; web_dir=strip(web_dir)
  157. if web_dir="" then web_Dir=webdir
  158. web_dir=strip(web_dir,'t','\')
  159. foo=aisdir(web_dir)
  160. if foo=0 then do
  161.     say " >> Could not find directory: " web_dir
  162.     signal gunky3a
  163. end
  164.  
  165.  
  166. shtmdir=web_dir||'\SWISH'
  167. gunky4a:
  168. say " "
  169. call charout,  bold " Enter the SWISH documents directory" normal crlf
  170. say '   ' reverse'*'normal' The GOSWISH "HTML front-end", and GOSWISH documentation, '
  171. say '        will be copied to it'
  172. say '   ' reverse'*'normal' It should be in a directory that is WWW-accessible by site adminstrators'
  173. call charout,"  ENTER= " shtmdir  " ? "
  174. parse pull shtm_dir ; shtm_dir=strip(shtm_dir)
  175. if shtm_dir="" then shtm_dir=shtmdir
  176. shtm_dir=strip(shtm_dir,'t','\')
  177. foo=aisdir(shtm_dir)
  178. if foo=0 then do
  179.     say " Creating " shtm_dir
  180.     wow=sysmkdir(shtm_dir)
  181.     if wow<>0 then do
  182.       say " >> Could not create " shtm_dir ' ('wow
  183.        signal gunky4a
  184.     end
  185. end
  186.  
  187. gunky4b:
  188. say " "
  189. say bold ' What name should be used for the GoSWISH  "HTML front-end" document ' normal
  190. call charout,"  ENTER= GOSWISH.HTM ? "
  191. parse pull htmname ; 
  192. if htmname="" then htmname="GOSWISH.HTM"
  193. if verify(htname,':\/','M')>0 then do
  194.    say "Please do not include path information (just enter a file name) "
  195.    signal gunky4b
  196. end /* do */
  197. if pos('.',htmname)=0 then do
  198.    say "Please enter an extension (or end the name with a period"
  199.    signal gunky4b
  200. end /* do */
  201.  
  202.  
  203.  
  204. a1=translate(web_dir)
  205. a2=translate(shtm_dir)
  206.  
  207. shtm2=''
  208. if abbrev(a2,a1)=1 then do
  209.     shtm2=substr(shtm_dir,length(web_dir)+2)
  210. end /* do */
  211.  
  212. gg=lastpos('\',addon_dir)
  213. if gg=0 | gg<4 then do
  214.    custdir=work_dir||'\SWISH'
  215. end /* do */
  216. else do
  217.   custdir=left(addon_dir,gg)||'SWISH'
  218. end
  219.  
  220. gunky4:
  221. say " "
  222. call charout,  bold " Enter the SWISH working directory" normal crlf
  223. say '   ' reverse'*'normal'  SWISH-EXE, and a few other files, will be copied to it'
  224. say '   ' reverse'*'normal"  It's GODATA/ subdirectory will also be used to store SWISH indices"
  225. call charout,"  ENTER= " custdir  " ? "
  226. parse pull custom_dir
  227. if custom_dir="" then custom_Dir=custdir
  228. custom_dir=strip(custom_dir,'t','\')
  229. foo=aisdir(custom_dir)
  230. if foo=0 then do
  231.     say " Creating " custom_dir
  232.     wow=sysmkdir(custom_dir)
  233.     if wow<>0 then do
  234.        say " >> Could not create " custom_dir '(' wow
  235.        signal gunky4
  236.     end
  237. end
  238. custom2=custom_dir'\GODATA'
  239. foo=aisdir(custom2)
  240. if foo=0 then do
  241.     say " Creating " custom2
  242.     wow=sysmkdir(custom2)
  243.     if wow<>0 then do
  244.        say " >> Could not create " custom2 '(' wow
  245.        signal gunky4
  246.     end
  247. end
  248.  
  249. say " "
  250. if yesno(" Are you ready to copy the files ")=0 then do
  251.    say " Okay, you can try again later "
  252.    exit
  253. end  
  254.     
  255. say " "
  256.  
  257.  
  258. /* 1) modify GOSWISH.CMD */
  259. ain=charin('GOSWISH.CMD',1,chars('GOSWISH.CMD'))
  260. foo=stream('GOSWISH.CMD','c','close')
  261.  
  262. aa="swish_directory"
  263. ain=replacestrg(ain,aa,custom_dir,'ALL')
  264.  
  265. aa="web_root_directory"
  266. ain=replacestrg(ain,aa,web_dir,'ALL')
  267.  
  268.  
  269. domore=yesno("Would you like to set a few of the parameters in GOSWISH.CMD")
  270. if domore=1 then do
  271.   doover=yesno("Overwrite files (by default) when creating new indices?")
  272.   if doover=1 then do
  273.        ain=replacestrg(ain,'overwrite=0','overwrite=1')
  274.   end /* do */
  275.   dolnums=yesno("Display the match number (1,2...,#matches)")
  276.   if dolnums=0 then do
  277.       ain=replacestrg(ain,'Add_Hit_Num=1','Add_Hit_Num=0')
  278.   end
  279.   say bold"Enter list of HTML extensions"normal" (ENTER=use default list)"
  280.   call charout,"  "reverse"?"normal' '
  281.   pull htmexts
  282.   if htmexts<>'' then do
  283.      ain=replacestrg(ain,'def_Htmls="SHT SHTML HTM HTML HTM-SSI HTML-SSI"', ,
  284.                      'def_Htmls="'htmexts'"')
  285.   end
  286.  say 
  287. end /* setting goswish.cmd parameters */
  288.  
  289.  
  290.  
  291. foo=sysfiledelete('GOSWISH.$$$')
  292. foo=charout('GOSWISH.$$$',ain,1)
  293. if foo>0 then do
  294.     say " >> ERROR: could not write temporary file (GOSWISH.$$$)"
  295.     exit
  296. end
  297. foo=stream('GOSWISH.$$$','c','close')
  298.  
  299. say ' Modifying the GoSWISH "HTML front-end" file'
  300.  
  301. ain=charin('GOSWISH.HTM',1,chars('GOSWISH.HTM'))
  302. foo=stream('GOSWISH.HTM','c','close')
  303. aa="/goswish.cmd" 
  304. if ascgi=0 then
  305.   aanew='/GOSWISH'
  306. else
  307.   aanew='/'cgiprefix'/GOSWISH.CMD'
  308.  
  309. ain=replacestrg(ain,aa,aanew,'ALL')
  310.  
  311. shtm2=translate(shtm2,'/','\')
  312. shtm20=shtm2
  313. if shtm2<>'' then shtm2=shtm2'/'
  314.  
  315. boo=replacestrg(ain,'search_document_directory',shtm20,'ALL',1)
  316. foo=sysfiledelete('GOHTM.$$$')
  317. foo=charout('GOHTM.$$$',boo,1)
  318. if foo>0 then do
  319.     say " >> ERROR: could not write temporary file (GOHTM.$$$)"
  320.     exit
  321. end
  322. foo=stream('GOHTM.$$$','c','close')
  323.  
  324. say ' Copying  GOSWISH.CMD and other stuff to ' addon_dir
  325. foo=check_copy('GOSWISH.$$$',addon_dir'\GOSWISH.CMD',1)
  326. if ascgi=1 then
  327.    foo=check_copy('GOSWISH.$$$',custom_dir'\GOSWISH.CMD',1)
  328.  
  329. aa=sysfiledelete('GOSWISH.$$$')
  330.  
  331. say "Copying rxSWISH.DLL to " godir'\rxswish.dll'
  332. foo=check_copy('rxSWISH.dll',godir'\rxswish.dll')
  333.  
  334. say " Copying SWISH-E.EXE and samples to " custom_dir
  335. foo=check_copy('SWISH-E.EXE',custom_dir)
  336.  
  337. say "Copying samples to " custom_dir
  338. foo=check_copy('SAMPLE.DCT',custom_dir)
  339. foo=check_copy('SAMPLE.SWI',custom_dir)
  340. foo=check_copy('SAMPLE.CON',custom_dir)
  341.  
  342. foo=check_copy('DESCRIBE.TXT',custom_dir)
  343. foo=check_copy('MKDCT.CMD',custom_dir)
  344. foo=check_copy('MKDCT.IN',custom_dir)
  345.  
  346. Say " Copying documents to " shtm_dir
  347. foo=check_copy('GOHTM.$$$',shtm_dir'\'htmname,1)
  348. aa=sysfiledelete('GOHTM.$$$')
  349. foo=check_copy('GOSWISH.DOC',shtm_dir)
  350. foo=check_copy('SRCHSAMP.HTM',shtm_dir)
  351.  
  352. foo=check_copy('SWISH-E.GIF',shtm_dir)
  353.  
  354.  
  355. say " "
  356. say cy_ye " ------------------------------------------------- "normal
  357. say bold " The GoSwish files and directories have been created. " normal
  358. say " "
  359. say cy_ye"Notes:"normal
  360. say reverse"*"normal" The GoSWISH manual is : "bold"GOSWISH.DOC"normal
  361. say reverse"*"normal' The "HTML front-end" to GoSWISH is: ' bold htmname normal
  362. say "    You can use "htmname" to create, and then to search, SWISH indices."
  363. say "     (by default, it's relative URL is: /swish/goswish.htm )"
  364. say reverse"*"normal" If you want, you can rename "HTMNAME", or move it to a different directory"
  365. say reverse"*"normal" These two files are in:" bold shtm_dir normal
  366. say
  367. say reverse"*"normal" Advanced users note: GOSWISH.CMD (in "addon_dir") contains "
  368. say                 "                       several user-configurable parameters"
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377. exit
  378.  
  379. /* ------------------------------------------------------------------ */
  380.  /* function: Check if ANSI is activated                               */
  381.  /*                                                                    */
  382.  /* call:     CheckAnsi                                                */
  383.  /*                                                                    */
  384.  /* where:    -                                                        */
  385.  /*                                                                    */
  386.  /* returns:  1 - ANSI support detected                                */
  387.  /*           0 - no ANSI support available                            */
  388.  /*          -1 - error detecting ansi                                 */
  389.  /*                                                                    */
  390.  /* note:     Tested with the German and the US version of OS/2 3.0    */
  391.  /*                                                                    */
  392.  /*                                                                    */
  393.  CheckAnsi: PROCEDURE
  394.    thisRC = -1
  395.  
  396.    trace off
  397.                          /* install a local error handler              */
  398.    SIGNAL ON ERROR Name InitAnsiEnd
  399.  
  400.    "@ANSI 2>NUL | rxqueue 2>NUL"
  401.  
  402.    thisRC = 0
  403.  
  404.    do while queued() <> 0
  405.      queueLine = lineIN( "QUEUE:" )
  406.      if pos( " on.", queueLine ) <> 0 | ,                       /* USA */
  407.         pos( " (ON).", queueLine ) <> 0 then                    /* GER */
  408.        thisRC = 1
  409.    end /* do while queued() <> 0 */
  410.  
  411.  InitAnsiEnd:
  412.  signal off error
  413.  RETURN thisRC
  414.  
  415.  
  416. /* -------------------- */
  417. /* get a yes or no , return 1 if yes */
  418. yesno:procedure expose normal reverse bold
  419. parse arg fooa , allopt,altans
  420. if altans<>" " & words(altans)>1 then do
  421.    w1=strip(word(altans,1))
  422.    w2=strip(word(altans,2))
  423.    a1=left(w1,1) ; a2=left(w2,1)
  424.    a1a=substr(w1,2) ; a2a=substr(w2,2)
  425. end
  426. else do
  427.     a1='Y' ; a1a='es'
  428.     a2='N' ; a2a='o'
  429. end  /* Do */
  430. ayn='  '||bold||a1||normal||a1a||'\'||bold||a2||normal||a2a
  431. if allopt=1 then  ayn=ayn||'\'||bold||'A'||normal||'ll'
  432.  
  433. do forever
  434.  foo1=normal||reverse||fooa||normal||ayn
  435.  call charout,  foo1 normal ':'
  436.  pull anans
  437.  if abbrev(anans,a1)=1 then return 1
  438.  if abbrev(anans,a2)=1 then return 0
  439.  if allopt=1 & abbrev(anans,'A')=1 then return 2
  440. end
  441.  
  442.  
  443. /* ------------- */
  444. /* ----------------------------------------------------------------------- */
  445. /* REPLACESTRG: In string astring, find first occurence substring target and
  446. .   replace it with substring putme
  447. .      if no target, return unchanged astring
  448. .      if no putme, then remove target
  449. .      if type=backward, then find/change LAST occurence
  450. .      if type=all, find/change all occurences
  451. .      if exactmatch=yes, then do not capitalize during search (exact match only */
  452. /* ----------------------------------------------------------------------- */
  453.  
  454. replacestrg: procedure
  455.  
  456. exactmatch=0
  457. backward=0 ; doall=0
  458.  
  459. parse arg astring ,  target   , putme , type , exactmatch
  460.  
  461. type = translate(type)
  462. if type="BACKWARD" then backward="YES"
  463. if type="ALL" then doall="YES"
  464.  
  465. iat=1
  466. joelen=length(target)
  467. joelen2=length(putme)
  468.  
  469. doagain:                /* here if doall=yes */
  470.  if exactmatch="YES" | exactmatch=1 then do
  471.     if   backward="YES" then
  472.         joe= lastpos(target,astring)
  473.     else
  474.         joe= pos(target,astring,iat)
  475.  end
  476.  else do
  477.    if   backward="YES" then
  478.         joe= lastpos(translate(target),translate(astring))
  479.     else
  480.         joe= pos(translate(target),translate(astring),iat)
  481.  end
  482.  
  483.  
  484.  if joe=0 then
  485.          return astring
  486.  
  487.  astring=delstr(astring,joe,joelen)
  488.  if putme<>' ' then
  489.     astring=insert(putme,astring,joe-1)
  490.  
  491.  if doall="YES" then do
  492.      iat=joe+joelen2
  493.      signal doagain
  494.  end
  495. /* else, all done */
  496.  return astring
  497.  
  498. /*******************************************/
  499. /* check for existence of file, then ask user to copy or not */
  500. /* note that for X.* type copies, it only checks once
  501.    (not for each file, but just for any one of them */
  502. /********************************************/
  503. check_copy: procedure expose copyall reverse bold normal
  504. parse arg file1, dest1 , asis
  505. amess=''
  506.  
  507. if asis="" then do
  508.   dest2=strip(dest1,'t','\')||'\'
  509.   filename=dest2||file1
  510. end
  511. else do
  512.   filename=dest1
  513. end /* do */
  514.  
  515. if copyall=1 then signal doit3
  516.  
  517. aa=sysfiletree(filename,isit,'F')
  518.  
  519. ok=1
  520. if aa<>0 then do
  521.    say " >> Warning: error when looking for pre-existing copy of: " filename
  522.    ok=yesno(" Do you want to copy this file (or files) anyways? ")
  523.    if ok=1 & amess<>""  then
  524.       ok=yesno(amess)
  525. end
  526.  
  527. if isit.0>0 then do
  528.   if pos('*',file1)=0 then do
  529.       say " "
  530.       say " A file exists with the name: " filename
  531.       ok=yesno(" Do you want to overwrite this file? ",1)
  532.       if ok=1 & amess<>""  then
  533.            ok=yesno(amess)
  534.   end
  535.   else do
  536.     say " "
  537.       say " There is at least one file that matches: " filename
  538.       say "  (this match may " bold " not " normal " be one of the files that will be copied!) "
  539.       ok=yesno(" Do you want to copy these files? ",1)
  540.       if ok=1 & amess<>""  then
  541.            ok=yesno(amess)
  542.   end  /* Do */
  543.  
  544. end
  545.  
  546. if ok=2 then do
  547.   say " "
  548.   copyall=yesno(" Are you sure you want overwrite all files?")
  549.   if copyall=0 then
  550.       ok=yesno(" Do you want to overwrite the current file? ")
  551. end
  552.  
  553. if ok=0  then return 0
  554.  
  555. doit3:          /* jump here if copyall is on, or noask=1 */
  556. '@COPY ' file1 dest1 ' > NUL '
  557. return 1
  558.  
  559.  
  560. /* return 1 if adir is an existing (possibly empty) directory , 0 if not */
  561. is_dir:procedure 
  562. parse arg adir
  563.  
  564. adir=strip(adir)
  565. adir=strip(adir,'t','\')
  566. nowdir=directory()
  567. nowdrive=filespec('d',nowdir'\')
  568. nowpath=filespec('p',nowdir'\')
  569. adr=filespec('d',adir)
  570. if adr='' then do
  571.    if abbrev(adir,'\')=0 then 
  572.        adir=nowdrive||nowpath||adir
  573.    else
  574.        adir=nowdrive||adir
  575. end /* do */
  576.  
  577. foo=sysfiletree(adir,goo,'D')
  578. if  goo.0>0  then return 1
  579. return 0
  580.  
  581.  
  582. /* return 1 if adir is an existing (possibly empty) directory , 0 if not */
  583. aisdir:procedure 
  584. parse arg adir
  585.  
  586. adir=strip(adir)
  587. adir=strip(adir,'t','\')
  588. nowdir=directory()
  589. nowdrive=filespec('d',nowdir'\')
  590. nowpath=filespec('p',nowdir'\')
  591. adr=filespec('d',adir)
  592. if adr='' then do
  593.    if abbrev(adir,'\')=0 then 
  594.        adir=nowdrive||nowpath||adir
  595.    else
  596.        adir=nowdrive||adir
  597. end /* do */
  598.  
  599. foo=sysfiletree(adir,goo,'D')
  600. if  goo.0>0  then return 1
  601. return 0
  602.  
  603.  
  604. /**************************/
  605. /* no longer required */
  606. check_emx:
  607.  
  608.   call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  609.   call SysLoadFuncs
  610.  
  611.   parse arg arg1 rest
  612.   arg1 = strip( arg1, 'T')
  613.   rest = strip( rest, 'T')
  614.     i.1= emxrevision( 'emx')
  615.     if i.1=0 then say ' Warning: could not find emx.dll'
  616.  
  617.     i.2= emxrevision( 'emxio')
  618.     if i.2=0 then say " Warning: could not find emxio.dll"
  619.  
  620.     i.3=emxrevision( 'emxlibc')
  621.     if i.3=0 then say " Warning: could not find emxlibc.dll"
  622.  
  623.     i.4= emxrevision( 'emxlibcm')
  624.     if i.4=0 then say " Warning: could not find emxlibcm.dll"
  625.  
  626.     i.5= emxrevision( 'emxlibcs')
  627.     if i.5=0 then say " Warning: could not find emxlibcs.dll"
  628.  
  629.     i.6= emxrevision( 'emxwrap')
  630.     if i.6=0 then say " Warning: could not find emxwrap.dll"
  631.  
  632. if min(i.1,i.2,i.3,i.4,i.5,i.6)=0 then do
  633.    say
  634.    say "Warning: one or more of the EMX dynamic link libraries could not be found"
  635.    say "SWISH 1.1 does NOT require EMX, but SWISH 1.3 does."  
  636.    say "If you intend to use the (recommended) SWISH 1.3, you should"
  637.    say "obtain, and install, the EMX  run time package (EMXRT.ZIP):"
  638.    say "you can find it at http://hobbes.nmsu.edu, search for EMXRT.ZIP "
  639.    say  " "
  640.    say " ... hit ENTER to continue... "
  641.     pull foo
  642.    say
  643. end /* do */
  644. return 1
  645.  
  646. emxrevision: procedure
  647.   arg pathname
  648.   call RxFuncAdd emx_revision, pathname, emx_revision
  649.   signal on syntax name emxerror
  650.   tmp = emx_revision()
  651.   signal off syntax
  652.   call RxFuncDrop emx_revision
  653.   return  tmp
  654.  
  655. emxerror:
  656.   return 0
  657.