home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 January / Pcwk0198.iso / Warsztat / Compress / Wrar202 / wrar202.exe / SFX.txt < prev    next >
Encoding:
Text File  |  1997-08-06  |  12.0 KB  |  507 lines

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