home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: SysTools / SysTools.zip / smbar31.zip / SETUP.CMD < prev    next >
OS/2 REXX Batch file  |  2000-07-29  |  4KB  |  133 lines

  1. /* SmartBar Install */
  2. signal on halt name Exit
  3. call RxFuncAdd SysLoadFuncs, RexxUtil, SysLoadFuncs;
  4. call SysLoadFuncs;
  5. call SysCls
  6. Parse upper Arg Param
  7. say ""
  8. say ""
  9. say "SmartBar 3.1 - Installation"
  10. say ""
  11.  
  12. say "Select your choise:"
  13. Action=Question("  I)nstall D)einstall Q)uit","I","D","Q")
  14. select
  15.   when Action = "D" then do
  16.     rc1=SysDestroyObject( '<ID_SMARTBAR_PROGRAM>' )
  17.     rc2=SysDestroyObject( '<ID_SMARTBAR_HELP>' )
  18.     rc3=SysDestroyObject( '<ID_SMARTBAR_FOLDER>' )
  19.     if rc1\=0 & rc2\=0 & rc3\=0 then do
  20.        say ""
  21.        say "The folder SmartBar was correctly deleted."
  22.        say "If you want, you should delete all files"
  23.        say "in the SmartBar directory."
  24.        say ""
  25.        say "Thank you for using this program."
  26.        say ""
  27.     end
  28.     else do
  29.        say ""
  30.        say "Couldn't delete SmartBar Folder."
  31.        say ""
  32.     end
  33.   end
  34.  
  35.   when Action = "I" then do
  36.     say ""
  37.     say ""
  38.     say ""
  39.     say "WARNING! This version of SmartBar is NOT compatible with earlier versions."
  40.     say "You SHOULD uninstall any previous version before installing this version."
  41.     say ""
  42.     if Question("Continue?  Y)es N)o","Y","N") = "N" then
  43.        call Exit
  44.  
  45.     rc = SysFileTree("SMARTBAR.INI",outfile,'F',,)
  46.     if outfile.0 = 1 then do
  47.       say ""
  48.       say ""
  49.       say ""
  50.       say "Mhhh..... I found a SMARTBAR.INI file."
  51.       say "Is it from a correct version ?"
  52.       say ""
  53.       if Question("Continue?  Y)es N)o","Y","N") = "N" then
  54.          call Exit
  55.     end
  56.  
  57.     say ""
  58.     say ""
  59.     say ""
  60.     say "The contents of this archive (program executable and doc files) are"
  61.     say "provided on as-is basis at no cost to you. Source code is NOT available."
  62.     say "This software is not covered by any warranty of any description on any"
  63.     say "planet known by man. You assume any and all risks associated with the"
  64.     say "use of this Software including, but not limited to global thermonuclear"
  65.     say "war, famine, the fall of Microsoft, uncontrolled acts of glee, corporate"
  66.     say "takeovers, paradigm shifts, and/or failure of the Heisenberg compensators."
  67.     say ""
  68.     if Question("Do you agree?  Y)es N)o","Y","N") = "N" then
  69.        call Exit
  70.  
  71.     call SysCreateObject 'WPFolder', 'SmartBar', '<WP_DESKTOP>',,
  72.         'OBJECTID=<ID_SMARTBAR_FOLDER>;ICONFILE='||directory()||'\SMBFOLD1.ICO;ICONNFILE=1,'||directory()||'\SMBFOLD2.ICO;'
  73.     call SysOpenObject '<ID_SMARTBAR_FOLDER>',0, FALSE
  74.     call SysCreateObject 'WPProgram', 'SmartBar', '<ID_SMARTBAR_FOLDER>',,
  75.            'EXENAME='||directory()||'\SMARTBAR.EXE;PROGTYPE=PM;STARTUPDIR='||directory(),
  76.            ||';OBJECTID=<ID_SMARTBAR_PROGRAM>;'
  77.     call SysCreateObject 'WPProgram', 'SmartBar - Reference (Italian)', '<ID_SMARTBAR_FOLDER>',,
  78.            'EXENAME=VIEW.EXE;PROGTYPE=PM;PARAMETERS=SMARTBAR.HLP;STARTUPDIR='||directory(),
  79.            ||';OBJECTID=<ID_SMARTBAR_HELP>;'
  80.     if Question("Do you want create a shadow into Startup Folder ?  Y)es N)o","Y","N")="Y" then do
  81.        call SysCreateShadow "<ID_SMARTBAR_PROGRAM>", "<WP_START>"
  82.     end
  83.  
  84.     if Question("Do you want run SmartBar now ?  Y)es N)o","Y","N")="Y" then do
  85.       call SysOpenObject '<ID_SMARTBAR_PROGRAM>',0, FALSE
  86.     end
  87.     say ""
  88.     say "The program was correctly installed."
  89.     say ""
  90.     say "Click right mouse for Settings Menu".
  91.     say ""
  92.     say "If do you like this program don't forget to send a mail"
  93.     say "to SmartBar@mclink.it."
  94.     say ""
  95.   end
  96.  
  97.   otherwise
  98.     say ""
  99.     say "Bye."
  100. end
  101.  
  102. exit
  103.  
  104. Exit:
  105. say ""
  106. say "Bye."
  107. say ""
  108. exit
  109.  
  110. /*****************************************************************************/
  111. Question:
  112. resp="["
  113. arrisp.0=0
  114. do i=2 to arg()
  115.   resp=resp || arg(i) || "/"
  116. end
  117. resp=delstr(resp,(length(resp)),1)
  118. resp=resp || "]"
  119. do forever
  120.   say ""
  121.   say arg(1) resp
  122.   parse value SysCurPos() with row col
  123.   row=(row-1)
  124.   col=length(arg(1) resp)+1
  125.   call SysCurPos row, col
  126.   parse upper pull chr
  127.   do i=1 to arg()
  128.      if translate(arg(i))=chr then
  129.         return chr
  130.   end
  131. end
  132. return ""
  133.