home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: OtherApp / OtherApp.zip / ellie03.zip / Register.cmd < prev    next >
OS/2 REXX Batch file  |  1999-07-30  |  3KB  |  81 lines

  1. /* ╔═════════════════╤══════════════════════════════════════════════════════════╗
  2.    ║ File last saved │19 Jun 1999 at 08:34:17 []                                ║
  3.    ╟─────────────────┼──────────────────────────────────────────────────────────╢
  4.    ║        Filename │Register.cmd                                              ║
  5.    ║         Created │20 Aug 1998 at 17:14:57                                   ║
  6.    ║         Comment │Registers Ellie's directory in OS2.INI                    ║
  7.    ╚═════════════════╧══════════════════════════════════════════════════════════╝
  8. */
  9. SIGNAL ON syntax
  10. SIGNAL ON halt
  11.  
  12. if LoadRexxUtil() then EXIT 9
  13.  
  14. parse arg elliehome
  15.  
  16. if elliehome = '' then
  17.     elliehome = directory()
  18.  
  19. currver = SysIni(, 'AiG', 'Ellie_Ver')
  20. if currver = 'ERROR:' then currver = 'None'
  21. thisver = '0.3r2a'
  22.  
  23. say '   ─────────────────────────────────────────────────────────────────────'
  24. say '   ** Install Ellie' thisver '** (1)    Current version detected:' currver
  25. say '   This program registers Ellie with OS2.INI'
  26. say
  27. say '   You are to run this program from the Ellie "home" directory'
  28. say '   The data to be saved will be: ' elliehome
  29. say '   ─────────────────────────────────────────────────────────────────────'
  30. say '   Are you sure you want to continue..?' '07'x
  31. call charout, '   Type YES to continue >___' || copies('08'x,3)
  32.  
  33. ky = linein()
  34. select
  35.     when translate(ky) = 'YES' then
  36.         call Process
  37.     when translate(ky) = '' then do
  38.         say '  Shall I update the version number ?'
  39.         say '  Press N to cancel'
  40.         ky = linein()
  41.         if translate(ky) = 'N' then
  42.             EXIT 88
  43.         else
  44.             call SysIni , 'AiG', 'Ellie_Ver', thisver
  45.     end
  46.     otherwise
  47.         say '   Aborted!'
  48. end
  49. say '   Register program finished. (phase 1)'
  50. EXIT
  51. /* :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
  52. /* :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
  53. Process:
  54.     app  = 'AiG'
  55.     key1 = 'Ellie_Home'
  56.     key2 = 'Ellie_Ver'
  57.     call SysIni , app, key1, elliehome
  58.     call SysIni , app, key2, thisver
  59. return
  60. /* :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
  61. syntax:
  62.  say sourceline(sigl)
  63.  say "syntax error on line ["sigl"]"
  64.  say errortext(rc)
  65.  trace ?R; NOP; EXIT
  66.  return
  67. halt:
  68.  say "Ctrl-Break pressed.  Halting..."
  69.  EXIT
  70. /* :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
  71. LoadRexxUtil:
  72. if rxFuncQuery('SysLoadFuncs') then do
  73.     if rxFuncAdd('SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs') then do
  74.         say 'Installation Error! (Phase 2)   Unable to load RexxUtil library.' '07'x
  75.         say 'Please check that you have Rexx installed on your system.' '07'x
  76.         return 1; end
  77.     call SysLoadFuncs
  78. end
  79. return 0
  80. /* :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
  81.