home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / icecq201.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  2000-01-14  |  3KB  |  109 lines

  1. /* REXX installation script for iceCQ
  2.  * Copyright (C) 2000 by ilfat Kutdusov
  3.  *
  4.  */
  5.  
  6. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  7. call SysLoadFuncs
  8.  
  9. /*------------------------------------------------------------------
  10.  * Initialization 
  11.  *------------------------------------------------------------------*/
  12.  
  13. D.Folder = 'IceCQ/2'
  14. D.Object = 'IceCQ/2'
  15. D.Program = 'IceCQ.EXE'
  16. D.Readme = 'Readme_english.txt'
  17. D.DOC = 'demo_readme_english.txt'
  18.  
  19.  
  20. installdir = directory()"\"
  21. installlog = installdir"install.log"
  22.  
  23. if GetYesNo( "Install" D.Object "in" installdir ) == 0 then
  24.    exit
  25.  
  26. /*------------------------------------------------------------------
  27.  * Create folder
  28.  *------------------------------------------------------------------*/
  29.  
  30. rc = SysCreateObject( "WPFolder",D.Folder,"<WP_DESKTOP>",,
  31.                       "OBJECTID=<WTFolder>;ALWAYSSORT=Yes" ,"REPLACE" )
  32.  
  33. if rc then
  34.    call log D.Fodler "folder successfully created on desktop..."
  35. else
  36.    call log "ERROR:" D.Folder "folder creating failed!"
  37.  
  38. /*------------------------------------------------------------------
  39.  * Create object
  40.  *------------------------------------------------------------------*/
  41.  
  42. rc = SysCreateObject( "WPProgram", D.Object, "<WTFolder>",,
  43.                       "OBJECTID=<MINITUN>;EXENAME="installdir""D.Program";STARTUPDIR="installdir";REPLACE" )
  44.  
  45. if rc then
  46.    call log D.Object "object successfully created..."
  47. else 
  48.    call log "ERROR:" D.Object "object creating failed!"
  49.  
  50. rc = SysCreateObject( "WPShadow", D.Object, "<WP_START>",,
  51.                       "SHADOWID=<MINITUN>",,
  52.                       "REPLACE" )
  53.  
  54. if rc then
  55.    call log D.Object "object added in Startup folder..."
  56. else 
  57.    call log "ERROR:" D.Object "object adding in Startup folder failed!"
  58.  
  59. /*------------------------------------------------------------------
  60.  * Create object
  61.  *------------------------------------------------------------------*/
  62.  
  63. rc =SysCreateObject("WPProgram", D.Object || "^Readme" , "<WTFolder>", "EXENAME=E.EXE;PARAMETERS=" || installdir || "" || D.Readme, "replace")
  64.  
  65. if rc then
  66.    call log "Readme object successfully created..."
  67. else 
  68.    call log "ERROR:" D.Readme "object creating failed!"
  69.  
  70. rc =SysCreateObject("WPProgram", D.Object || "^Demo limitation" , "<WTFolder>", "EXENAME=E.EXE;PARAMETERS=" || installdir || "" || D.DOC, "replace")
  71.  
  72. if rc then
  73.    call log "Demo limitations object successfully created..."
  74. else 
  75.    call log "ERROR:" "Demo limitations object creating failed!"
  76.  
  77.  
  78.  
  79. Exit
  80.  
  81. /*------------------------------------------------------------------
  82.  * Get Yes or No
  83.  *------------------------------------------------------------------*/
  84. GetYesNo: procedure
  85.  
  86.    ok = 0
  87.  
  88.    do until ok
  89.       call charout, arg(1) || "? "
  90.       pull reply
  91.       reply = left(reply, 1)
  92.       ok = (reply = "Y") | (reply = "N")
  93.       if \ok then do
  94.          say 'Huh? Please enter "Y" or "N".'
  95.       end
  96.    end
  97.  
  98. return (reply = "Y")
  99.  
  100. /*------------------------------------------------------------------
  101.  * Write log message
  102.  *------------------------------------------------------------------*/
  103. Log: procedure expose installlog; parse arg msg
  104.  
  105.    say  "■■■ "msg
  106.    call lineout installlog, "INSTALL: "msg
  107.  
  108. return
  109.