home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: InfoMgt / InfoMgt.zip / alrmclk2.zip / acinst.cmd next >
OS/2 REXX Batch file  |  1995-04-23  |  3KB  |  103 lines

  1. /* */
  2. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  3. call SysLoadFuncs
  4. call SysCls
  5. pos = SysCurPos(5,0)
  6. say '┌───────────────────────────────────────────┐'
  7. say '│                                           │'
  8. say '│     Thank you for trying Alarm Clock      │'
  9. say '│                                           │'
  10. say '│ If you are upgrading from version 2.9 be  │'
  11. say '│ sure and run the conversion utility       │'
  12. say '│ ACUPGRAD.EXE before running Alarm Clock.  │'
  13. say '│                                           │'
  14. say '│ Your current event files will be changed  │'
  15. say '│ to the new format.  You should still      │'
  16. say '│ review and edit the entries to take       │'
  17. say '│ advantage of the new features in version  │'
  18. say '│ 3.0.                                      │'
  19. say '│                                           │'
  20. say '│ Press any key to continue...              │'
  21. say '│                                           │'
  22. say '└───────────────────────────────────────────┘'
  23. call SysGetKey 'NOECHO'
  24. call SysCls
  25. pos = SysCurPos(5,0)
  26. say 'Enter the target drive and directory then press <ENTER>'
  27. PULL targdrv
  28. say ' '
  29. say 'Enter the source drive and directory then press <ENTER>'
  30. PULL srcepath
  31. say ' '
  32. say 'Installing Alarm Clock in 'targdrv
  33. call STARTINSTALL
  34. call INSTALRMCLK
  35. say ' '
  36. say '┌───────────────────────────────────────────┐'
  37. say '│                                           │'
  38. say '│       Alarm Clock INSTALLED               │'
  39. say '│                                           │'
  40. say '│ Be sure that the selected directory is in │'
  41. say '│ your LIBPATH= statement or .\ is in the   │'
  42. say '│ LIBPATH.  See your CONFIG.SYS file.       │'
  43. say '│                                           │'
  44. say '└───────────────────────────────────────────┘'
  45. exit
  46.  
  47.  
  48.  
  49.  
  50.  
  51. STARTINSTALL:
  52.    call SysFileTree srcepath, 'file', 'D'
  53.    if file.0 = 0 then do
  54.        say 'No files found in 'srcepath
  55.        exit
  56.        end
  57.  
  58.    call SysFileTree targdrv, 'file', 'D'
  59.    if file.0 = 0 then do
  60.       call CREATEPATH
  61.       end  /* Do */
  62. return /* STARTINSTALL */
  63.  
  64.  
  65. INSTALRMCLK:
  66.    "@echo off"
  67.    copy srcepath'\*.* 'targdrv
  68.    settings='OBJECTID=<ALARMCLK_FOLDER>;ICONFILE='srcepath'\folder.ico'
  69.    call SysCreateObject 'WPFolder', 'Alarm Clock', '<WP_DESKTOP>', settings, 'REPLACE'
  70.    settings='PROGTYPE=PM;EXENAME='targdrv'\ALRMCLK2.EXE;OBJECTID=<ALRMCLK2>;STARTUPDIR='targdrv
  71.    call SysCreateObject 'WPProgram', 'Alarm Clock', '<ALARMCLK_FOLDER>', settings, 'REPLACE'
  72.    settings='PROGTYPE=PM;EXENAME=VIEW.EXE;OBJECTID=<ACHELP>;STARTUPDIR='targdrv';PARAMETERS=ALRMCLK2.INF'
  73.    call SysCreateObject 'WPProgram', 'Alarm Clock Help', '<ALARMCLK_FOLDER>', settings, 'REPLACE'
  74.    echo on
  75. return
  76.  
  77. CREATEPATH:
  78.  
  79.    do I = 1 to 5 by 1
  80.       say ' '
  81.       say 'Press Y to create the directory 'targdrv
  82.       say 'Press N to end the install'
  83.       rc = SysGetKey()
  84.       say ' '
  85.       say ' '
  86.       select
  87.           when TRANSLATE(rc) = 'Y' then do
  88.               rc = SysMkDir(targdrv)
  89.               if rc \= 0 then do
  90.                   say 'Error Creating 'targdrv
  91.                   say 'Install Ended unsuccessfully'
  92.                   beep(454, 100)
  93.                   exit
  94.                   end
  95.               leave
  96.           end  /* Do */
  97.           when TRANSLATE(rc) = 'N' then leave
  98.           otherwise beep(454, 100)
  99.       end  /* select */
  100.    end /* do */
  101.  
  102. return /* CREATEPATH */
  103.