home *** CD-ROM | disk | FTP | other *** search
/ PC Shareware 1997 November / PC_Shareware-1997-11.iso / programy / winrar / wrar201.exe / SFX.Txt < prev    next >
Encoding:
Text File  |  1997-03-22  |  11.8 KB  |  500 lines

  1.  
  2.  ██████╗   █████╗  ██████╗      Installation SFX Manual
  3.  ██╔══██╗ ██╔══██╗ ██╔══██╗     ~~~~~~~~~~~~~~~~~~~~~~~
  4.  ██████╔╝ ███████║ ██████╔╝     RAR 2.01 for Windows
  5.  ██╔══██╗ ██╔══██║ ██╔══██╗     ~~~~~~~~~~~~~~~~~~~~
  6.  ██║  ██║ ██║  ██║ ██║  ██║     Multifunctional Integrated Archive Manager
  7.  ╚═╝  ╚═╝ ╚═╝  ╚═╝ ╚═╝  ╚═╝     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  8.  
  9.  
  10.   1. Where the installation SFX script should be placed
  11.  
  12.   Initially the installation SFX refers to a user data resource called
  13.   "SCRIPT". If there is no resource with that name, the archive comment
  14.   will be processed as the script.
  15.  
  16.  
  17.   2. Script resources
  18.  
  19.   Prepare dialogs, icons and other resources needed for your script with
  20.   help of your resource editor. You should then compile the resources and
  21.   add them to the SFX module with a resource compiler.
  22.  
  23.  
  24.   3. Script language
  25.  
  26.   The script strings starting with a semicolon ';' character are
  27.   comments and are ignored when processing.
  28.  
  29.  
  30.   3.1. Operations
  31.  
  32.   Assignment:   <Lvalue>=<Rvalue>
  33.  
  34.   where <Lvalue> is a variable or control (checkbox or radio button). Set
  35.   1 to control to place the check mark and 0 to remove the check mark.
  36.  
  37.   <Rvalue> is a number, variable or control (checkbox or radio button).
  38.   Control value is 1, if control is checked, or 0, if it is not checked.
  39.  
  40.   Logical negation:   !<value>
  41.  
  42.   where <Value> is a variable or control (checkbox or radio button). The
  43.   result of the operation is 0 when <value> is nonzero and 1 when value is
  44.   zero.
  45.  
  46.  
  47.   3.2. Variables
  48.  
  49.   Variable names are case sensitive.
  50.  
  51.   Variable name length          up to 31 bytes
  52.   Variable type                 integer
  53.  
  54.   Due to the fact that supported operations are assignment and logical
  55.   negation only, the main purpose of variables is to maintain the state
  56.   of controls in order to restore their value at a later time and for
  57.   usage in the IF operator.
  58.  
  59.  
  60.   3.3. Controls
  61.  
  62.   The controls only in the currently active dialog may be accessed.
  63.  
  64.   To access a control use the following syntax:
  65.  
  66.   $<control ID>
  67.  
  68.   Examples:
  69.  
  70.   "Check control with ID 101":
  71.  
  72.     $101=1
  73.  
  74.   "Save state of control with ID 102 to the variable Custom":
  75.  
  76.     Custom=$102
  77.  
  78.  
  79.   3.4. Macros
  80.  
  81.   There are four macros: %%D, %%A, %%F and %%".  In a string of
  82.   script they will be expanded as follows:
  83.  
  84.     %%D   destination path for extraction
  85.     %%A   current archive name (changes when volume are processing)
  86.     %%F   current file being extracted (destination path is omitted)
  87.     %%"   quote mark
  88.  
  89.   These macros are mainly to be used in the SetText operator.
  90.  
  91.  
  92.   3.5. Operators
  93.  
  94.   Syntax notes:
  95.  
  96.   1) Operator names are case insensitive.
  97.  
  98.   2) If a parameter is a text string containing spaces, it must be in
  99.   quotation marks. When there are no spaces in the string, the quotation
  100.   marks are optional.  The sole exception to this rule is text strings in
  101.   the second form of the SetText operator, which must be quoted.
  102.  
  103.   Operators:
  104.  
  105.   EXIT                 Cancel script execution.
  106.  
  107.  
  108.   DIALOG <DlgName>     Create dialog using resource <DlgName>. If
  109.                        there is an active dialog, the newly creating
  110.                        dialog will be it's child.
  111.   Example:
  112.  
  113.     Dialog SETUP
  114.  
  115.  
  116.   ENDDIALOG            Close active dialog.
  117.  
  118.  
  119.   ANIMATE <c>,<R>,<G>,<B>,<speed>    Animated show of control <c>.
  120.  
  121.   <R>,<G> and <B> define the destination color.
  122.   Higher <speed> value leads to faster animation, slowest
  123.   animation will be when <speed> is equal to 0.
  124.  
  125.   SETFONT <c>,<font>,<height> [,<type>]      Set control <c> font.
  126.  
  127.   Optional parameter <type> is the string, which can contain
  128.   letters 'I' - italic font, 'F' - fixed font pitch, 'B' - bold,
  129.   'L' - light.
  130.  
  131.   Example:
  132.  
  133.     SetFont $101,"Times New Roman",20,"B"
  134.  
  135.  
  136.   SETTEXT <c>,<t>      Set text <t> to control <c>.
  137.  
  138.  
  139.   Example:
  140.  
  141.     SetText $107,"extracting"
  142.  
  143.   If control id is 0, this command will change current window
  144.   title bar.
  145.  
  146.   Example:
  147.  
  148.     SetText $0,"FAR 1.1 beta"
  149.  
  150.   Alternate SetText form, used to set controls with several lines:
  151.  
  152.  
  153.   SETTEXT <control>
  154.   {
  155.     "line 1"
  156.      ...
  157.     "line N"
  158.   }
  159.  
  160.   Example:
  161.  
  162.     SetText $108
  163.     {
  164.       "         This is a beta version"
  165.       ""
  166.       "         Please be very careful"
  167.     }
  168.  
  169.  
  170.   IF..ELSE             Conditional execution.
  171.  
  172.   Syntax:
  173.  
  174.   IF <value>
  175.   {
  176.     <operators>
  177.   }
  178.   ELSE
  179.   {
  180.     <operators>
  181.   }
  182.  
  183.   where <Value> is a variable or control (checkbox or radio button).
  184.   Logical negation operation is applicable here as well.
  185.  
  186.   The ELSE part of the IF operator is optional.
  187.  
  188.   Example:
  189.  
  190.   If control with ID 106 is not checked, set text "Enabled" to the
  191.   control with ID 111:
  192.  
  193.     If !$106
  194.     {
  195.       SetText $111,"Enabled"
  196.     }
  197.  
  198.  
  199.   IFEXIST..ELSE        Conditional execution where condition
  200.                        is a file existence.
  201.  
  202.   Syntax:
  203.  
  204.   IF <file name>
  205.   {
  206.     <operators>
  207.   }
  208.   ELSE
  209.   {
  210.     <operators>
  211.   }
  212.  
  213.  
  214.   where <file name> is a file name.
  215.  
  216.   The ELSE part of the IF operator is optional.
  217.  
  218.   Example:
  219.  
  220.     IfExist "%%Drar.ini"
  221.     {
  222.       Exclude "rar.ini"
  223.     }
  224.  
  225.  
  226.   CREATEGROUP <Group>  Create program manager group named <Group>.
  227.  
  228.   If the group already exists it will be activated.
  229.  
  230.   Example:
  231.  
  232.     CreateGroup "WinRAR 2.0"
  233.  
  234.  
  235.   DELETEGROUP <Group>  Delete program manager group named <Group>.
  236.  
  237.   Example:
  238.  
  239.     DeleteGroup "Applications"
  240.  
  241.  
  242.   ADDITEM <path> [,<item> [,<icon file] ]
  243.  
  244.   Add item to just created or activated group (using CREATEGROUP
  245.   operator). First parameter is the path of the file to be added,
  246.   second optional parameter is the item name in the group and
  247.   third optional parameter is the icon file name.
  248.  
  249.   Example:
  250.  
  251.     AddItem  "%%Dwinrar.hlp","WinRAR help"
  252.  
  253.     NOTE: %%D will be replaced with the destination path.
  254.  
  255.  
  256.   SETKEY <key>,<key value>
  257.  
  258.   Set key value in the registry; <key> is a subkey of the
  259.   HKEY_CLASSES_ROOT key.
  260.  
  261.   Example:
  262.  
  263.   Associate .rar extension with WinRAR:
  264.  
  265.     SetKey .rar,RAR.Archive
  266.     SetKey RAR.Archive,"RAR archive"
  267.     SetKey RAR.Archive\shell\open\command,"%%Dwinrar.exe %%"%1%%""
  268.  
  269.  
  270.   MASK [<Mask>]        Set file mask to extract.
  271.  
  272.   Wildcards and multiple mask operators are allowed. Set "*.*" mask to
  273.   extract all files. If no <mask> is specified, current mask list is
  274.   discarded.
  275.  
  276.   Example:
  277.  
  278.   Preparing to extract EXE and COM files:
  279.  
  280.     Mask *.exe
  281.     Mask *.com
  282.  
  283.  
  284.   EXCLUDE [<Mask>]        Set exclude from extract file mask
  285.  
  286.   Wildcards and multiple exclude operators are allowed.
  287.   If no <mask> is specified, the current exclude mask list is discarded.
  288.  
  289.   Example:
  290.  
  291.   Exclude from extract, DLL files:
  292.  
  293.     Exclude *.dll
  294.  
  295.  
  296.   EXTRACT [<control>]  Start extraction of files from the archive (using
  297.                        masks defined with MASK operators).
  298.                        Optional parameter is a control where to show the
  299.                        name of the extracted file.
  300.   Example:
  301.  
  302.     Extract $107
  303.  
  304.  
  305.   EXEC <name>          Execute a program. Script processing is not
  306.                        suspended, continued simultaneously with
  307.                        execution of a program.
  308.   Example:
  309.  
  310.     Exec "%%Dwinrar.exe"
  311.  
  312.  
  313.   EXECW <name>         Similar to EXEC, but script is suspended
  314.                        while program is executing.
  315.  
  316.   DELETE <name>        Deletes the specified file.
  317.  
  318.   SETPATH <path>       Set path to extract. <Path> is a text string
  319.                        or a control with text. By default <path> is
  320.                        "program files" directory.
  321.  
  322.   Examples:
  323.  
  324.     SetPath "C:\WinRAR"
  325.  
  326.     SetPath $102
  327.  
  328.  
  329.   SETPASSWORD <passwd> Set password to decrypt files during extraction.
  330.                        The password <passwd> may be a text string or a
  331.                        control with text.
  332.   Example:
  333.  
  334.     SetPassword $104
  335.  
  336.  
  337.   SETARCNAME <name>    Set archive name. <Name> may be a text string or
  338.                        a control with text. This operator is to be used
  339.                        only to specify the next volume name in the ASKVOLUME
  340.                        function.
  341.   Example:
  342.  
  343.     SetArcName $103
  344.  
  345.  
  346.   BKCOLOR <Red>,<Green>,<Blue>
  347.  
  348.   Set dialogs background color.
  349.  
  350.   Example:
  351.  
  352.     BkColor 255,255,255
  353.  
  354.  
  355.   DISABLE <control>    Disable a control.
  356.  
  357.   Example:
  358.  
  359.     Disable $105
  360.  
  361.  
  362.   ENABLE <control>     Enable a control.
  363.  
  364.   Example:
  365.  
  366.     Enable $105
  367.  
  368.  
  369.   3.6. Functions
  370.  
  371.   Syntax notes:
  372.  
  373.   1) Function MAIN. Starts the script execution and must be the first
  374.   function in the script:
  375.  
  376.    MAIN
  377.    {
  378.      <operators>
  379.    }
  380.  
  381.   Example:
  382.  
  383.    MAIN
  384.    {
  385.      Dialog SETUP
  386.    }
  387.  
  388.   2) Function "<Dialog>:INIT". The function is executed before a, just
  389.   created, dialog is displayed:
  390.  
  391.    <DialogName>:INIT
  392.    {
  393.      <operators>
  394.    }
  395.  
  396.   Example:
  397.  
  398.    SETUP:INIT
  399.    {
  400.      $104=InitValue
  401.    }
  402.  
  403.  
  404.   3) Function "<Dialog:Control>". The function is executed when the
  405.   button control with the corresponding ID is pushed.
  406.  
  407.    <DialogName>:<control>
  408.    {
  409.      <operators>
  410.    }
  411.  
  412.   Example:
  413.  
  414.    SETUP:$101
  415.    {
  416.      InitValue=$104
  417.      EndDialog
  418.      Dialog NEXT
  419.    }
  420.  
  421.  
  422.   3.7. Special dialogs
  423.  
  424.   There are special dialogs called by SFX under certain conditions.
  425.   These dialogs should be defined in the script, if processing of the
  426.   corresponding events is desired.
  427.  
  428.   Dialog name       Description
  429.   --------------------------------------------------------
  430.  
  431.   ASKVOLUME         Called when SFX cannot find the next volume.
  432.                     The %%A macros could be used to obtain the required
  433.                     volume name.
  434.  
  435.                     Possible actions:
  436.  
  437.                     - exit with EXIT operator;
  438.  
  439.                     - prompt the user to insert the volume and close the
  440.                       dialog with EndDialog. Then SFX will try opening
  441.                       the volume again;
  442.  
  443.                     - prompt the user to enter a new volume name, then
  444.                       set it with SetArcName and close the dialog with
  445.                       EndDialog. SFX will try opening the volume again.
  446.  
  447.   ERRARCHIVE        Called when the archive structure appears to be
  448.                     damaged. The %%A macros could be used to obtain the
  449.                     corresponding archive name.
  450.  
  451.                     Possible actions:
  452.  
  453.                     - exit with EXIT operator;
  454.  
  455.                     - close the dialog with EndDialog. Then SFX will try
  456.                       to continue execution.
  457.  
  458.   ERRCREATE         Called when SFX cannot create a file.
  459.                     The %%F macros could be used to obtain the
  460.                     corresponding file name.
  461.  
  462.                     Possible actions:
  463.  
  464.                     - exit with EXIT operator;
  465.  
  466.                     - close the dialog with EndDialog. Then SFX will
  467.                       continue execution.
  468.  
  469.   ERRCRC            Called when the file CRC is corrupted.
  470.                     The %%F macros could be used to obtain the
  471.                     corresponding file name.
  472.  
  473.                     Possible actions:
  474.  
  475.                     - exit with EXIT operator;
  476.  
  477.                     - close the dialog with EndDialog. Then SFX will
  478.                       continue execution.
  479.  
  480.   ERRWRITE          Called in case of a write error.
  481.  
  482.                     Possible actions:
  483.  
  484.                     - exit with EXIT operator;
  485.  
  486.                     - close the dialog with EndDialog. Then SFX will retry
  487.                       write operation.
  488.  
  489.   ERRMEMORY         Called when there is not enough memory.
  490.  
  491.                     Possible actions:
  492.  
  493.                     - exit via EXIT operator
  494.  
  495.   4. The SFX icon
  496.  
  497.   The SFX icon could be placed as a resource named "SFX_ICON". It will be
  498.   assigned to the main SFX window.
  499.  
  500.