home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pfowl108.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1996-06-10  |  3KB  |  113 lines

  1. /*  Install Professor Owl
  2.     ----------------------------------------------------
  3.     INSTALL PROFESSOR OWL FROM THE CURRENT PATH TO A
  4.     USER SPECIFED DIRECTORY. CREATE THE DIRECTORY
  5.     AND A SHADOW OF THE DIRECTORY ON THE DESK TOP.
  6.     COPY ALL FILE FROM SOURCE PATH TO DESTINATION GIVEN.
  7.     ----------------------------------------------------
  8.     Copyright (c) 1995
  9.     Edward J. March Jr.
  10.     1206 South Birch Drive
  11.     Mt. Prospect, IL 60056
  12. */
  13.  
  14. echo off
  15. Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  16. Call SysLoadFuncs
  17. Call SysCls
  18.  
  19. /*
  20. //  Determine the Current path (from where install.cmd is running from)
  21. //  Most likely From Floppy A:\
  22. */
  23. parse source . . argv0 .
  24. temp = reverse(argv0)
  25. temp = substr(temp, pos('\', temp))
  26. Len = length(temp)
  27. If Len > 3 then Do
  28.     temp = substr(temp, 2)
  29. End
  30.  
  31. CurrentPath = reverse(temp)
  32. LastChar = Right(CurrentPath,1)
  33. If  LastChar <> '\' then Do
  34.     CurrentPath = CurrentPath'\'
  35. End
  36.  
  37. Say '       Professor Owl Instalation'
  38. Say '       ========================='
  39. Say ' '
  40. Say ' Installing From ' CurrentPath
  41. Say ' '
  42. Say 'Enter Full Path Of The Destination Directory '
  43. Say 'To Create and install to (i.e  C:\Profowl)  ?'
  44. Pull Destination
  45.  
  46. temp = SubStr(Destination,2,2)
  47. if temp <> ":\" Then Do
  48.     Say '********** ERROR **********'
  49.     Say 'Invalid Destination Directoy'
  50.     Say 'You Must Include The Drive Letter And Full Path'
  51.     Say 'Press Any Key To Exit...'
  52.     SysGetKey()
  53.     Exit
  54. End
  55.  
  56. title = Right(Destination,Length(Destination)-3);
  57. FolderId = '<ID_'Destination'>'
  58. Rc = SysCreateObject("WPFolder", title, Left(Destination,3), 'OBJECTID='FolderId, 'U')
  59.  
  60. If Rc <> 1 then Do
  61.     Say '********** ERROR **********'
  62.     Say 'Could Not Create Folder Directory ' Destination
  63.     Say 'Error Code ' Rc
  64.     Say 'Try another Directory Name'
  65.     Say 'Press Any Key To Exit...'
  66.     SysGetKey()
  67.     Exit
  68. End
  69.  
  70. Say 'Directory Created: ' Destination
  71. Say '--------------------------------------------------------'
  72. Say 'A Desktop Folder Icon Is Being Created For Professor Owl'
  73. Say '   This Folder Will Contain The Related Files '
  74. Say '--------------------------------------------------------'
  75.  
  76. /*
  77. // SHADOW THE NEWLY CREATED FOLDER ON THE DESKTOP
  78. */
  79. Rc = SysCreateShadow( FolderId,  '<WP_DESKTOP>' )
  80. Rc = SysOpenObject(FolderId, 'ICON', 1);
  81. Say 'Copying Files From ' CurrentPath ' to ' Destination 
  82.  
  83. /*
  84. // LIST OF FILES TO INSTALL
  85. */
  86. Call CopyTheFile 'ReadMe.cmd'
  87. Call CopyTheFile 'ReadMe.txt'
  88. Call CopyTheFile 'Eval.txt'
  89. Call CopyTheFile 'ProfOwl.inf'
  90. Call CopyTheFile 'ProfOwl.ptr'
  91. Call CopyTheFile 'ProfOwl.exe'
  92.  
  93.  
  94. Say '************************'
  95. Say 'Instalation Complete... '
  96. Say 'Press Any Key To Exit...'
  97. SysGetKey()
  98. Exit
  99.  
  100. /* --------------- COPY THE FILE FROM CurrentPath to Destination --------*/
  101. CopyTheFile:
  102.     Arg Name
  103.     File = CurrentPath''Name
  104.     rc1 = SysCopyObject(File, FolderId)
  105.     if rc1 = 1 Then Do
  106.     Say 'Copied file 'File    
  107.     End
  108.     if rc1 <> 1 Then Do
  109.     Say '**** Error ' rc1 ' Coping file 'File
  110.     End
  111. Return 0
  112.  
  113.