home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 59 / af059sub.adf / install.lha / Installer1.24 / Installer.doc < prev    next >
Text File  |  1993-03-26  |  64KB  |  1,851 lines

  1.  
  2.         Installer.doc
  3.             Documentation for 1.24 Installer 
  4.             Last Revised: January 12th, 1993
  5.  
  6.  
  7. (C) Copyright 1991-93 Commodore-Amiga,Inc.  All Rights Resrved
  8.  
  9.  
  10. Contents:
  11.  
  12.     1 Background
  13.  
  14.     2 Overview
  15.       2.1  Standard Invocation
  16.       2.2  Initial Actions
  17.       2.3  Startup Screens
  18.       2.4  Installation Actions
  19.  
  20.     3 Scripting Language Tutorial
  21.       3.1  Basic Elements
  22.       3.2  Escape Characters
  23.       3.3  Symbols (Variables)
  24.       3.4  Types of Symbols
  25.       3.5  Statements
  26.       3.6  Data Types
  27.       3.7  Special Features
  28.       3.8  Miscellaneous
  29.  
  30.     4 Installer Language Reference
  31.       4.1  Notes
  32.       4.2  Statements
  33.       4.3  Control Statements
  34.       4.4  Debugging Statements
  35.       4.5  User-Defined Procedures
  36.       4.6  Functions
  37.       4.7  Summary of Parameters
  38.       4.8  Pre-Defined Variables
  39.  
  40.     5 Installer Language Quick Reference
  41.       5.1  Overview
  42.       5.2  Quick Language Overview
  43.       5.3  Pre-Defined Variables
  44.       5.4  Default Help String Variables
  45.       5.5  Statements
  46.       5.6  Functions
  47.  
  48.  
  49.                 Section 1: Background
  50.  
  51. Installation of applications from floppy disks onto a hard disk has proven to be
  52. a very inconsistent and often frustrating endeavor for most end-users.  This has
  53. been caused by many factors, some of which are:
  54.  
  55.     a. Many products do not come with any utility or script to install an
  56.        application on a hard disk.
  57.  
  58.     b. Many products assume a great deal of familiarity with the startup process
  59.        of the Amiga and applications, including assigns, device names (as
  60.        opposed to volume names), etc.
  61.  
  62.     c. The installation scripts or utilities included with some products vary
  63.        widely in their ability to deal with different environments and systems.
  64.  
  65. About a year ago, Commodore set out to remedy this situation, by developing a
  66. standard tool that developers can include with their products, which provides
  67. the user with a standard way to install applications.  The Installer's features
  68. were based on a number of assumptions:
  69.  
  70.     a. Installation requirements vary widely---some need assigns, some need new
  71.        drawers created, some install pieces in system drawers such as a fonts
  72.        drawer, a `product' might be just an upgrade and the installation must
  73.        check to see which version (if any) they currently have installed, etc.
  74.  
  75.     b. Different users have different levels of comfort and expertise when
  76.        attempting to install software, and the Installer should be able to
  77.        accommodate a range of users.  Many installation scripts assume a great
  78.        deal of knowledge, which is very intimidating for a novice.
  79.  
  80.     c. The installer tool must be very flexible internally, but present a
  81.        consistent pleasant graphical user interface to the user that only shows
  82.        the user information or prompts that they need to see.  The Installer
  83.        should be resolution, color and font sensitive.
  84.  
  85.     d. Writing scripts to install an application will require some effort, but
  86.        certainly no more than writing an AmigaDOS shell script equivalent, and
  87.        the resulting installation procedure will be more friendly, flexible, and
  88.        much better looking than the latter.
  89.  
  90.     e. Not everyone will be running 2.0 by the time the tool becomes available,
  91.        so it must run under 1.3 and 2.0.
  92.  
  93.  
  94.                 Section 2: Overview
  95.  
  96. The Installer is a script driven program, that presents a consistent
  97. installation environment to the end user.  The user never sees the script.
  98. Instead they are presented with simple yes/no choices, and may be asked to
  99. specify locations to put things on their system.
  100.  
  101. To accommodate different user levels, they can choose to run the tool in novice,
  102. average or expert modes.  Scripts can include help text to explain any choices
  103. that the user must make.  At each step the user is given the option of aborting
  104. the installation.
  105.  
  106.  
  107.  
  108.  
  109. 2.1  Standard Invocation
  110.  
  111. The Installer program requires a 10000 byte stack.  Project icons for Installer
  112. script should indicate a stack size of 10000.  If starting Installer from a CLI,
  113. first do a "Stack 10000".
  114.  
  115. The Installer is normally started up from a Workbench Project icon which has the
  116. same name as the script to interpret and has a default tool of Installer.
  117. A number of tooltypes are available to modify the operation of the Installer:
  118.  
  119.     SCRIPT - Path to a script file to be used with Installer.
  120.  
  121.     APPNAME - Name of the application being installed (appears in the startup
  122.               screen).  This MUST be given.
  123.  
  124.     MINUSER - The minimum possible operation mode of the installation for a
  125.               script.  This will be either NOVICE (all decisions made by
  126.               Installer), AVERAGE (only important decisions made by user) or
  127.               EXPERT (user confirms almost all actions).  The Default is NOVICE.
  128.  
  129.     DEFUSER - Indicates which operation mode button should be initially
  130.               selected.  Same values as MINUSER, with the value of the MINUSER
  131.               tooltype being the default (which will be NOVICE if MINUSER not
  132.               defined).
  133.  
  134.     NOPRINT - If set to FALSE, then the printer option in the  log file settings
  135.               will be ghosted.
  136.  
  137.     PRETEND - If set to FALSE, indicates that PRETEND mode not available for
  138.               this script.
  139.  
  140.     LANGUAGE - Used to set the variable @language (default for @language is
  141.                "english".  The use of this variable is left up to the install
  142.                script.
  143.  
  144.     LOGFILE - The name of the log file that the Installer should use.  This must
  145.               be a full path.  The default is "install_log_file".
  146.  
  147.     LOG - In NOVICE mode the default is to create a log file (to disk).  If this
  148.           tooltype is set to FALSE, the creation of a log file in NOVICE mode is
  149.           disabled.
  150.  
  151. Although the installer can be started up from the CLI, that is not the
  152. recommended mode.  CLI invocation is provided mainly for script debugging
  153. purposes.  The command template is:
  154.  
  155. SCRIPT/k,APPNAME,MINUSER,DEFUSER,LOGFILE,NOLOG/s,NOPRETEND/s,
  156. NOPRINT/s,LANGUAGE/k
  157.  
  158.  
  159.  
  160.  
  161. 2.2  Initial Actions
  162.  
  163. The first thing the installer does is compile the installation script into an
  164. internal format that can be easily interpreted.  If there are syntax errors in
  165. the script, they will be caught during this phase.
  166.  
  167.  
  168.  
  169.  
  170. 2.3  Startup Screens
  171.  
  172. Next, the Installer asks the user what Installation Mode to run in, either
  173. NOVICE, AVERAGE or EXPERT.  If the user chooses NOVICE, they will not be asked
  174. any more questions (although they may be requested to do things).  In the other
  175. user levels, a second display appears asking the user if he wants to install
  176. "for real" or "do a dry run", and if he wants a transcription of the
  177. installation process written to either a file or printer.
  178.  
  179.  
  180.  
  181.  
  182. 2.4  Installation Actions
  183.  
  184. Now the Installer interprets its internal version of the script.  Any commands
  185. that call for a user interface will cause the Installer to algorithmically
  186. generate a display, always including buttons to allow for context sensitive help
  187. and aborting the installation. 
  188.  
  189.  
  190.             Section 3: Scripting Language Tutorial
  191.  
  192. The script language of the Installer is based on LISP.  It is not difficult to
  193. learn, but requires a lot of parentheses.  An Installer script can easily be
  194. made to look very readable.
  195.  
  196.  
  197.  
  198.  
  199. 3.1  Basic Elements
  200.  
  201. The basic elements of the installer language are:
  202.  
  203.     Type                  Example
  204.     ----                  -------
  205.     decimal integers      5
  206.     hexadecimal integers  $a000
  207.     binary integers       %0010010
  208.     strings               "Hello" or 'Hello'
  209.     symbols               x
  210.     comments              ; this is a comment
  211.     ( )                   for statement definition
  212.     space                 delimits symbols
  213.      (or any white space)
  214.  
  215.  
  216.  
  217.  
  218. 3.2  Escape Characters
  219.  
  220. Escape characters are supported as in the C language:
  221.  
  222.     Escape
  223.     sequence  Produces
  224.     --------  --------
  225.     '\n'      newline character
  226.     '\r'      return character
  227.     '\t'      tab character
  228.     '\0'      a NUL character
  229.     '\"'      a double-quote
  230.     '\\'      a backslash
  231.  
  232.  
  233.  
  234.  
  235. 3.3  Symbols (Variables)
  236.  
  237. A symbol is any sequence of characters surrounded by spaces that is not a quoted
  238. string, an integer or a control character.  This means that symbols can have
  239. punctuation marks and other special characters in them.  The following are all
  240. valid symbols:
  241.  
  242.     x
  243.     total
  244.     this-is-a-symbol
  245.     **name**
  246.     @#__#@
  247.  
  248.  
  249.  
  250.  
  251. 3.4  Types of Symbols
  252.  
  253. There are three types of symbols:
  254.  
  255.     a. user-defined symbols.  These are created using the "set" function.
  256.  
  257.     b. built-in function names.  These include things like '+' and '*' as well
  258.        as textual names such as "delete" or "rename".
  259.  
  260.     c. special symbols.  These are variables which are created by the installer
  261.       before the script actually starts to run, and are used to tell the script
  262.       certain things about the environment. These symbols always begin with an
  263.       '@' sign.  An example is '@default-dest' which tells you the default
  264.       directory that was selected by the installer.
  265.  
  266.  
  267.  
  268.  
  269. 3.5  Statements
  270.  
  271. The format of a statement is:
  272.  
  273.     (operator <operand1> <operand2> ...)
  274.  
  275. A statement to assign the value '5' to the variable 'x' would be:
  276.  
  277.     (set x 5)
  278.  
  279. You can read this as "set x to 5".  Note that the variable 'x' does not have to
  280. be declared -- it is created by this statement.
  281.  
  282. Note that there is no difference between operators and functions -- the function
  283. 'set' and the arithmetic operator '+' are both used exactly the same way.
  284.  
  285. Combining statements: A statement can be used as the operand to another
  286. statement as follows:
  287.  
  288.     (set var (+ 3 5))
  289.  
  290. In this case, the statement '(+ 3 5)' is evaluated first, and the result is 8.
  291. You can think of this as having the '(+ 3 5)' part being replaced by an 8.
  292. So now we are left with:
  293.  
  294.     (set var 8)
  295.  
  296. which is the same form as the first example.
  297.  
  298. Note that the '(+ 3 5)' part actually produced a value: 8.  This is called the
  299. "result" of the statement.  Many statements return results, even some that might
  300. surprise you (such as "set" and "if").
  301.  
  302.  
  303.  
  304.  
  305. 3.6  Data Types
  306.  
  307. All data types in the installer are dynamic, that is to say the type of a
  308. variable is determined by the data that is in it.  So if you assign the string
  309. "Hello, World" to the variable 'x', then 'x' will be of type STRING.  Later you
  310. can assign an integer to 'x' and x will be of type INTEGER.  When using
  311. variables in expressions, the interpreter will attempt to convert to the proper
  312. type if possible.
  313.  
  314. Special forms: There are two exceptions to the form of a statement.  The first
  315. type is used for string substitution: If the first item in parentheses is a text
  316. string rather than a function name, the result of that clause is another string
  317. that is created by taking the original string and performing a "printf"-like
  318. formatting operation on it, using the other arguments of the statement as
  319. parameters to the formatting operation.
  320.  
  321. Thus the statement:
  322.  
  323.     ("My name is %s and I am %ld years old" "Mary" 5)
  324.  
  325. Becomes:
  326.  
  327.     "My name is Mary and I am 5 years old"
  328.  
  329. Note since the formatting operation uses the ROM "RawDoFmt" routine, decimal
  330. values must always be specified with "%ld" rather than "%d" (The interpreter
  331. always passes numeric quantities as longwords).  Note that a variable containing
  332. the string may be used rather than the string itself.
  333.  
  334. The second type of exception occurs if the elements in parentheses are
  335. themselves statements in parentheses.  In this case, the interpreter assumes
  336. that all the elements are statements to be executed sequentially.
  337.  
  338. For example, this statement sets the value of three different variables:
  339. "var1", "var2" and "var3".
  340.  
  341.     ((set var1 5) (set var2 6) (set var3 7))
  342.  
  343. What this feature does is allow the language to have a block structure, where an
  344. "if" statement can have multiple statements in its "then" or "else" clause.
  345. Note that the result of this statement will be the result of the last statement
  346. in the sequence.
  347.  
  348. Complex statements: Here is an example of how statements in the script language
  349. can be combined into complex expressions.  We will start with an "if" statement.
  350. The basic format of an "if" statement is:
  351.  
  352.     (if <condition> <then-statement> [<else-statement>])
  353.  
  354. The condition should be a statement which returns a value.  The "then" and
  355. optional "else" parts should be statements.  Note that if the "then" or "else"
  356. statements produce a result, then the "if" statement will also have this result.
  357.  
  358. Our first example is a rather strange one: Using an "if" statement to simulate
  359. a boolean "not" operator. (Note that there are easier ways in the script
  360. language to do this).
  361.  
  362.     (set flag 0)              ; set a flag to FALSE
  363.  
  364.     (set flag (if flag 0 1))  ; a Boolean NOT
  365.  
  366. Basically, the "if" statement tests the variable "flag".  If flag is non-zero,
  367. it produces the value "0".  Otherwise, the result is "1".  In either case,
  368. "flag" is set to the result of the "if" statement.
  369.  
  370. Now, let's plug some real statements into our "if" statement.
  371.  
  372.     (if flag                                ; conditional test
  373.         (message "'flag' was non-zero\n")   ; "then" clause.
  374.         (message "'flag' was zero\n")       ; "else" clause.
  375.     )                                       ; closing parenthesis
  376.  
  377. Note the style of the indenting.  This makes for an easier to read program.
  378.  
  379. Now, we'll add a real condition.  "=" tests for equality of the two items.
  380.  
  381.     (if (= a 2)                    ; conditional test
  382.         (message "a is 2\n")       ; "then" clause
  383.         (message "a is not 2\n")   ; "else" clause
  384.     )                              ; closing parenthesis
  385.  
  386. Finally, just to make things interesting, we'll make the "else" clause a
  387. compound statement.
  388.  
  389.     (if (= a 2)                           ; conditional test
  390.         (message "a is 2\n")              ; "then" clause
  391.         (    (message "a is not 2\n")      ; "else" compound statement
  392.             (set a 2)
  393.             (message "but it is now!\n")
  394.         )                                 ; end of compound statement
  395.     )                                     ; end of if
  396.  
  397.  
  398.  
  399.  
  400. 3.7  Special Features
  401.  
  402. When the Installer first starts up, it attempts to determine the "best" place to
  403. install the application.  Any volume named "WORK:" is given preference, as this
  404. is the standard way that an Amiga comes configured from Commodore.
  405.  
  406. There are two keyboard shortcuts.  Whenever there is a "Help" button active,
  407. pressing the HELP key will also bring up the help display.  Whenever there is an
  408. "Abort" button active, pressing ESC brings up the abort requester.  Also,
  409. whenever the installer is "busy", pressing ESC brings up the abort requester --
  410. there is text is the title bar to that effect.
  411.  
  412. If an application must have assigns or other actions performed during system
  413. boot, the Installer will add these to a file named "S:user-startup".
  414. The installer will then add the lines 
  415.  
  416.     if exists S:user-startup
  417.     execute S:user-startup
  418.     endif
  419.  
  420. to the user's "startup-sequence".  The Installer will attempt to determine the
  421. boot volume of the system when looking for the "startup-sequence" and can handle
  422. any AmigaDOS scripts executed from "startup-sequence" (up to 10 levels of
  423. nesting).
  424.  
  425. The Installer can create an assign to just a device, volume or logical
  426. assignment.  This comes in handy when you want to update an application which
  427. comes on a volume named "MyApp:", but the installed version is in a directory
  428. with the logical assign "MyApp:"!
  429.  
  430. The Installer always copies files in CLONE mode, meaning all the protection
  431. bits, filenotes and file dates are preserved.  When copying files the Installer
  432. gives a "fuelgauge" readout of the progress of the copy.
  433.  
  434. The Installer can find the version number of any executable file that has either
  435. a RomTag with an ID string (such as libraries and devices) or has a version
  436. string conforming to that given in the 1990 DevCon notes.  The Installer can
  437. also checksum files.  A separate utility named "instsum" is provided to
  438. determine a file's checksum for use with this feature.
  439.  
  440.  
  441.  
  442.  
  443. 3.8  Miscellaneous
  444.  
  445. To perform a set of actions on all the contents of a directory matching a
  446. pattern you can use the "foreach" operator.  To perform a set of actions on an
  447. explicit set of files, the following installer statements can be used as a
  448. template:
  449.  
  450.     (set n 0)
  451.     (while (set thisfile (select n "file1" "file2" "file3" ""))
  452.         (    (set n (+ n 1))
  453.             (... your stuff involving this file ...)
  454.         )
  455.     )
  456.  
  457. Note that an empty string is considered a FALSE value to any condition operator.
  458.  
  459. To run an external CLI command which normally requires user input, redirect the
  460. input from a file with the needed responses.  For example, to format a disk one
  461. could combine the statement shown below with a file which contains only a
  462. newline character.
  463.  
  464.     (run "format <nl_file drive DF0: name ToBeEmpty")
  465.  
  466.  
  467.             Section 4: Installer Language Reference
  468.  
  469.  
  470.  
  471.  
  472. 4.1  NOTES
  473.  
  474. a. When the script exits either by comming to the end or via the "exit"
  475. statement, a message will be displayed saying where the application was
  476. installed and where the logfile (if any) was written.  Note that you must store
  477. in "@default-dest" where you actually installed the application (see
  478. "@default-dest" below).
  479.  
  480. b. A newline character ('\n', 0x0a) will cause a line break when the installer
  481. performs word-wrapping.  A hard-space (ALT-space, 0xa0) will prevent a word
  482. break when the installer performs word-wrapping.  Also, quoted sections will be
  483. considered one word for word-wrapping purposes.  For example, if the following
  484. help text was used:
  485.  
  486.     "The disk name \"FrameZapper 2.0\" is needed to complete installation."
  487.  
  488. then the text "FrameZapper 2.0" will not have a word break before the "2".
  489.  
  490. c. The maximum size of a string in a script is 512 bytes.  The maximum size of
  491. any string variable is 10000 bytes.  If you need to create long help text for
  492. example, break it into 512 byte chunks and then use the automatic string
  493. concatenation ability of the installer to create the final, larger string.
  494. Also, don't overlook the the use of line continuation of strings in scripts
  495. to make your scripts more manageable.  If you ever find that the installer
  496. reports a stack overflow error, look to see if it caused by too many small
  497. strings being concatenated and merge them into larger blocks.
  498.  
  499. d. The "run" and "execute" statements only return the result of the command run
  500. or executed under 2.0; they always return 0 under 1.3.  If you must have some
  501. result under both 1.3 and 2.0, try this combo:
  502.  
  503.     # in the DOS script to execute:
  504.     failat 31
  505.     command
  506.     if error
  507.         setenv installer-result 10
  508.     else
  509.         if warn
  510.             setenv installer-result 5
  511.         else
  512.             setenv installer-result 0
  513.         endif
  514.     endif
  515.  
  516.     # in the installer script
  517.     (execute DOS-Script)
  518.     (set theResult (getenv "installer-result"))
  519.  
  520. e. Filename and directoryname wildcard patterns specified in a script must be no
  521. longer than 64 characters.
  522.  
  523.  
  524. 4.2  Statements
  525.  
  526. (set <varname> <value> [<varname2> <value2> ...])
  527.  
  528. Set the variable <varname> to the indicated value.  If <varname> does not exist
  529. it will be created.  Set returns the value of the last assignment.
  530.  
  531. Note: All variables are typeless, and any variable may be used wherever a string
  532. could be used.  All variables are global.
  533.  
  534. The "set" statement can be used to convert a string to an integer value:
  535.  
  536.     (set <integer-var> (+ <string-var>))
  537.  
  538. Use the "cat" statement to do the reverse.
  539.  
  540.  
  541. (makedir <name> <parameters>)
  542.  
  543. Creates a new directory.  Parameters:
  544.  
  545.     prompt - tell the user what's going to happen.
  546.     help - text of help message
  547.     infos - create an icon for directory
  548.     confirm - if this option is present, user will be prompted, else the
  549.               directory will be created silently.
  550.     safe - make directory even if in PRETEND mode
  551.  
  552.  
  553. (copyfiles <parameters>)
  554.  
  555. Copies one or more files from the install disk to a target directory.  Each file
  556. will be displayed with a checkmark next to the name indicating if the file
  557. should be copied or not.  Note that a write protected file is considered
  558. "delete protected" as well.  Parameters:
  559.  
  560.     prompt, help - as above
  561.     source - name of source directory or file
  562.     dest - name of destination directory, which is created if it doesn't exist
  563.            Note that both source and dest may be relative pathnames.
  564.     newname - if copying one file only, and file is to be renamed, this is the
  565.               new name
  566.     choices - a list of files/directories to be copied (optional)
  567.     all - all files/directories in the source directory should be copied
  568.     pattern - indicates that files/directories from the source dir matching a
  569.               pattern should be copied.  The pattern should be no more than 64
  570.               characters long.
  571.               Note that only one of "choices", "all" or "pattern" should be
  572.               used at any one time.
  573.     files - only copy files.  By default the installer will match and copy
  574.             subdirectories.
  575.     infos - switch to copy icons along with other files/directories
  576.     fonts - switch to not display ".font" files, yet still copy any that match
  577.             a directory that is being copied.
  578.     (optional <option> <option> ...) - dictates what will be considered a
  579.             failure on copying.
  580.             The first three options are mutually exclusive (they may not be
  581.             specified together).
  582.                 "fail" - installer aborts if could not copy (the default)
  583.                 "nofail" - installer continues if could not copy
  584.                 "oknodelete" - aborts if can't copy, unless reason was
  585.                                "delete protected"
  586.             The next two options may be used with any other "optional" options.
  587.                 "force" - unprotect destination
  588.                 "askuser" - ask user if the file should be unprotected (but not
  589.                             in novice)
  590.                 In the case of "askuser", the default for novice mode is an
  591.                 answer of "no".  Therefore, you may want to use "force" to make
  592.                 the novice mode default answer appear to be "yes".
  593.     (delopts <option> <option> ...) - removes options set by "optional"
  594.     confirm -  if this option is present, user will be prompted to indicate
  595.                which files are to be copied, else the files will be copied
  596.                silently.
  597.     safe - copy files even if in PRETEND mode.
  598.  
  599.  
  600. (copylib <parameters>)
  601.  
  602. Copies one file using version checking; i.e., it only overwrites an existing
  603. file if the new file has a higher version/revision number.  "Copylib" will
  604. create the destination directory as long as there is only one level missing.
  605. For example, copying to a non-existent "DEVS:midi" would create the directory
  606. "midi", but copying to "DEVS:midi/extra" where neither "midi" nor "extra" exists
  607. would fail.  Note that a write protected library file is considered "delete
  608. protected" as well.  Parameters:
  609.  
  610.     prompt, help - as above
  611.     source - name of source directory or file
  612.     dest - name of destination directory
  613.            Note that both source and dest may be relative pathnames.
  614.     newname - if copying one file only, and file is to be renamed,
  615.               this is the new name
  616.     infos - switch to copy icons along with other files
  617.     (optional <option> <option> ...) - dictates what will be considered a
  618.                                        failure on copying.
  619.         The first three options are mutually exclusive (they may not be
  620.             specified together).
  621.             "fail" - installer aborts if could not copy (the default)
  622.             "nofail" - installer continues if could not copy
  623.             "oknodelete" - aborts if can't copy, unless reason was
  624.                            "delete protected"
  625.         The next two options may be used with any other "optional" options.
  626.             "force" - unprotect destination
  627.             "askuser" - ask user if the file should be unprotected
  628.                         (but not in novice)
  629.             In the case of "askuser", the default for novice mode is an answer
  630.             of "no".  Therefore, you may want to use "force" to make the
  631.             novice mode default answer appear to be "yes".
  632.     (delopts <option> <option> ...) - removes options set by "optional"
  633.     confirm - user will be asked to confirm.  Note that an EXPERT user
  634.               will be able to overwrite a newer file with an older one.
  635.     safe - copy the file even if in PRETEND mode
  636.  
  637.  
  638. (startup <appname> <parameters>)
  639.  
  640. This command edits the "S:user-startup" file, which is executed by the user's
  641. startup-sequence (Installer will modify the user's startup- sequence if needed,
  642. although in a friendly way).  The "command" parameter is used to declare
  643. AmigaDOS command lines which will be executed.  The command lines are grouped by
  644. application, using the supplied argument "appname".  If there is already an
  645. entry in "S:user-startup" for that application, the new command lines will
  646. completely replace the old.  The command lines for other applications will not
  647. be affected.  Note: The prompt and help parameters for the "startup" statement
  648. are only used by the confirmation display to edit "user-startup".  This only
  649. happens in EXPERT mode.  Parameters:
  650.  
  651.     prompt, help - as above
  652.     command - used to declare an AmigaDOS command line to be
  653.               executed at system startup.
  654.  
  655.  
  656. (tooltype <parameters>)
  657.  
  658. Modify an icon's tool type.  Normally the new tool type values will be set up
  659. in advance by various statements in the install language (i.e. the user does
  660. not actually have to type in the tooltype values).  For example, you could use
  661. an "askchoice" to ask the user what type of screen resolution they want and
  662. then format the tooltype string based on their choice.  The "tooltype"
  663. operation merely asks for a confirmation before actually writing.  Parameters:
  664.  
  665.     prompt, help - as above
  666.     dest - the icon to be modified
  667.     settooltype - the tooltype name and value string.
  668.     setdefaulttool - default tool for a project
  669.     setstack - set size of stack
  670.     noposition - reset to NOICONPOSITION
  671.     swapcolors - swap first two planes of icon's image if OS rev less than v36
  672.     confirm - if this option is present, the user will be asked for
  673.               confirmation, otherwise the modification proceeds
  674.               silently.
  675.     safe - make changes even if in PRETEND mode
  676.  
  677.  
  678. (textfile <parameters>)
  679.  
  680. Creates a text file from other textfiles or computed text strings.  This can be
  681. used to create configuration files, AREXX programs or execute scripts.
  682. Parameters:
  683.  
  684.     help, prompt - as above
  685.     dest - the name of the text file to be created.
  686.     append - a string to be appended to the new text file.
  687.     include - a text file to be appended to the new text file.
  688.     confirm - if this option is present, the user will be asked for
  689.     confirmation, otherwise the writing proceeds silently.
  690.     safe - create file even if in PRETEND mode
  691.  
  692.  
  693. (execute <argument> ...)
  694.  
  695. Executes an AmigaDOS script with the arguments given.  NOTE: Does not ask user
  696. for confirmation, however this can be added by using "askchoice" or "askbool".
  697. Parameters:
  698.  
  699.     help, prompt - as above
  700.     confirm - if this option is present, the user will be asked for
  701.               confirmation, otherwise the execute proceeds silently.
  702.     safe - execute script even if in PRETEND mode
  703.  
  704. Returns a result if executed under 2.0.  Returns 0 under 1.3.  See NOTES for
  705. workarounds under 1.3.
  706.  
  707.  
  708. (run <argument> ...)
  709.  
  710. Executes a compiled program with the arguments given.  NOTE: Does not ask user
  711. for confirmation, however this can be added by using "askchoice" or "askbool".
  712. Parameters:
  713.  
  714.     help, prompt - as above
  715.     confirm - if this option is present, the user will be asked for
  716.               confirmation, otherwise the run proceeds silently.
  717.     safe - run program even if in PRETEND mode
  718.  
  719. Returns a result is executed under 2.0.  Returns 0 under 1.3.  See NOTES for
  720. workarounds under 1.3.
  721.  
  722.  
  723. (rexx <argument> ...)
  724.  
  725. Executes an ARexx script with the arguments given.  NOTE: Does not ask user for
  726. confirmation, however this can be added by using "askchoice" or "askbool".
  727. If the ARexx server is not active, an error will be generated.  Parameters:
  728.  
  729.     help, prompt - as above
  730.     confirm - if this option is present, the user will be asked for
  731.     confirmation, otherwise the rexx script proceeds silently.
  732.     safe - execute script even if in PRETEND mode
  733.  
  734.  
  735. (makeassign <assign> [<path>] (parameters))
  736.  
  737. Assigns 'assign' to 'path'.  If 'path' is not specified, the assignment is
  738. cleared.  Parameters:
  739.  
  740.     safe - assign even if in PRETEND mode
  741.  
  742. Note: assign must be supplied without a colon; i.e. "ENV" not "ENV:".
  743.  
  744.  
  745. (rename <oldname> <newname> <parameters>)
  746.  
  747. Renames a file or directory.  If the "disk" parameter is given, then this
  748. command relabels the disk named oldname to newname.  When relabeling a disk,
  749. ONLY include a colon in the oldname.  Returns 1 if the rename was successful,
  750. 0 if it failed.  Parameters:
  751.  
  752.     help, prompt - as above
  753.     confirm - if this option is present, the user will be asked for
  754.               confirmation, otherwise the rename proceeds silently.
  755.     disk - switch to get rename to relabel a disk.
  756.     safe - rename even if in PRETEND mode
  757.  
  758.  
  759. (delete <file> <parameters>)
  760.  
  761. Delete a file.  Note that a write protected file is considered "delete
  762. protected" as well.  Parameters:
  763.  
  764.     help, prompt - as above
  765.     confirm - if this option is present, the user will be asked for
  766.               confirmation, otherwise the delete proceeds silently.
  767.     (optional <option> <option> ...) - should deletions be forced.
  768.         options:
  769.             "force" - unprotect destination
  770.             "askuser" - ask user if the file should be unprotected
  771.                         (but not in novice)
  772.             In the case of "askuser", the default for novice mode is an answer
  773.             of "no".  Therefore, you may want to use "force" to make the
  774.             novice mode default answer appear to be "yes".
  775.     (delopts <option> <option> ...) - removes options set by "optional"
  776.     safe - delete even if in PRETEND mode
  777.  
  778.  
  779. (protect <file> [<string of flags to change>] [<decimal mask>] <parameters>)
  780.  
  781. Either gets the protection status of a file (if a second argument is not
  782. given), or sets it.  Two methods exist for setting the status: string
  783. (e.g. "+r -w +e -d") or numeric (e.g. 5).  The string method allows the
  784. changing of any of the flags individually, while numeric writes to all flags at
  785. once (possibly changing bits unintendedly).  The bits in the binary
  786. representation of the decimal mask correspond to the flags in the following
  787. manner:
  788.  
  789. 8 7 6 5 4 3 2 1  <- Bit number
  790.  
  791. h s p a r w e d  <- corresponding protection flag
  792.  
  793. ^ ^ ^ ^ ^ ^ ^ ^
  794. | | | | | | | |
  795. | | | | | | | +- \
  796. | | | | | | +--- | 0 = flag set
  797. | | | | | +----- | 1 = flag clear
  798. | | | | +------- /
  799. | | | | 
  800. | | | |
  801. | | | +--------- \
  802. | | +----------- | 0 = flag clear
  803. | +------------- | 1 = flag set
  804. +--------------- /
  805.  
  806. Note that the meaning of the bits in the numeric value follows the DOS
  807. convention that a 1 in the high four bits (flags "hspa") indicates that the
  808. flag is set, while a 1 in the lower four bits (flags "rwed") indicates that
  809. the flag is cleared.
  810.  
  811. When setting bits, "protect" returns 1 if the attempt succeeded, else it
  812. returns a 0.  Getting the bits returns either the numeric value of the
  813. protection status (see interpretation, above) or -1 upon failure.  Parameters:
  814.  
  815.     safe - change protection even if in PRETEND mode
  816.  
  817.  
  818. (abort <message> <message> ...)
  819.  
  820. Exits the installation procedure with the given messages and then processes the
  821. onerror statements (if any).
  822.  
  823.  
  824. (exit <string> <string> ... (quiet))
  825.  
  826. This causes normal termination of a script.  If strings are provided, they are
  827. displayed.  The "done with installation" message is then displayed.  The
  828. "onerror" statements are not executed.  If (quiet) is specified, the final
  829. report display is skipped.
  830.  
  831.  
  832. (complete <number>)
  833.  
  834. This statement is used to inform the user how complete the installation is.
  835. The number (which must be between 0 and 100) will be printed in the title bar
  836. of the installer window with a '%' sign.
  837.  
  838.  
  839. (message <string> <string> ...)
  840.  
  841. This statement displays a message to the user in a window, along with Proceed,
  842. Abort and optional Help buttons.  Note that messages are not printed when
  843. running at user level 0 (novice).  Parameters:
  844.  
  845.     help - optional help text
  846.  
  847.  
  848. (working <string> <string> ...)
  849.  
  850. The strings will be concatenated to form a message which will appear below a
  851. standard line that reads "Working on Installation".  Useful if you are doing a
  852. long operation other than file copying (which has its own status display).
  853.  
  854.  
  855. (welcome <string> <string> ...)
  856. Installer looks for the occurrence of this statement in a script file during
  857. compilation.  If it does not exist (as is the case for older scripts) the
  858. "Welcome to the <APPNAME> App installation utility" display is presented to the
  859. user as soon as compilation has finished. If this statement is present,
  860. Installer will not put up the "Welcome..." display until the (welcome)
  861. statement is reached.  This allows for the execution of code before the first
  862. displays come up.  Note that the state of the "@user-level" and "@pretend"
  863. variables will be based on the initial defaults including any modification by
  864. tooltypes.  The string arguments are prepended to the standard help text for
  865. whichever of the two initial displays appears first.
  866.  
  867.  
  868. 4.3  Control Statements
  869.  
  870. NOTE: Strings can be used as the result of a test expression.  An empty string
  871. is considered a FALSE value, all others are considered TRUE.
  872.  
  873. (if <expression> <true-statement> <false-statement>)
  874.  
  875. Operates as a standard "if-then" statement.
  876.  
  877.  
  878. (while <expression> <statement> ... )
  879.  
  880. Operates as a standard "do-while" statement.
  881.  
  882.  
  883. (until <expression> <statement> ... )
  884.  
  885. Operates as a standard "do-until" statement.
  886.  
  887.  
  888. (foreach <drawer name> <pattern> <statement>)
  889.  
  890. For each file or directory matching the pattern located in the given drawer
  891. statement will be executed.  The special variables "@each-name" and
  892. "@each-type" will contain the filename and the DOS object type, respectively.
  893. (By DOS object type we mean the same value as found in fib_DirEntryType if one
  894. were to "Examine" the object.) Patterns specified in a script must be no longer
  895. than 64 characters.
  896.  
  897.  
  898. ((...) (...) (...))
  899.  
  900. Execute a sequence of statements.  The statements in the parentheses will be
  901. executed in order -- not needed at topmost level.
  902.  
  903.  
  904. (trap <trapflags> <statements>)
  905.  
  906. Used for catching errors.  Works much like C "longjmp", i.e.  when an error
  907. occurs, control is passed to the statement after "trap".  "Trapflags" determine
  908. which errors are trapped.  The trap statement itself returns the error type or
  909. zero if no error occurred.  The current error type values are:
  910.  
  911.     1 - user aborted
  912.     2 - ran out of memory
  913.     3 - error in script
  914.     4 - DOS error (see @ioerr below)
  915.     5 - bad parameter data
  916.  
  917.  
  918. (onerror <statements>)
  919.  
  920. When a fatal error occurs that was not trapped, a set of statements can be
  921. called to clean-up after the script.  These statements are logged in by using
  922. the onerror construct.  Note that onerror can be used multiple times to allow
  923. context sensitive termination.
  924.  
  925.  
  926. (select <n> <item1> <item2> ...)
  927. Only the selected element will be evaluated.  In this manner, "select" can be
  928. used as a case select construct.
  929.  
  930.  
  931. 4.4  Debugging Statements
  932.  
  933. (user <user-level>)
  934.  
  935. Used to change the user level of the current installation.  This statement
  936. should ONLY be used when debugging scripts.  Remove such statements from any
  937. script before distribution of your product.  Returns the current user level.
  938.  
  939.  
  940. (debug <anything> <anything> ...)
  941.  
  942. When the Installer is run from a CLI, "debug" will print the values of the
  943. parameters with a space between each parameter.  For example, the statements
  944.  
  945.     (set myvar 2)
  946.     (debug "This value of 'myvar' is" myvar)
  947.  
  948. will print "This value of myvar is 2".  If the parameter is an uninitialized
  949. variable, then debug will print "<NIL>" as its value.
  950.  
  951.  
  952.  
  953.  
  954. 4.5  User-Defined Procedures
  955. The Installer has user-defined procedures (subroutines).  This functionality
  956. is currently very primative.  There are no local variables.  To define a new
  957. procedure, use the "procedure" command:
  958.  
  959.     (procedure <procedure-name> <statement>)
  960.  
  961. You can then call the procedure like so:
  962.  
  963.     (<procedure-name>)
  964.  
  965. Note that <procedure-name> is not a string, just a symbolic name.
  966.  
  967.  
  968. 4.6  Functions
  969.  
  970.  
  971. (<string> <arguments> ...)
  972.  
  973. The "string substitution function".  Whenever a text string is the first item
  974. in a parenthesized group, the arguments will be substituted into the string
  975. using RawDoFmt.  Note: This function does no argument type checking.
  976.  
  977.  
  978. (cat <string> <string> ...)
  979.  
  980. Concatenates the strings and returns the resulting string.
  981.  
  982. To convert an integer to a string, use the "cat" function.  All integer
  983. arguments to "cat" are converted to strings during concatenation.  Use the
  984. "set" statement to convert a string to an integer.
  985.  
  986.  
  987. (substr <string> <start> [<count>])
  988.  
  989. Returns a substring of <string>, beginning with the character at offset <start>
  990. (offset begins with 0 for the first character) and including <count> characters.
  991. If <count> is omitted, the rest of the string (to its end) is returned.
  992.  
  993.  
  994. (strlen <string>)
  995.  
  996. Returns the length of the given string.
  997.  
  998.  
  999. (transcript <string> <string> ...)
  1000.  
  1001. Concatenates the strings, appends a newline and then prints the resulting
  1002. string to the transcript file (if any).
  1003.  
  1004.  
  1005. (tackon <path> <file>)
  1006.  
  1007. Concatenates the filename to the pathname and returns resulting string.
  1008. Currently, "tackon" cannot deal with a leading '/' in the <file> parameter.
  1009. This may be fixed in a future version.
  1010.  
  1011.  
  1012. (fileonly <path>)
  1013.  
  1014. Returns only the file part of a pathname.
  1015.  
  1016.  
  1017. (pathonly <path>)
  1018.  
  1019. Returns only the non-file part of a pathname.
  1020.  
  1021.  
  1022. (expandpath <path>)
  1023.  
  1024. Returns the full path, given a shortened path.  For example, it might expand
  1025. "SYS:c" to "System2.x:c".
  1026.  
  1027.  
  1028. (askdir <parameters>)
  1029.  
  1030. Asks the user for a directory name, with a scrolling list requester.  The user
  1031. can either create a new directory or specify an existing one.  If the user
  1032. cancels, the routine will cause an abort.  NOTE: It is always best to first
  1033. insure that the volume you want is mounted by using the "askdisk" command.
  1034. Parameters:
  1035.  
  1036.     prompt, help - as above
  1037.     default - default name of directory to be selected.  Note that this may be
  1038.               a relative pathname.
  1039.     newpath - allows non-existent paths to be supplied as the default drawer.
  1040.     disk - show drive list first.
  1041.     assigns - debugging parameter; indicates that logical assigns should
  1042.               satisfy requests as well.  Remove this parameter before
  1043.               distributing disk.
  1044.  
  1045.  
  1046.  
  1047. (askfile <parameters>)
  1048.  
  1049. Asks the user for a file name, with a scrolling list requester.  The default
  1050. path can be either reference a file or a drawer.  If a file, the filename
  1051. gadget is filled in.  Parameters:
  1052.  
  1053.     prompt, help - as above
  1054.     newpath - allows non-existent paths to be supplied as the default drawer.
  1055.     disk - show drive list first.
  1056.     default - default name of file to be selected  Note that this may be
  1057.               a relative pathname.
  1058.  
  1059.  
  1060. (askstring <parameters>)
  1061.  
  1062. Prompts the user to enter a text string.  Parameters:
  1063.  
  1064.     prompt, help - as above
  1065.     default - the default text string.
  1066.  
  1067.  
  1068. (asknumber <parameters>)
  1069.  
  1070. Prompts the user to enter an integer quantity.  Prints the allowed range below
  1071. the integer gadget if the "range" parameter is given, and prevents the user
  1072. from proceeding without entering a valid number.  Parameters:
  1073.  
  1074.     prompt, help - as above
  1075.     range - valid input range of numbers
  1076.     default - default value
  1077.  
  1078.  
  1079. (askchoice <parameters>)
  1080.  
  1081. Ask the user to select one out of N choices, using radio buttons.  Parameters:
  1082.  
  1083.     prompt, help - as above
  1084.     choices - a list of choice strings, such as "ok" "cancel", etc.
  1085.     default - the number of the default choice (defaults to 0)
  1086.  
  1087.  
  1088. (askoptions <parameters>)
  1089.  
  1090. Ask the user to select any number of N choices, using checkbox buttons.  A bit
  1091. mask is returned as a result, with the first bit indicating the state of the
  1092. first choice, etc.  Parameters:
  1093.  
  1094.     prompt, help - as above
  1095.     choices - a list of choice strings, such as "ok" "cancel", etc.
  1096.     default - a bit mask of the buttons to be checked (defaults to -1)
  1097.  
  1098.  
  1099. (askbool <parameters>)
  1100.  
  1101. Ask the user to select yes or no.  Parameters:
  1102.  
  1103.     prompt, help - as above
  1104.     default - 0 = no, 1 = yes
  1105.         choices - change the positive and negative text.  The defaults are
  1106.         "Yes" and "No".  So to change the text to "Proceed" and "Cancel"
  1107.         you would use: (choices "Proceed" "Cancel")
  1108.  
  1109.  
  1110. (askdisk <parameters>)
  1111.  
  1112. Ask the user to insert a disk in a user friendly manner.  For instance, the
  1113. prompt can describe the disk by its label; e.g. "FooBar Program Disk".  This
  1114. function will not exit until the correct disk is inserted, or the user aborts.
  1115.  
  1116.     prompt, help - as above
  1117.         dest - the volume name of the disk to be inserted
  1118.     newname - a name to assign to the disk for future reference.
  1119.               This assignment is done even in Dry Run mode -- it is considered
  1120.               "safe" disk - switch to get a drive list to be shown initially.
  1121.     assigns - Debugging option; this indicates that logical assigns should
  1122.               satisfy the request as well.  Remove this parameter before
  1123.               distributing disk.
  1124.     Note: volume name must be supplied without a colon; i.e. "ENV" not "ENV:".
  1125.  
  1126.  
  1127. (exists <filename> (noreq))
  1128.  
  1129. Returns 0 if does not exists, 1 if a file, and 2 if a directory.  If noreq is
  1130. specified, no requester is displayed if the path given is not on a mounted
  1131. volume.  In this case the result is 0.
  1132.  
  1133.  
  1134. (earlier <file-1> <file-2>)
  1135.  
  1136. Returns TRUE if file-1 is earlier than file-2.
  1137.  
  1138.  
  1139. (getsize <filename>)
  1140.  
  1141. Returns the size of a file.
  1142.  
  1143.  
  1144. (getdevice <path>)
  1145.  
  1146. returns the name of the device upon which <path> resides. For example,
  1147. "c:mount" as a path might return "WB_2.x".
  1148.  
  1149.  
  1150. (getdiskspace <pathname>)
  1151.  
  1152. Returns the available space in bytes on the disk given by pathname.  Returns -1
  1153. if the pathname is bad or information could not be obtained from the filesystem
  1154. (even though pathname was valid).
  1155.  
  1156.  
  1157. (getsum <filename>)
  1158.  
  1159. Returns the checksum of a file, for comparing versions.
  1160.  
  1161.  
  1162. (getversion <filename> (resident))
  1163.  
  1164. If the named file has a RomTag with an ID string or a 2.x version string, this
  1165. will return the version number.  If filename is not provided, then the version
  1166. of the OS is returned instead.  Note that this function does NOT assume files
  1167. ending with ".library" or ".device" reside in a particular place -- the path
  1168. must be included. If "resident" is specified, attempts to return version of
  1169. library or device in memory.  For example:
  1170.  
  1171.     (getversion "intuition.library" (resident))
  1172.  
  1173. would return the version/revision of intuition.  Note that using the "resident"
  1174. parameter causes first the library and then the device list to be checked.
  1175.  
  1176. The version number is returned as a 32 bit value, where the high order 16 bit
  1177. word is the version and the low order word is the revision.  Here is some sample
  1178. statements to parse a version number:
  1179.  
  1180. (set vernum (getversion "c:iconx"))
  1181. (set ver (/ vernum 65536))
  1182. (set rev (- vernum (* ver 65536) ) )
  1183.  
  1184. (message
  1185.         ("You have version %ld.%ld" ver rev)
  1186. )
  1187.  
  1188.  
  1189. (getenv <name>)
  1190.  
  1191. Returns the contents of the given ENV: variable.
  1192.  
  1193.  
  1194. (getassign <name> <opts>)
  1195.  
  1196. Returns the pathname of the object 'name'.  The default is for logical
  1197. assignments only, but can be changed using an options string where the
  1198. characters are:
  1199.  
  1200.     'v' - only match volumes
  1201.     'a' - only match logical assignments
  1202.     'd' - only match devices
  1203.  
  1204. Therefore 'a' would be equivalent to having no options.  Returns an empty string
  1205. on failure.
  1206.  
  1207. Notes: Name must be supplied without a colon; i.e. "ENV" not "ENV:".  A variable
  1208.        previously set to name may be used in place of name.  If a device name is
  1209.        used as the name and the search is limited to devices, then "getassign"
  1210.        will return the device or volume name if the device exists, otherwise it
  1211.        will return an empty string. An example usage would be
  1212.        (getassign "df1" "d").
  1213.  
  1214.  
  1215. (database <feature>)
  1216.  
  1217. Returns information about the Amiga that the Installer is running on.  "Feature"
  1218. is a string.  This function always returns a string result, even if the result
  1219. looks like a number.  If the feature requested is not recognized, the function
  1220. returns "unknown".  The currently understood features and their possible values
  1221. are:
  1222.  
  1223.     "vblank": "50", "60"
  1224.     "cpu": "68000", "68010", "68020", "68030", "68040"
  1225.     "graphics-mem": [returns a string representing the amount of free
  1226.                     graphics memory]
  1227.     "total-mem": [returns a string representing the total amount of
  1228.                  free memory]
  1229.  
  1230.  
  1231. (select <n> <item1> <item2> ...)
  1232.  
  1233. Returns the value of the Nth item.
  1234.  
  1235.  
  1236. (patmatch <pattern> <string>)
  1237. Determines if a string matches an AmigaDOS pattern.  Returns either TRUE or
  1238. FALSE.
  1239.  
  1240.  
  1241. (=  <expression-1> <expression-2>)
  1242. (>  <expression-1> <expression-2>)
  1243. (>= <expression-1> <expression-2>)
  1244. (<  <expression-1> <expression-2>)
  1245. (<= <expression-1> <expression-2>)
  1246. (<> <expression-1> <expression-2>)
  1247.  
  1248. These are the standard relational expressions.
  1249.  
  1250.  
  1251. (+  <expression> ...)
  1252.  
  1253. Returns the sum of all the arguments.
  1254.  
  1255.  
  1256. (-  <expression-1> <expression-2>)
  1257.  
  1258. Returns the first argument minus the second argument
  1259.  
  1260.  
  1261. (* <expression> ...)
  1262.  
  1263. Returns the product of all the arguments
  1264.  
  1265.  
  1266. (/  <expression-1> <expression-2>)
  1267.  
  1268. Returns the first argument divided by the second argument
  1269.  
  1270.  
  1271. (AND <expression-1> <expression-2>)
  1272. (OR  <expression-1> <expression-2>)
  1273. (XOR <expression-1> <expression-2>)
  1274. (NOT <expression>)
  1275.  
  1276. Standard logical functions
  1277.  
  1278.  
  1279. (BITAND <expression-1> <expression-2>)
  1280. (BITOR  <expression-1> <expression-2>)
  1281. (BITXOR <expression-1> <expression-2>)
  1282. (BITNOT <expression>)
  1283.  
  1284. Bitwise versions of the standard logical functions
  1285.  
  1286.  
  1287. (shiftleft <number> <amount to shift>)
  1288. (shiftrght <number> <amount to shift>)
  1289.  
  1290. These functions perform a bit-oriented shift by the amount specified.  Zeros
  1291. are shifted in on the opposite side.
  1292.  
  1293.  
  1294. (IN  <expression> <bit number-1> ...)
  1295.  
  1296. Returns 0 if none of the given bit numbers (starting at 0 for the LSB) is set
  1297. in the result of expression, else returns a mask of the bits that were set.
  1298.  
  1299.  
  1300. 4.7  Summary of Parameters
  1301.  
  1302.  
  1303. (assigns)
  1304.  
  1305. A debug option used in the "askdisk" statement to indicate that logical assigns
  1306. will match the askdisk request as well.  This parameter should not be used for
  1307. final disks, only for debugging.
  1308.  
  1309.  
  1310. (help <string-1> <string-2> ...)
  1311.  
  1312. This is used to specify the help text for each action.
  1313.  
  1314.  
  1315. (prompt <string-1> <string-2> ...)
  1316.  
  1317. This is used to provide the "title" of the screen which explains to the user
  1318. what this step does.
  1319.  
  1320.  
  1321. (safe)
  1322.  
  1323.     This tells the installer that an action not normally performed in Pretend
  1324. mode should be performed.
  1325.  
  1326.  
  1327. (choices <string-1> <string-2> ...)
  1328.  
  1329. Used to display a series of checkmarks.  This is used in the "askchoice"
  1330. function to indicate what choices the user has.  It can also be used in the
  1331. "copyfiles" statement to specify that only certain files can be copied. (If
  1332. absent, some other criterion will be used to determine which files to copy).
  1333.  
  1334.  
  1335. (pattern <string>)
  1336.  
  1337. Used in the "copyfiles" statement to specify a wildcard pattern.
  1338.  
  1339.  
  1340. (all)
  1341.  
  1342. In the "copyfiles" statement, specifies that all files are to be copied.
  1343.  
  1344.  
  1345. (source <filename>)
  1346.  
  1347. Specifies the file or directory to be read as part of this command.
  1348.  
  1349.  
  1350. (dest <filename>)
  1351.  
  1352. Specifies the file or directory to be modified as part of the command.
  1353.  
  1354.  
  1355. (newname <name>)
  1356.  
  1357. Used in "copyfiles" to specify that a file will have a new name after being
  1358. copied.  Used in "askdisk" to assign the new name to the inserted disk. Used in 
  1359. "copylib" to specify that the library will have a new name after being copied.
  1360.  
  1361.  
  1362. (newpath)
  1363.  
  1364. Used by "askdir" and "askfile" to allows non-existent paths to be supplied as
  1365. the default drawer.
  1366.  
  1367.  
  1368. (confirm <user-level>)
  1369.  
  1370. On some statements, the user will only be informed of the action (and allowed to
  1371. cancel it) if the "confirm" option is specified.  The user level can be "expert"
  1372. or "average" ("expert" is the default).
  1373.  
  1374.  
  1375. (infos)
  1376.  
  1377. Indicates to the "copyfiles" statement that accompanying ".info" files are to be
  1378. copied as well.  If the destination drawer does not exist, a default icon will
  1379. be made for the drawer the Installer creates.
  1380.  
  1381.  
  1382. (fonts)
  1383.  
  1384. Indicates to the "copyfiles" statement that accompanying ".font" files are to be
  1385. copied as well.
  1386.  
  1387.  
  1388. (optional <option> <option> ...)
  1389.  
  1390. Indicates to the "copyfiles" and "copylib" statements that it is not a fatal
  1391. error to have a copy fail.  Used for "delete" to indicate if deletion should be
  1392. "forced".
  1393.  
  1394.  
  1395. (delopts <option> <option> ...)
  1396.  
  1397. Indicates to the "copyfiles", "copylib" and "delete" statements that the listed
  1398. options should be _removed_ from the global internal list of options for this
  1399. statement.  The default global option is "fail".
  1400.  
  1401.  
  1402. (nogauge)
  1403. When used with the "copyfiles" and "copylib" statements this disables the copy
  1404. status indicator.
  1405.  
  1406.  
  1407. (settooltype <tooltype> <value>)
  1408.  
  1409. Used to modify a tooltype to a certain value.  If the tooltype does not exist
  1410. it will be created; if the <values> parameter is omitted, the tooltype will be
  1411. deleted.  A tooltype without a value may be added in the following manner:
  1412.  
  1413.     (settooltype <tooltype-string> "")
  1414.  
  1415. Remember that (tooltype <tooltype-string>) deletes the tooltype given.
  1416.  
  1417.  
  1418. (setdefaulttool <value>)
  1419.  
  1420. Used to modify the default tool of an icon.
  1421.  
  1422.  
  1423. (setstack <value>)
  1424.  
  1425. Used to modify the stack size included in an icon.
  1426.  
  1427.  
  1428. (noposition)
  1429.  
  1430. Used to modify the positioning of an icon to NO_ICON_POSITION.
  1431.  
  1432.  
  1433. (swapcolors)
  1434.  
  1435. Used to swap the first two planes of the image of the icon being modified if
  1436. the version of the OS if less than 36 (i.e., prior to version 2.0).  This does
  1437. mean that your icons need to have the 2.0 color scheme on your distribution
  1438. disks.
  1439.  
  1440.  
  1441. (disk)
  1442.  
  1443. When used with the "rename" statement, specifies that a disk relabel operation
  1444. is really desired.  When used with the "askdir" or "askfile" statement,
  1445. specifies that a drive list should be shown initially (instead of a file list).
  1446.  
  1447.  
  1448. (append <string>)
  1449.  
  1450. Within a "textfile" statement, will append the string to the textfile.
  1451.  
  1452.  
  1453. (include <filename>)
  1454.  
  1455. Within a "textfile" statement, will append the listed file to the textfile.
  1456.  
  1457.  
  1458. (default <value>)
  1459.  
  1460. Specifies the default value of an askchoice, askstring, or asknumber action.
  1461.  
  1462.  
  1463. (range <min> <max>)
  1464.  
  1465. Specifies the range of allowable numbers for an asknum statement.
  1466.  
  1467.  
  1468. (command <text> ...)
  1469.  
  1470. Specifies the text of a command to be inserted into the S:User-Startup file.
  1471. (Argument strings are merged.)
  1472.  
  1473.  
  1474. 4.9  Pre-Defined Variables
  1475.  
  1476. Pre-defined variables are available for use by the install script.  They may be
  1477. modified on-the-fly, but their type may not be changed (e.g. from strings to
  1478. numeric) unless it never had a value to begin with.
  1479.  
  1480.  
  1481. @abort-button
  1482.     Replacement text for the "Abort Install" button.
  1483.  
  1484. @app-name
  1485.     The APPNAME value given at startup.
  1486.  
  1487. @icon
  1488.     The pathname of the icon used to start the installer.
  1489.  
  1490. @execute-dir
  1491.     If this variable is set to a valid path, then the installer will change
  1492. directory to it whenever a "run" or "execute" statement is performed.
  1493.  
  1494. @default-dest
  1495.     The installer's suggested location for installing an application.  If you
  1496. installed the application somewhere else (as the result of asking the user)
  1497. then you should modify this value -- this will allow the "final" statement to
  1498. work properly.  Note that creating a drawer and putting the application in that
  1499. drawer is considered installing the application somewhere else.  Set it to ""
  1500. if there really is no definite place that the "application" was installed.
  1501. The log file will be copied to the drawer indicated by @default-dest unless it
  1502. was set to "".
  1503.  
  1504. @language
  1505.     Used to set the variable @language (default for @language is "english".
  1506. The use of this variable is left up to the install script.
  1507.  
  1508. @pretend
  1509.     The state of the Pretend flag (1 if Pretend mode).
  1510.  
  1511. @user-level
  1512.     The user-level the script is being run at: 0 for novice, 1 for average,
  1513. 2 for expert.
  1514.  
  1515. @error-msg
  1516.     The text that would have been printed for a fatal error, but was overridden
  1517. by a trap statement.
  1518.  
  1519. @special-msg
  1520.     If a script wants to supply its own text for any fatal error at various
  1521. points in the script, this variable should be set to that text.  The original
  1522. error text will be appended to the special-msg within parenthesis.  Set this
  1523. variable to "" to clear the special-msg handling.
  1524.  
  1525. @ioerr
  1526.     The value of the last DOS error.  Can be used in conjunction with the
  1527. "trap" statement to learn more about what an error occurred.
  1528.  
  1529. @each-name
  1530. @each-type
  1531.     Used in a "foreach" loop (see above).
  1532.  
  1533. @askoptions-help
  1534. @askchoice-help
  1535. @asknumber-help
  1536. @askstring-help
  1537. @askdisk-help
  1538. @askfile-help
  1539. @askdir-help
  1540. @copylib-help
  1541. @copyfiles-help
  1542. @makedir-help
  1543. @startup-help
  1544.     Default help text for various functions.  These can be appended to the
  1545. explanation provided for a particular action or used as is.
  1546.  
  1547.  
  1548.             Section 5: Installer Language Quick Reference
  1549.  
  1550. 5.1  Overview
  1551.  
  1552.     Attempts to install in "work:" by default if it exists.
  1553.     HELP key brings up context-sensitive help.
  1554.     Esc key brings up the abort requester.
  1555.     Can add assigns to s:User-Startup, and adds lines to
  1556.     s:Startup-Sequence (if necessary) to make sure s:User-Startup is executed
  1557.       upon boot-up.
  1558.     Can check versions of files/libraries.
  1559.     Install can run in "Real" (do it) or "Pretend" (dry run) modes.
  1560.  
  1561.  
  1562.  
  1563.  
  1564. 5.2  Quick Language Overview
  1565.  
  1566.     Language is lisp-like (lots of parentheses (()) (-:).
  1567.     Variables are typeless (a la ARexx), i.e., strings and numbers are treated
  1568.       interchangeably.
  1569.     Strings are delimited with " or '.
  1570.     Certain embedded sequences are available for strings:
  1571.         '\n'    newline        '\r'    return
  1572.         '\t'    tab            '\0'    NULL
  1573.         '\"'    double-quote   '\\'    backslash
  1574.     Statements go in parentheses ( ).  The general format is:
  1575.         (operator <operand1> <operand2> ...)
  1576.     E.g., to assign the value '5' to the variable 'x', use
  1577.         (set x 5)
  1578.     To produce the sum of two numbers, use
  1579.         (+ 5 9)
  1580.     Note that there is no difference between operators and functions-- the
  1581.       function 'set' and the arithmetic operator '+' are both used exactly the
  1582.       same way.
  1583.     Combining statements: A statement can be used as the operand to another
  1584.       statement.  E.g.:
  1585.         (set x (+ 3 5))
  1586.       In this case, the statement '(+ 3 5)' is evaluated first, and the result
  1587.       is 8.  You can think of this as having the '(+ 3 5)' part being replaced
  1588.       by an 8, leaving:
  1589.         (set v 8)
  1590.       Note that the '(+ 3 5)' part actually produced a value: "8".  This is
  1591.       called the "result" of the statement.  Many statements return results,
  1592.       even some that might surprise you (such as "set" and "if").
  1593.     Comments are preceded with a semi-colon ";"
  1594.     Hex numbers are preceded with a $ (e.g. $23).
  1595.     Binary numbers are preceded with a % (e.g. %0101).
  1596.     Many statements return a value which can be used in assignments, tests, etc.
  1597.     Data can be formatted using a string literal with argument placemarkers,
  1598.       for example:
  1599.         ("I am %ld foot %ld inches tall." 6 3)
  1600.         ;Produces a string with %ld's replaced with 6 and 3.
  1601.         ;Remember that decimal values must be specified as longwords.
  1602.  
  1603.  
  1604.  
  1605.  
  1606. 5.3  Pre-Defined Variables
  1607.  
  1608.     @icon - pathname of install script icon
  1609.     @execute-dir -  installer will change to this directory before performing
  1610.       a "run" or "execute" statement.
  1611.     @default-desk - dir.  where install wants to put things by default
  1612.     @pretend - state of "pretend" (dry run mode) flag 0-Real, 1-Pretend
  1613.     @language - language specified in tooltypes/CLI (default "english")
  1614.     @user-level - 0-Novice, 1-Average, 2-Expert
  1615.     @error-msg - msg that would be displayed if error not trapped (see trap)
  1616.     @special-msg - custom fatal error message
  1617.     @each-name, @each-type - used in "foreach" loop
  1618.     @execute-dir - If set to a valid path, installer will change directory to
  1619.       it whenever a "run" or "execute" statement is performed.
  1620.  
  1621.  
  1622.  
  1623.  
  1624. 5.4  Default Help String Variables
  1625.  
  1626.     @askoptions-help    @askchoice-help      @asknumber-help
  1627.     @askstring-help     @askdisk-help        @askfile-help
  1628.     @askdir-help        @copylib-help        @copyfiles-help
  1629.     @makedir-help       @startup-help
  1630.  
  1631.  
  1632.  
  1633. 5.5  Statements
  1634.  
  1635. Many commands have standard parameters (some optional):
  1636.     (all) ; specifies all files are to copied
  1637.     (append <string>) ; add string to text file (for textfile)
  1638.     (choices <string1> <string2> ...) ; radio button options
  1639.     (command <string1> <string2>...) ; add to s:user-startup
  1640.     (confirm <user-level>) ; confirmation
  1641.     (default <value>) ; default value, choice, string, etc.
  1642.     (dest <file>) ; output to <file>
  1643.     (help <string1> <string2> ...) ; define current help info
  1644.     (include <file>) ; insert file in textfile statement
  1645.     (infos) ; copy .info files also
  1646.     (newname <name>) ; specify new file or disk name
  1647.     (noposition) ; make icon "floating"
  1648.     (pattern <string>) ; used w/ "files" for patterns
  1649.     (prompt <string1> <string2> ...) ; text to show user
  1650.     (range <min> <max>) ; numeric input (asknum) range
  1651.     (safe) ; force installer to perform action even if in Pretend mode.
  1652.     (settooltype <tooltype> <value>) ; set icon tool type
  1653.     (setdefaulttool <value>) ; set icon's default tool
  1654.     (setstack <value>) ; set icon's stack value
  1655.     (source <file>) ; read from <file>
  1656.     (swapcolors) ; swap first two planes of icon's image if OS rev less than v36
  1657.     (welcome <string> <string> ...) ; Invokes "welcome" display
  1658.  
  1659. Note: Custom parameters are shown below in < >, and standard parameters are
  1660. show as (param..) where "param" is one of help, prompt, safe, etc.  See above
  1661. for details on standard parameters.
  1662.  
  1663.  
  1664. (abort <string1> <string2> ...)
  1665.   ; abandon installation
  1666.  
  1667. (complete <num>)
  1668.   ; display percentage through install in titlebar
  1669.  
  1670. (copyfiles (prompt..) (help..) (source..) (dest..) (newname..) (choices..)
  1671.   (all) (pattern..) (files) (infos) (confirm..) (safe)
  1672.   (optional <option> <option> ...) (delopts <option> <option> ...) (nogauge))
  1673.   ; copy files (and subdir's by default).  files option say NO subdirectories
  1674.  
  1675. (copylib (prompt..) (help..) (source..) (dest..) (newname..) (infos) (confirm)
  1676.   (safe) (optional <option> <option> ...) (delopts <option> <option> ...)
  1677.   (nogauge))
  1678.   ; install a library if newer version
  1679.  
  1680. (delete file (help..) (prompt..) (confirm..) (optional <option> <option> ...)
  1681.   (delopts <option> <option> ...) (safe))
  1682.   ; delete file
  1683.  
  1684. (execute <arg> (help..) (prompt..) (confirm) (safe))
  1685.   ; execute script file
  1686.  
  1687. (exit <string> <string> ... (quiet))
  1688.   ; end installation after displaying strings (if provided)
  1689.  
  1690. (foreach <dir> <pattern> <statements>)
  1691.   ;do for entries in directory
  1692.  
  1693. (if expr truestatements falsestatements)
  1694.   ; conditional
  1695.  
  1696. (makeassign <assign> <path> (safe)) ; note: <assign> doesn't need `:'
  1697.   ; create an assignment
  1698.  
  1699. (makedir <name> (prompt..) (help..) (infos) (confirm..) (safe))
  1700.   ; make a directory
  1701.  
  1702. (message <string1> <string2>...)
  1703.   ; display message with Proceed, Abort buttons
  1704.  
  1705. (onerror (<statements>))
  1706.   ; general error trap
  1707.  
  1708. (protect <file> [<string of flags to change>] [<decimal mask>] <parameters>)
  1709.   ; Get/Set file protection flags
  1710.  
  1711. (rename <old> <new> (help..) (prompt..) (confirm..) (safe))
  1712.   ; rename files
  1713.  
  1714. (rexx <arg> (help..) (prompt..) (confirm..) (safe))
  1715.   ; execute ARexx script
  1716.  
  1717. (run <arg> (help..) (prompt..) (confirm..) (safe))
  1718.   ; execute program
  1719.  
  1720. (set <varname> <expression>)
  1721.   ; assign a value to a variable
  1722.  
  1723. (startup (prompt..) (command..))
  1724.   ; add a command to the boot scripts (startup-sequence, user-startup)
  1725.  
  1726. (textfile (prompt..) (help..) (dest..) (append) (include..) (confirm..) (safe))
  1727.   ; create text file from other text files and strings
  1728.  
  1729. (tooltype (prompt..) (help..) (dest..) (settooltype..) (setstack..)
  1730.   (setdefaulttool..) (noposition) (confirm..) (safe))
  1731.   ; modify an icon
  1732.  
  1733. (trap <flags> <statements>)
  1734.   ; trap errors.  flags: 1-abort, 2-nomem, 3-error, 4-dos, 5-badargs
  1735.  
  1736. (until <expr> <statements>)
  1737.   ; do-until conditional structure (test end of loop)
  1738.  
  1739. (welcome <string> <string> ...)
  1740.   ; Allow Installation to commence.
  1741.  
  1742. (while <expr> <statements>)
  1743.   ; do-while conditional structure (test top of loop)
  1744.  
  1745. (working)
  1746.   ; indicate to user that installer is busy doing things
  1747.  
  1748.  
  1749. 5.6  Functions
  1750.  
  1751. (= <expr1> <expr2>) ; equality test (returns 0 or 1)
  1752.  
  1753. (> <expr1> <expr2>) ; greater than test (returns 0 or 1)
  1754.  
  1755. (>= <expr1> <expr2>) ; greater than or equal test (returns 0 or 1)
  1756.  
  1757. (< <expr1> <expr2>) ; less than test (returns 0 or 1)
  1758.  
  1759. (<= <expr1> <expr2>) ; less than or equal test
  1760.  
  1761. (+ <expr1> <expr2> ...) ; returns sum of expressions
  1762.  
  1763. (- <expr1> <expr2>) ; returns <expr1> minus <expr2>
  1764.  
  1765. (* <expr1> <expr2> ...) ; returns product of expressions
  1766.  
  1767. (/ <expr1> <expr2>) ; returns <expr1> divided by <expr2>
  1768.  
  1769. (AND <expr1> <expr2>) ; returns logical AND of <expr1> and <expr2>
  1770.  
  1771. (OR <expr1> <expr2>) ; returns logical OR of <expr1> and <expr2>
  1772.  
  1773. (XOR <expr1> <expr2>) ; returns logical XOR of <expr1> and <expr2>
  1774.  
  1775. (NOT <expr>) ; returns logical NOT of <expr>
  1776.  
  1777. (BITAND <expr1> <expr2>) ; returns bitwise AND of <expr1> and <expr2>
  1778.  
  1779. (BITOR <expr1> <expr2>) ; returns bitwise OR of <expr1> and <expr2>
  1780.  
  1781. (BITXOR <expr1> <expr2>) ; returns bitwise XOR of <expr1> and <expr2>
  1782.  
  1783. (BITNOT <expr>) ; returns bitwise NOT of <expr>
  1784.  
  1785. (shiftleft <number> <amount to shift>) ; logical shift left
  1786.  
  1787. (shiftrght <number> <amount to shift>) ; logical shift right
  1788.  
  1789. (IN <expr> <bit-number> <bitnumber>...)    ; returns <expr> AND bits
  1790.  
  1791. (<format string> <arg1> <arg2> ...) ; printf clone
  1792.  
  1793. (askdir (prompt..) (help..) (default..) (newpath) (disk))
  1794.   ; ask for directory name
  1795.  
  1796. (askfile (prompt..) (help..) (default..) (newpath) (disk))
  1797.   ; ask for file name
  1798.  
  1799. (askstring (prompt..) (help..) (default..)) ; ask for a string
  1800.  
  1801. (asknumber (prompt..) (help..) (range..) (default..)) ; ask for a number
  1802.  
  1803. (askchoice (prompt..) (choices..) (default..)) ; choose 1 options
  1804.  
  1805. (askoptions (prompt (help..) (choices..) default..)) ; choose n options
  1806.  
  1807. (askbool (prompt..) (help..) (default..) (choices..)) ; 0=no, 1=yes
  1808.  
  1809. (askdisk (prompt..) (help..) (dest..) (newname..) (assigns))
  1810.  
  1811. (cat <string1> <string2>...) ; returns concatenation of strings
  1812.  
  1813. (exists <filename> (noreq)) ; 0 if no, 1 if file, 2 if dir
  1814.  
  1815. (expandpath <path>) ; Expands a short path to its full path equivalent
  1816.  
  1817. (earlier <file1> <file2>) ; true if file1 earlier than file2
  1818.  
  1819. (fileonly <path>) ; return file part of path (see pathonly)
  1820.  
  1821. (getassign <name> <opts>) ; return value of logical name (no `:')
  1822.   ; <opts: 'v'-volumes, 'a'-logical, 'd'-devices
  1823.  
  1824. (getdevice <path>) ; returns name of device upon which <path> resides
  1825.  
  1826. (getdiskspace <path>) ; return available space
  1827.  
  1828. (getenv <name>) ; return value of environment variable
  1829.  
  1830. (getsize <file>) ; return size
  1831.  
  1832. (getsum <file>) ; return checksum of file for comparison purposes
  1833.  
  1834. (getversion <file> (resident))
  1835.   ; return version/revision of file, library, etc. as 32 bit num
  1836.  
  1837. (pathonly <path>) ; return dir part of path (see fileonly)
  1838.  
  1839. (patmatch <pattern> <string>) ; Does <pattern> match <string> ? TRUE : FALSE
  1840.  
  1841. (select <n> <item1> <item2> ...) ; return n'th item
  1842.  
  1843. (strlen <string>) ; string length
  1844.  
  1845. (substr <string> <start> [<count>]) ; returns a substring of <string>
  1846.  
  1847. (transcript <string1> <string2>) ; puts concatenated strings in log file
  1848.  
  1849. (tackon <path> <file>) ; return properly concatenated file to path
  1850.  
  1851.