home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / stampm.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1994-03-12  |  2KB  |  69 lines

  1. /* Stamp'em Install Program
  2.     If OS/2 REXX isn't installed, this won't work */
  3.  
  4. Call RxFuncAdd 'SysLoadFuncs', 'REXXUtil', 'sysLoadFuncs'
  5. Call SysLoadFuncs
  6.  
  7. /* Prompt user for drive and directory to install to */
  8. InputPath:
  9. say "Specify directory to install Stamp'em in. Drive & path required"
  10. say "(e.g. C:\OS2\STAMPEM ). Directory will be created if it doesn't"
  11. say "already exist"
  12. say "?"
  13. parse pull dirname
  14.  
  15. /* Check to see if dirname exists */
  16. doesdirexist = directory( dirname )
  17. select
  18.  when doesdirexist = '' then do
  19.   rc = SysMkDir( dirname )
  20.   select
  21.    when rc = 0 then do
  22.     /* directory created ok */
  23.    end
  24.    when rc = 3 then do
  25.     say 'Invalid path. Try again'
  26.     signal InputPath
  27.    end
  28.    when rc = 87 then do
  29.     say 'Invalid parameter. Try again'
  30.     signal InputPath
  31.    end
  32.    otherwise do
  33.     say 'Error - directory not created. Try again'
  34.     signal InputPath
  35.    end
  36.   end
  37.  end
  38.  otherwise do
  39.   /* directory already exists, so proceed */
  40.  end
  41. end
  42.  
  43. /* Copy files to the chosen directory */
  44. Copy 'Stampem.* 'dirname
  45.  
  46. /* Create a Folder & Place it onto the Desktop */
  47. IconName= dirname'\Stampem.ICO'
  48. Call SysCreateObject 'WPFolder', ,
  49.      "Stamp'em^Folder", ,
  50.      '<WP_DESKTOP>', ,
  51.      'ICONVIEW=NOLINES;' || ,
  52.      "OBJECTID=<Stamp'em_Folder>;" || ,
  53.      'ICONFILE='IconName';' ,
  54.      'U'
  55.  
  56. ClassName='WPProgram'
  57. Title="Stamp'em"
  58. Location="<Stamp'em_Folder>"
  59. progtype='PROGTYPE=PM;'
  60. MaxWindow='MAXIMIZED=YES;'
  61. CloseatEnd='NOAUTOCLOSE=YES;'
  62. exeid='EXENAME='dirname'\stampem.exe;'
  63. Object='OBJECTID=<Stampem_CMD>;'
  64. icon='iconfile='dirname'\stampem.ico;'
  65. Setup=object || exeid || progtype || MaxWindow ,
  66.         || CloseAtEnd || icon
  67. rc=SysCreateObject(ClassName, Title,  ,
  68.                  Location, Setup, 'F')
  69.