home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / SELFPR.ZIP / INSTSELF.CMD next >
OS/2 REXX Batch file  |  1993-01-31  |  2KB  |  79 lines

  1. /* Self prg Installer */
  2.  
  3. call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
  4. call SysLoadFuncs
  5. gpara=""
  6. Qask ='N'
  7. 'CLS'
  8. Do until Qask ='Y'
  9.  'CLS'
  10.  SAY ''
  11.  SAY ''
  12.  SAY 'Enter the Name You wish to Call this Program (Example Dozip.cmd)'
  13.  Parse Pull mname
  14.  SAY 'Enter the Archiver You wish to Use (Example unzip unarj LH x)'
  15.  PARSE Pull zipper
  16.  SAY 'Enter the Extention for the Archived files (Example zip arj lhz)'
  17.  PARSE Pull unext
  18.  SAY unext
  19.  SAY 'Enter PATH to the Archived Files Example C:\ZIPS)'
  20.  SAY 'Directory must EXIST.'
  21.  PARSE Pull dir
  22. Cls
  23.  SAY ''
  24.  SAY ''
  25.  SAY 'The file to be created is to be called'
  26.  SAY mname
  27.  SAY ''
  28.  SAY 'The archiver to be used is called'
  29.  SAY zipper
  30.  SAY ''
  31.  SAY 'The archived files extention is'
  32.  SAY unext
  33.  SAY ''
  34.  SAY 'The drive and driectory to place this file is ' 
  35.  SAY dir
  36.  SAY ''
  37.  SAY 'Enter (Y or y) if Correct (Q or q) to Quit any other key to Re-Enter'
  38.        Pull Qask
  39.    If Qask = 'Q' then Exit
  40.  END
  41.  
  42. dira=dir
  43. testname = insert(dir,'\')
  44. dir = testname
  45. 'copy selfprg.dat' insert(dir,mname)
  46. inname='selfprg.ico'
  47. mnamel=length(mname)
  48. mnamei=left(mname,mnamel-4)
  49. inname2=insert(mnamei,'.ico')
  50. copy 'selfprg.ico' inname2
  51. copy inname2 dira
  52. cmdline = insert(dir,mname)
  53. iconset=insert(dir,inname2)
  54. If \SysSetIcon(cmdline, iconset) then Say 'Setting Icon Failed'
  55.  
  56. CALL lineout insert(dir,mname),insert("unext='",unext)"'"
  57. CALL lineout insert(dir,mname),insert("dir='",dir)"'"
  58. CALL lineout insert(dir,mname),insert("zipper='",zipper)"'"
  59. CALL lineout insert(dir,mname),'return'
  60.  
  61. sdrive = left(dira,2)
  62. sdrive
  63. 'CD' dira
  64.  
  65. ototal =length(cmdline)-4
  66. spos=lastpos("\", cmdline)
  67. odir = substr(cmdline,1,spos-1)
  68. oname = substr(cmdline, spos+1, ototal-spos)
  69. 'CLS'
  70. SAY ''
  71. SAY ''
  72. SAY 'Object name is      ' oname
  73. SAY 'File name path is   ' cmdline
  74. SAY 'Directory is        ' odir
  75. Nogo = SysCreateObject( "WPProgram", oname, "<WP_DESKTOP>", "EXENAME="cmdline";STARTUPDIR="odir";PARAMETERS="gpara)
  76. if Nogo = 0 then say "The BUILD Object operation failed "
  77.                else say mname 'Created and placed on Desktop'
  78. EXIT
  79.