home *** CD-ROM | disk | FTP | other *** search
/ ftp.sunet.sepub/pictures / 2014.11.ftp.sunet.se-pictures.tar / ftp.sunet.se / pub / pictures / ACiD-artpacks / programs / dos / archivers / rar204.exe / rar / STANDARD.S < prev    next >
Text File  |  1996-04-24  |  10KB  |  485 lines

  1. ;           ┌────────────────────────────────────────────┐
  2. ;           │                                            │
  3. ;           │    There is no need to process with RAR!   │
  4. ;           │                                            │
  5. ;           │     JUST RUN THIS SFX MODULE AND ENJOY!    │
  6. ;           │                                            │
  7. ;           └────────────────────────────────────────────┘
  8. ;
  9. ;
  10. ;
  11. ;
  12. ;
  13. ; iSFX script will not be shown as the archive comment with RAR 1.54 and above!
  14. DestDir="INSTALL"
  15. ; Total files in archive. CHANGE TO PROPER VALUE!
  16. files=1
  17. ; Disk space needed to extract files, bytes. CHANGE TO PROPER VALUE!
  18. diskneed=1024
  19. ; Define filebar
  20. defbar BLACK,WHITE,WHITE,BLACK,14,7,52
  21. ; Print out the standard ansi comment ──────────────────────────────────────
  22. clrscr
  23. outtext ansi on
  24. RAR Installation SFX module
  25. Created by RAR 2.00
  26.  
  27. outtext ansi off
  28.  
  29. ; AV validation
  30. if AVPresent == -1
  31.       Title="Warning"
  32.       Message="Invalid authenticity information"
  33.       call ErrMsg
  34. endif
  35.  
  36. if AVPresent == 0
  37.       Title="Warning"
  38.       Message="Missing authenticity information"
  39.       call ErrMsg
  40. endif
  41.  
  42. ; Main background
  43. setcolor DARKGRAY,BLACK
  44. window 1,1,80,25
  45. clrscr 219
  46. ; Main window
  47. window 1,1,80,25
  48.  
  49. ; AV info
  50. box 3,3,68,8,YELLOW,BLUE,SINGLE
  51. setcolor YELLOW,BLUE
  52. gotoxy 24,3
  53. text " Archive information "
  54. setcolor DARKGRAY,BLACK
  55. window 5,9,69,9
  56. clrscr 177
  57. window 69,4,69,9
  58. clrscr 177
  59. window 4,4,67,7
  60. setcolor LIGHTCYAN,BLUE
  61. clrscr
  62. ; Fields
  63. gotoxy 1,1
  64. text "  Valid archive name:  "
  65. gotoxy 1,2
  66. text "  Actual archive name: "
  67. gotoxy 1,3
  68. text "  Archive date:        "
  69. gotoxy 1,4
  70. text "  Created by:          "
  71. ; Values
  72. setcolor WHITE,BLUE
  73. gotoxy 26,1
  74. if AVArcName!="AVArcName"
  75.     text AVArcName
  76. endif
  77. gotoxy 26,2
  78. text ArcName
  79. gotoxy 26,3
  80. if AVDate!="AVDate"
  81.     text "released ",AVDate
  82. endif
  83. gotoxy 26,4
  84. if AVUserName!="AVUserName"
  85.     text AVUserName
  86. endif
  87.  
  88. window 1,1,80,25
  89. ; Bottom line
  90. setcolor LIGHTCYAN,DARKGRAY
  91. gotoxy 1,25
  92. text "                         Press F1 for help, Alt-X to exit                       "
  93.  
  94. ; Shadow on the meadow
  95. setcolor DARKGRAY,BLACK
  96. window 25,17,56,17
  97. clrscr 177
  98. window 54,11,56,17
  99. clrscr 177
  100. window 1,1,80,25
  101.  
  102. ; Sound on the same meadow
  103. sound 90,1
  104.  
  105. ; Installation Menu:
  106.  
  107. Menu:
  108.  
  109. Choice = menu 25,10,BLACK,WHITE,1,"Installation menu","     Read license"," Destination directory ","       Install","         Exit"
  110.  
  111. if Choice == 0
  112.       goto Quit
  113. endif
  114.  
  115. if Choice==1
  116.      savescr 1
  117. FirstPage:
  118.      window 1,1,80,25
  119.      setcolor LIGHTCYAN,BLUE
  120.      clrscr
  121.      box 1,1,80,25,LIGHTCYAN,BLUE,DOUBLE
  122.      gotoxy 8,25
  123.      ctext " Press PgDn for the second page or Esc for menu... "
  124.      gotoxy 1,1
  125.      ctext " License "
  126.      gotoxy 1,1
  127.      window 2,2,80,25
  128.      setcolor YELLOW,BLUE
  129.      sound 140,5
  130.      outtext on
  131.      outtext off
  132. GetKey1:
  133.      Key=getkey
  134.      if Key==27
  135.            restscr 1
  136.            goto Menu
  137.      endif
  138.      if Key==337
  139. SecondPage:
  140.           window 1,1,80,25
  141.           setcolor LIGHTCYAN,BLUE
  142.           clrscr
  143.           box 1,1,80,25,LIGHTCYAN,BLUE,DOUBLE
  144.           gotoxy 8,25
  145.           ctext " Press PgUp for first page or Esc for menu ..."
  146.           window 2,2,80,25
  147.           setcolor YELLOW,BLUE
  148.           gotoxy 1,1
  149.           sound 145,5
  150.           outtext on
  151.           outtext off
  152. GetKey2:
  153.           Key=getkey
  154.           if Key==27
  155.                 restscr 1
  156.                 goto Menu
  157.           endif
  158.           if Key == 329
  159.                goto FirstPage
  160.           endif
  161.           goto GetKey2
  162.      endif
  163.      goto GetKey1
  164. endif
  165.  
  166.  
  167. if Choice == 2
  168.      savescr 1
  169.      setcolor WHITE,CYAN
  170.      window 11,10,67,15
  171.      clrscr
  172.      box 4,2,54,5,WHITE,CYAN,SINGLE
  173.      gotoxy 20,2
  174.      text " Destination directory "
  175.      window 15,12,63,13
  176.      clrscr
  177.      setcolor WHITE,CYAN
  178.      gotoxy 4,1 
  179.      text "Enter directory to which to install"
  180.      window 18,13,60,13
  181.      Res=INPUT DARKGRAY,WHITE,DestDir,DestDir,42
  182.      restscr 1
  183.      window 1,1,80,25
  184.      goto Menu
  185. endif
  186.  
  187. if Choice == 3
  188.   box 6,11,76,24,LIGHTCYAN,BLUE,DOUBLE
  189.   setcolor LIGHTCYAN,BLUE
  190.   gotoxy 27,11
  191.   text " Installation status: "
  192.   window 7,12,75,23
  193.   clrscr
  194. ; Check free space
  195.   DiskSpace=getdfree
  196.   KDiskSpace=DiskSpace/1024
  197.   KDiskNeed=diskneed/1024
  198.   text "Installation started.\n"
  199.   text "Disk space required:  ",KDiskNeed," Kb\n"
  200.   text "Disk space available: ",KDiskSpace," Kb\n"
  201.   inswrow=4
  202.   window 1,1,80,25
  203.  
  204.   if DiskSpace < diskneed
  205.           savescr 1
  206.           window 1,1,80,25
  207.           sound 2300,25
  208.           delay 100
  209.           sound 1450,25
  210.           delay 100
  211.           sound 2300,100
  212.           Choice = menu 24,16,WHITE,RED,1,"Out of disk space","Continue with installation","          Exit"
  213.           if Choice == 0
  214.                goto Quit
  215.           endif
  216.           if Choice == 2
  217.                goto Quit
  218.           endif
  219.           restscr 1
  220.      endif
  221. endif
  222.  
  223. if Choice == 4
  224. Quit:
  225.      setcolor WHITE,BLACK
  226.      clrscr
  227.      gotoxy 2,3
  228.      text "The SFX package has not yet been extracted."
  229.      sound 380,25
  230.      delay 210
  231.      sound 190,25
  232.      exit 1
  233.      goto Menu
  234. endif
  235.  
  236. ; HERE INSTALLATION STARTS!
  237. ; ctext "Installation has started."
  238.  
  239. proc OnKey
  240.      window 1,1,80,25
  241.      if Par1 == 3
  242.           savescr 15
  243.           Par1=-1
  244.           sound 2300,25
  245.           delay 100
  246.           sound 1450,100
  247.           Choice=Menu 22,11,WHITE,LIGHTRED,1,"Ctrl-Break","             Abort           ","   Continue with installation   "
  248.           if Choice == 1
  249.                exit 1
  250.           endif
  251.           restscr 15
  252.      endif
  253.  
  254.      if Par1 == 301
  255.            goto Quit
  256.      endif
  257.  
  258.      if Par1 == 315
  259.           savescr 15
  260.           call OutHelp
  261.           Par1=-1
  262.           restscr 15
  263.      endif
  264. endp
  265.  
  266. proc ChangeVol
  267.  
  268.      window 7,12,75,23
  269.      setcolor YELLOW,BLUE
  270.      gotoxy 1,inswrow
  271.  
  272.      if Par2 == 0
  273.            text ".. VOLUME #",Par1," should be installed."
  274.            savescr 14
  275.            Par1=-1
  276.            sound 2300,25
  277.            delay 100
  278.            sound 1450,100
  279.            sound 5450,50
  280.            sound 7450,25
  281.            sound 1450,100
  282.  
  283.            Choice=Menu 22,11,WHITE,GREEN,1," Change volume ","   Process the next volume        ","         Exit immediately    "
  284.  
  285.            restscr 14
  286.  
  287.            if Choice == 2
  288.                  window 7,12,75,23
  289.                  inswrow=inswrow+1
  290.                  gotoxy 1,inswrow
  291.                  text " Volume not found. Exiting..          "
  292.                  exit 1
  293.            endif
  294.      endif
  295.  
  296.      if Par2 != 0
  297.            setcolor LIGHTCYAN,BLUE
  298.            text ".. VOLUME #",Par1," has been processed."
  299.      endif
  300.  
  301.      if inswrow = 12
  302.            text "\n"
  303.      endif
  304.  
  305.      if inswrow < 12
  306.            inswrow=inswrow+1
  307.      endif
  308.      window 1,1,80,25
  309. endp
  310.  
  311. proc FileDone
  312.      gotoxy 49,11
  313.      setcolor LIGHTCYAN,BLUE
  314.      Percent=Par1*100
  315.      Percent=Percent/files
  316.      text Percent,"%% "
  317.      window 7,12,75,23
  318.      setcolor LIGHTCYAN,BLUE
  319.      gotoxy 1,inswrow
  320.      text DestFileName
  321.      if inswrow = 12
  322.            text "\n"
  323.      endif
  324.      if inswrow < 12
  325.            inswrow=inswrow+1
  326.      endif
  327.      window 1,1,80,25
  328. endp
  329.  
  330. proc Error
  331.  
  332.      window 7,12,75,23
  333.      setcolor LIGHTCYAN,BLUE
  334.      gotoxy 1,inswrow
  335.  
  336.      Title="Error"
  337.  
  338.      ; Par1 is assigned with error code:
  339.  
  340.      if Par1 == 1
  341.            Message="Fatal error"
  342.            call ErrMsg
  343.      endif
  344.  
  345.      if Par1 == 2
  346.            Message="CRC error, broken archive"
  347.            call ErrMsg
  348.      endif
  349.  
  350.      if Par1 == 3
  351.            Message="Write error"
  352.            call ErrMsg
  353.      endif
  354.  
  355.      if Par1 == 4
  356.            Message="File create error"
  357.            call ErrMsg
  358.      endif
  359.  
  360.      if Par1 == 5
  361.            Message="Read error"
  362.            call ErrMsg
  363.      endif
  364.  
  365.      if Par1 == 6
  366.            Message="File close error"
  367.            call ErrMsg
  368.      endif
  369.  
  370.      if Par1 == 7
  371.            Message="File open error"
  372.            call ErrMsg
  373.      endif
  374.  
  375.      if Par1 == 8
  376.            Message="Not enough memory"
  377.            call ErrMsg
  378.      endif
  379.  
  380.      if inswrow = 12
  381.            text "\n"
  382.      endif
  383.  
  384.      if inswrow < 12
  385.            inswrow=inswrow+1
  386.      endif
  387.      window 1,1,80,25
  388. endp
  389.  
  390. proc ErrMsg
  391.      window 17,14,62,21
  392.      setcolor WHITE,RED
  393.      clrscr
  394.      window 1,1,80,25
  395.      box 20,15,59,20,WHITE,RED,DOUBLE
  396.      gotoxy 1,15
  397.      ctext " ",Title," "
  398.      gotoxy 1,17
  399.      ctext Message
  400.      setcolor WHITE,BLACK
  401.      gotoxy 1,19
  402.      ctext " Ok "
  403.      sound 20,5
  404.      sound 80,50
  405.      delay 15000
  406.      window 1,1,80,25
  407. endp
  408.  
  409. proc ArcDone
  410.      sound 3300,25
  411.      delay 100
  412.      sound 2450,100
  413.      window 7,12,75,23
  414.      setcolor LIGHTCYAN,BLUE
  415.      gotoxy 1,inswrow
  416.      text "Done. Installation completed"
  417.      delay 500
  418.      savescr 2
  419.      Title="Installation status"
  420.      Message=" Completed "
  421.      call OkMsg
  422.      restscr 2
  423. endp
  424.  
  425. proc OkMsg
  426.      window 24,14,57,21
  427.      setcolor BLACK,WHITE
  428.      clrscr
  429.      window 1,1,80,25
  430.      box 27,15,53,20,BLACK,WHITE,DOUBLE
  431.      gotoxy 1,15
  432.      ctext " ",Title," "
  433.      gotoxy 1,17
  434.      ctext Message
  435.      setcolor WHITE,BLACK
  436.      gotoxy 1,19
  437.      ctext " Ok "
  438.      delay 50000
  439.      window 1,1,80,25
  440. endp
  441.  
  442. proc OutHelp
  443.      setcolor BLACK,CYAN
  444.      box 14,6,65,20,BLACK,CYAN,SINGLE
  445.      gotoxy 37,6
  446.      text " Help "
  447.      window 15,7,64,19
  448.      clrscr
  449.      outtext on
  450.  
  451.     To install choose the destination directory,
  452.     then press Enter on the "Install" item
  453.     of the menu.
  454.  
  455.     After installation files should be
  456.     in the specified directory.
  457.  
  458.      outtext off
  459.      delay
  460. endp
  461. ;
  462. ;
  463. ;
  464. ;
  465. ;
  466. ;
  467. ;
  468. ;
  469. ;
  470. ;
  471. ;
  472. ;           ┌────────────────────────────────────────────┐
  473. ;           │                                            │
  474. ;           │    There is no need to process with RAR!   │
  475. ;           │                                            │
  476. ;           │     JUST RUN THIS SFX MODULE AND ENJOY!    │
  477. ;           │                                            │
  478. ;           └────────────────────────────────────────────┘
  479. ;
  480. ;
  481. ;
  482. ;
  483. ;
  484. ; iSFX script will not be shown as the archive comment with RAR 1.54 and above!
  485.