home *** CD-ROM | disk | FTP | other *** search
/ Wizard Games 2 / W_GAMES2.ISO / instger.cmd < prev    next >
OS/2 REXX Batch file  |  1995-03-02  |  8KB  |  228 lines

  1. /***INSTALL-Procedure für WKSHELL/2***/
  2.  
  3. signal on halt name SignalHandler       /* Exception handler */
  4. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  5. call SysLoadFuncs
  6.  
  7. /* ******************************************* */
  8. SourceDrive=""
  9. SourceDir="\GERMAN\"
  10. ExeDest="C:\WKSHELL\"
  11. File.0 = 5
  12. File.1="WKSHELL.EXE"
  13. File.2="WKSHELL.HLP"
  14. File.3="WKSHELL.INF"
  15. File.4="WKSLIST.CMD"
  16. File.5="UNZIP.EXE"
  17. global_again=1
  18.  
  19. /* ******************************************* */
  20. call InitColors
  21.  
  22. rc = SysFileTree("instger.cmd", dummy, "F" ,"*****")  /* GET CD-ROM-Letter */
  23. if dummy.0 > 0 then do
  24.   SourceDrive=substr(dummy.1,38,2)
  25. end
  26. else do
  27.   say
  28.   say
  29.   say bred||"FEHLER :"
  30.   say bred||"Bitte wechseln Sie zuerst auf Ihr CD-ROM-Laufwerk und starten dann INSTGER.CMD"
  31.   say normal
  32.   exit
  33. end
  34.  
  35. do while global_again = 1
  36.    Men = MainMenu()
  37.    if Men="1" then do
  38.        call GotoXY 5,21
  39.        a = charout(,byellow||"Welchen Laufwerks-Buchstaben hat Ihr CD-ROM ?  ")
  40.        SourceDrive=Translate(SysGetKey('NOECHO'))
  41.        SourceDrive=SourceDrive || ":"
  42.    end
  43.    if Men="2" then do
  44.        call GotoXY 5,21
  45.        a = charout(,byellow||"Neues WK-Shell/2 -Verzeichnis: ")
  46.        pull ExeDest
  47.        if right(ExeDest,1) \= "\" then
  48.           ExeDest=ExeDest||"\"
  49.    end
  50.    if Men="3" then do
  51.       say normal
  52.       Installed=1
  53.       Call Install
  54.    end
  55.    if Men="4" then do
  56.        call SysCls
  57.        global_again=0
  58.        say "Ende...!"
  59.        if Installed=1 then do
  60.           say
  61.           say "Sie können die WK-Shell/2 jetzt von der Festplatte starten :"
  62.           say bred||ExeDest||"WKSHELL.EXE"||" "||SourceDrive
  63.           say bcyan||"Der Parameter <"||SourceDrive||"> wird benötigt, damit das CD-ROM gefunden wird."
  64.        end
  65.        say normal
  66.        exit
  67.    end
  68. end
  69.  
  70.  
  71. /* ******************************************* */
  72. MainMenu:
  73. call SysCls
  74.     a = charout(,byellow||"┌──────────────────────────────────────────────────────────────────────────────┐")
  75.     a = charout(,"│                                 WK-Shell/2 INSTALL                           │")
  76.     a = charout(,"├──────────────────────────────────────────────────────────────────────────────┤")
  77.     a = charout(,"│                                                                              │")
  78.     a = charout(,"│                                                                              │")
  79.     a = charout(,"│                                                                              │")
  80.     a = charout(,"│                                                                              │")
  81.     a = charout(,"│                                                                              │")
  82.     a = charout(,"│                                                                              │")
  83.     a = charout(,"│                                                                              │")
  84.     a = charout(,"├──────────────────────────────────────────────────────────────────────────────┤")
  85.     a = charout(,"│                                                                              │")
  86.     a = charout(,"│                                                                              │")
  87.     a = charout(,"│                                                                              │")
  88.     a = charout(,"│                                                                              │")
  89.     a = charout(,"│                                                                              │")
  90.     a = charout(,"├──────────────────────────────────────────────────────────────────────────────┤")
  91.     a = charout(,"│                                                                              │")
  92.     a = charout(,"│                                                                              │")
  93.     a = charout(,"│                                                                              │")
  94.     a = charout(,"├──────────────────────────────────────────────────────────────────────────────┤")
  95.     a = charout(,"│                                                                              │")
  96.     a = charout(,"└────────────────────────────────────────────────────────────────────(C)'95 WOK┘")
  97.     call GotoXY 5,4
  98.     a = charout(,bcyan||"1) CD-ROM Laufwerk      : "||bred||SourceDrive)
  99.     call GotoXY 5,6
  100.     a = charout(,bcyan||"2) Programm-Verzeichnis : "||bred||ExeDest)
  101.     call GotoXY 5,12
  102.     a = charout(,bcyan||"3) JETZT INSTALLIEREN !     ")
  103.     call GotoXY 5,14
  104.     a = charout(,bcyan||"4) ENDE! Raus hier... !     ")
  105.     call GotoXY 5,18
  106.     a = charout(,bcyan||"_ <--- Ihre Wahl ?   ")
  107.     call GotoXY 5,18
  108.     again=1
  109.     do while again=1
  110.        MM_key=Translate(SysGetKey('NOECHO'))
  111.        if MM_key="1"|,
  112.          MM_key="2"|,
  113.          MM_key="3"|,
  114.          MM_key="4" then do
  115.            again=0
  116.            say MM_key
  117.        end
  118.     end
  119. return MM_key
  120.  
  121.  
  122. // ******************** INSTALL ***************************
  123. Install:
  124.   call SysCls
  125.   Error = 0
  126.   do i = 1 to File.0                        /* Copy EXE-Files */
  127.      Source=SourceDrive||SourceDir||File.i
  128.      if FileExists(Source) = 0 then do
  129.         say bred||"FEHLER: Quelldatei nicht vorhanden: "||Source
  130.         'pause'
  131.         Error=1
  132.         Installed = 0
  133.         say normal
  134.      end
  135.      else 'xcopy 'Source ExeDest
  136.   end
  137.   'pause'
  138.   if Error = 0 then do                       /* Make Desktop-Object ? */
  139.     MM_input=""
  140.     do while MM_input\="J" & MM_input\="N"   /* Security question */
  141.        say bcyan
  142.        say "Soll ein WK-Shell/2 Objekt auf der Arbeitsoberfläche erzeugt werden (J/N) ?"
  143.        pull MM_input
  144.     end /* do while */
  145.     if MM_input = "J" then
  146.        call MakeObject
  147.   end
  148. return
  149.  
  150. /* *+++++++++++++++++++++++++++ */
  151. SignalHandler:
  152.   call SysCls
  153.   say bred||"Unterbrechung !"
  154.   say normal
  155.   exit
  156.  
  157.  
  158. /* ******************************** */
  159. FileExists: procedure
  160.    Maske = arg(1)
  161.    rc = SysFileTree(Maske, dummy, "FO" ,"*****")
  162.    if dummy.0 > 0 then
  163.      return 1
  164.    else
  165.      return 0
  166.  
  167. /* ******************************+  */
  168. MakeObject:
  169.   SetupString="TITLE=WK-Shell/2 (D);OBJECTID=<WKSHELL2G>;ASSOCFILTER=*.IDX;EXENAME="||ExeDest||"WKSHELL.EXE;PARAMETERS="||SourceDrive
  170.   rc=SysCreateObject("WPProgram",,
  171.      ExeDest||"WKSHELL.EXE",,
  172.      "<WP_DESKTOP>",,
  173.      SetupString)
  174.    if rc=0 then do
  175.      say "WPS-Objekt konnte NICHT erstellt werden."
  176.      pause
  177.    end
  178.    else do
  179.      say "WPS-Objekt wurde erzeugt !"
  180.    end
  181. return
  182.  
  183.  
  184.  
  185.  
  186.  
  187. /* ***********************************************
  188.    * Set Color Strings for AnsiColor
  189.    *********************************************** */
  190. InitColors:
  191.   esc     = '1B'x          /* define ESCape character */
  192.   red     = esc||"[31m"    /* ANSI.SYS-control for red foreground */
  193.   yellow  = esc||"[33m"    /* ANSI.SYS-control for yellow foreground */
  194.   cyan      = esc||"[36m"    /* ANSI.SYS-control for cyan foreground */
  195.   normal  = esc||"[0m"     /* ANSI.SYS-control for resetting attributes to normal */
  196.   bright  = esc||"[1m"     /* ANSI.SYS-control for bright foreground colors */
  197.   bred    = bright || red
  198.   byellow = bright || yellow
  199.   bcyan   = bright || cyan
  200.   upline  = esc||'[1A'     /* Cursor one line up */
  201.  
  202. RETURN
  203.  
  204. /* ************************************************
  205.    * WhereX()
  206.    ************************************************ */
  207. WhereX: procedure
  208.     parse value SysCurPos() with W_z W_s
  209. return W_s
  210.  
  211. /* ************************************************
  212.    * WhereY()
  213.    ************************************************ */
  214. WhereY: procedure
  215.     parse value SysCurPos() with W_z W_s
  216. return W_z
  217.  
  218. /* ************************************************
  219.    * GotoXY(x,y)
  220.    ************************************************ */
  221. GotoXY: procedure
  222.     G_s=arg(1)
  223.     G_z=arg(2)
  224.     G_dummy=SysCurPos(G_z, G_S)
  225. return
  226.  
  227.  
  228.