home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Science / Science.zip / nvsn23.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1999-06-23  |  2KB  |  80 lines

  1. /* INSTALL.CMD **** Install program for Night Vision **************************/
  2.  
  3. call RxFuncAdd "SysLoadFuncs","RexxUtil","SysLoadFuncs"
  4. call SysLoadFuncs
  5.  
  6. PGMNAME = "Night Vision"
  7. EXEFILE = "NVSN.EXE"
  8. HLPFILE = "NVSN.HLP"
  9. DBFILE  = "NVSN.DB"
  10. CTYFILE = "NVSN.CTY"
  11. INIFILE = "NVSN.INI"
  12.  
  13. say "This install program creates a """ || PGMNAME || """ program object"
  14. say "(icon) on your desktop.  Do you wish to proceed?  (y/n)"
  15. pull answer .
  16. answer = substr(answer, 1,1)
  17. if answer <> 'Y' then exit 1
  18.  
  19. /* Get the current directory */
  20. curdir = directory()
  21.  
  22. /* Check for EXEFILE */
  23. Call SysFileTree curdir || '\' || EXEFILE, file, 'F'
  24. if file.0 = 0 then
  25. do
  26.   say "Can not locate" EXEFILE "(Program file)"
  27.   exit 1
  28. end
  29.  
  30. /* Check for HLPFILE */
  31. Call SysFileTree curdir || '\' || HLPFILE, file, 'F'
  32. if file.0 = 0 then
  33. do
  34.   say "Can not locate" HLPFILE "(Help file)"
  35.   exit 1
  36. end
  37.  
  38. /* Check for DBFILE */
  39. Call SysFileTree curdir || '\' || DBFILE, file, 'F'
  40. if file.0 = 0 then
  41. do
  42.   say "Can not locate" DBFILE "(Sky database)"
  43.   exit 1
  44. end
  45.  
  46. /* Check for CTYFILE */
  47. Call SysFileTree curdir || '\' || CTYFILE, file, 'F'
  48. if file.0 = 0 then
  49. do
  50.   say "Can not locate" CTYFILE "(City database file)"
  51.   say "Do you still wish to proceed?  (y/n)"
  52.   pull answer .
  53.   answer = substr(answer, 1,1)
  54.   if answer <> 'Y' then exit 1
  55. end
  56.  
  57. /* Check for INIFILE */
  58. Call SysFileTree curdir || '\' || INIFILE, file, 'F'
  59. if file.0 <> 0 then
  60. do
  61.   say "Reset" PGMNAME "to original defaults?  (y/n)"
  62.   pull answer .
  63.   answer = substr(answer, 1,1)
  64.   if answer = 'Y' then
  65.     "@ERASE" INIFILE
  66. end
  67.  
  68. /* Create object */
  69. if SysCreateObject("WPProgram", PGMNAME, "<WP_DESKTOP>",,
  70.                    "EXENAME="curdir||'\'||EXEFILE||";"||,
  71.                    "STARTUPDIR="curdir, "update") then
  72. do
  73.   say PGMNAME "has been added to your desktop."
  74.   say "Double click on this icon to start the program."
  75. end
  76. else
  77.   say "Can not add" PGMNAME "to your desktop."
  78.  
  79. exit 0
  80.