home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Spezial / SPEZIAL2_97.zip / SPEZIAL2_97.iso / ANWEND / TOOLS / MKPAT18O / rar.s < prev    next >
Text File  |  1997-07-04  |  7KB  |  353 lines

  1. DestDir="."
  2. mode=""
  3. defbar off
  4. ;BLACK,WHITE,WHITE,BLACK,14,7,52
  5. clrscr
  6.  
  7. ; AV validation
  8. if AVPresent == -1
  9.       Title="Warning"
  10.       Message="Invalid authenticity information"
  11.       call ErrMsg
  12. endif
  13.  
  14. if AVPresent == 0
  15.       Title="Warning"
  16.       Message="Missing authenticity information"
  17.       call ErrMsg
  18. endif
  19.  
  20. Again:
  21.  
  22. ; Main background
  23. setcolor GREEN,WHITE
  24. window 1,1,80,25
  25. clrscr 219
  26. ; Main window
  27. window 1,1,80,25
  28.  
  29. ; AV info
  30. box 3,3,77,8,YELLOW,BLUE,SINGLE
  31. setcolor YELLOW,BLUE
  32. gotoxy 31,3
  33. text " Patch information "
  34. setcolor DARKGRAY,BLACK
  35. window 5,9,78,9
  36. clrscr 177
  37. window 78,4,78,9
  38. clrscr 177
  39. window 4,4,76,7
  40. setcolor WHITE,BLUE
  41. clrscr
  42. ; Fields
  43. gotoxy 1,1
  44. text "  Valid  patch name:   "
  45. gotoxy 1,2
  46. text "  Actual patch name:   "
  47. gotoxy 1,3
  48. text "  Patch date:          "
  49. gotoxy 1,4
  50. text "  Created by:          "
  51. ; Values
  52. setcolor WHITE,BLUE
  53. gotoxy 26,1
  54. if AVArcName!="AVArcName"
  55.     text AVArcName
  56. endif
  57. gotoxy 26,2
  58. text ArcName
  59. gotoxy 26,3
  60. if AVDate!="AVDate"
  61.     text "released ",AVDate
  62. endif
  63. gotoxy 26,4
  64. if AVUserName!="AVUserName"
  65.     text AVUserName
  66. endif
  67.  
  68. window 1,1,80,25
  69. ; Bottom line
  70. setcolor LIGHTCYAN,DARKGRAY
  71. gotoxy 1,25
  72. text "                         Press F1 for help, Alt-X to exit                       "
  73.  
  74. ; Shadow on the meadow
  75. setcolor DARKGRAY,BLACK
  76. window 25,18,56,19
  77. clrscr 177
  78. window 54,11,56,19
  79. clrscr 177
  80. window 1,1,80,25
  81.  
  82. ; Sound on the same meadow
  83. sound 90,1
  84.  
  85. ; Installation Menu:
  86.  
  87. Menu:
  88.  
  89. Choice = menu 25,10,BLACK,WHITE,1,"Patch application menu"," Help with this menu","Scan for patch targets","  List patch actions","   Apply the patch", "         Exit"
  90.  
  91. if Choice==0
  92.    goto Quit
  93. endif
  94.  
  95. if Choice==1
  96.    call OutHelp
  97.    goto Menu
  98. endif
  99.  
  100.  
  101. if Choice==2
  102.    mode="-t"
  103.    install     
  104. endif
  105.  
  106. if Choice==3
  107.    mode="-l"
  108.    install
  109.    goto Again
  110. endif
  111.  
  112. if Choice==4
  113.    mode=""
  114.    install
  115.    goto Again
  116. endif
  117.  
  118. if Choice==5
  119. Quit:
  120.      setcolor WHITE,BLACK
  121.      clrscr
  122.      gotoxy 2,3
  123.      text "The patch has NOT been applied."
  124.      sound 380,25
  125.      delay 210
  126.      sound 190,25
  127.      exit 1
  128.      goto Menu
  129. endif
  130.  
  131. proc OnKey
  132.      window 1,1,80,25
  133.      if Par1 == 3
  134.           savescr 15
  135.           Par1=-1
  136.           sound 2300,25
  137.           delay 100
  138.           sound 1450,100
  139.           Choice=Menu 22,11,WHITE,LIGHTRED,1,"Ctrl-Break","             Abort           ","   Continue operation  "
  140.           if Choice == 1
  141.                exit 1
  142.           endif
  143.           restscr 15
  144.      endif
  145.  
  146.      if Par1 == 301
  147.            goto Quit
  148.      endif
  149.  
  150.      if Par1 == 315
  151.           savescr 15
  152.           call OutHelp
  153.           Par1=-1
  154.           restscr 15
  155.      endif
  156. endp
  157.  
  158. proc Error
  159.      window 7,12,75,23
  160.      setcolor LIGHTCYAN,BLUE
  161.      gotoxy 1,inswrow
  162.  
  163.      Title="Error"
  164.  
  165.      ; Par1 is assigned with error code:
  166.  
  167.      if Par1 == 1
  168.            Message="Fatal error"
  169.            call ErrMsg
  170.      endif
  171.  
  172.      if Par1 == 2
  173.            Message="CRC error, broken archive"
  174.            call ErrMsg
  175.      endif
  176.  
  177.      if Par1 == 3
  178.            Message="Write error"
  179.            call ErrMsg
  180.      endif
  181.  
  182.      if Par1 == 4
  183.            Message="File create error"
  184.            call ErrMsg
  185.      endif
  186.  
  187.      if Par1 == 5
  188.            Message="Read error"
  189.            call ErrMsg
  190.      endif
  191.  
  192.      if Par1 == 6
  193.            Message="File close error"
  194.            call ErrMsg
  195.      endif
  196.  
  197.      if Par1 == 7
  198.            Message="File open error"
  199.            call ErrMsg
  200.      endif
  201.  
  202.      if Par1 == 8
  203.            Message="Not enough memory"
  204.            call ErrMsg
  205.      endif
  206.  
  207.      if inswrow = 12
  208.            text "\n"
  209.      endif
  210.  
  211.      if inswrow < 12
  212.            inswrow=inswrow+1
  213.      endif
  214.      window 1,1,80,25
  215. endp
  216.  
  217. proc ErrMsg
  218.      window 17,14,62,21
  219.      setcolor WHITE,RED
  220.      clrscr
  221.      window 1,1,80,25
  222.      box 20,15,59,20,WHITE,RED,DOUBLE
  223.      gotoxy 1,15
  224.      ctext " ",Title," "
  225.      gotoxy 1,17
  226.      ctext Message
  227.      setcolor WHITE,BLACK
  228.      gotoxy 1,19
  229.      ctext " Ok "
  230.      sound 20,5
  231.      sound 80,50
  232.      delay 15000
  233.      window 1,1,80,25
  234. endp
  235.  
  236. proc OutHelp
  237.      savescr 1
  238. FirstPage:
  239.      window 1,1,80,25
  240.      setcolor LIGHTCYAN,BLUE
  241.      clrscr
  242.      box 1,1,80,25,LIGHTCYAN,BLUE,DOUBLE
  243.      gotoxy 8,25
  244.      ctext " Press PgDn for the second page or Esc for menu... "
  245.      gotoxy 1,1
  246.      ctext " Help for patching "
  247.      gotoxy 1,2
  248.  
  249.      window 2,2,79,24
  250.      outtext on
  251.  
  252. Welcome!
  253.  
  254. This program is actually a patch generated using BinPatch. It will guide you
  255. through applying itself automatically to your software.
  256.  
  257. Select "Scan for patch targets" in main menu (the one you chose to get this
  258. help) you will see it a scan procedure of your harddisks. When finding
  259. possible targets it will tell you so and if not it will also.
  260.  
  261. Select "List patch actions" you will find the some stats about the patch and
  262. listed what this patch actually does. It is recommended that you do this
  263. before really applying the patch on your system.
  264.  
  265. Select "Apply the patch" and it will scan for targets and prompt you with
  266. each it finds, wether to apply the patch or not. Only choosing 'y' there
  267. actually changes the files, you can still skip with 'n' at that time.
  268.  
  269. Hope you find this comfortable and note that this patching system is also
  270. the most efficient as known today and free for non-commercial application,
  271. so you may generate your patches too.
  272.      outtext off
  273.  
  274.      window 2,2,80,25
  275.      setcolor YELLOW,BLUE
  276.      sound 140,5
  277.      outtext on
  278.      outtext off
  279. GetKey1:
  280.      Key=getkey
  281.      if Key==27
  282.            restscr 1
  283.            goto Ende
  284.      endif
  285.      if Key==337
  286. SecondPage:
  287.           window 1,1,80,25
  288.           setcolor LIGHTCYAN,BLUE
  289.           clrscr
  290.           box 1,1,80,25,LIGHTCYAN,BLUE,DOUBLE
  291.           gotoxy 8,25
  292.           ctext " Press PgUp for first page or Esc for menu ..."
  293.           window 2,2,80,25
  294.           setcolor YELLOW,BLUE
  295.           gotoxy 1,1
  296.           sound 145,5
  297.           outtext on
  298.           outtext off
  299. GetKey2:
  300.           Key=getkey
  301.           if Key==27
  302.                 restscr 1
  303.                 goto Ende
  304.           endif
  305.           if Key == 329
  306.                goto FirstPage
  307.           endif
  308.           goto GetKey2
  309.      endif
  310.      goto GetKey1
  311.  
  312. Ende:
  313. endp
  314.  
  315. proc ArcDone
  316.    call DoPatch
  317.  
  318.    window 1,1,80,25
  319.    gotoxy 1,24
  320.  
  321.    text 
  322.  
  323.    if mode==""
  324.       if value!="0" then
  325.          setcolor RED,BLACK
  326.          outtext on
  327. An error occured, seems that patch was not applicable. Check the reason
  328. given above.
  329.          outtext off
  330.       endif
  331.       if value=="0" then
  332.          setcolor GREEN,BLACK
  333.          text "Patch has been successfully applied. Have fun with your enhanced software."
  334.       endif
  335.  
  336.    endif
  337.    if mode!=""
  338.       setcolor GREEN,BLACK
  339.       text "Please restart patch to continue."
  340.    endif
  341. endp
  342.  
  343. proc DoPatch
  344.    setcolor WHITE,BLACK
  345.    window 1,1,80,25
  346.    clrscr
  347.  
  348.    value=exec "DoPatSFX.EXE ", "ThePatch.UTP ", "-auto ", mode
  349. ;   system "del ",DoPatchSFX.EXE
  350. ;   system "del ",ThePatch.UTP
  351. endp
  352.  
  353.