Search Input Field

Description

The search input field allows the user to choose a file or directory. In addition to conventional file and directory choices it offers the following possibilities:

  • auto-detection of the location using a list of choices defined at compile time,

  • manual selection of pre-defined choices (from a combobox),

  • automatic check whether chosen directory contains a file based on a path defined at compile time.

  • In GUI installation, mode you can also manually edit or browse paths on the file system.

Configuration

<spec>

The <spec> tag supports the following attributes:

Name

Required

Description

Range of values

Name

Required

Description

Range of values

filename

no
(ignored when type="directory") 

The name of the file or directory to search for



type



Indicate whether "checkfilename" should be a file or directory

file, directory

result



What to return as the search result

file, directory, parentdir

checkfilename

no

The name of the file or directory to search for



The <spec> element should also include one or more nested <choice> elements.

<choice>

Attributes

The <spec> element accepts of one or more nested <choice> tags. One <choice> tag is required for each search entry. The <choice> tag accepts the usual txt and id attributes, which are used to specify the label text. In addition the following attributes are supported:

value - required

The value attribute is used to specify which value to insert if this associated entry is selected. In other words, the label text has nothing to do with the value that is actually substituted for the variable. For this reason there is never an issue if multiple languages are used, the value is always the same for a given selection.

The value attribute may contain "*" which will be processed by the "Autodetect" feature to provide a full list of all matching paths on the target machine.

set - optional

The set attribute accepts the values true and false. Since the attribute is optional it can also be omitted, which is interpreted as false. If a value true is used, the associated entry will be selected when the panel is activated. Obviously, only one of the buttons in a set should be set to true.

os - optional

Limit the visibility of the according choice to the operating system's family at installation time.

Nested Elements

The choice elements support the nested <os> tag to add operating-system-specific limits at installation time.

Example

1 2 3 4 5 6 7 8 9 <field type="search" variable="java_sdk_home"> <description txt="This is a description for a search input field." id="description.java_sdk_home"/> <spec txt="Path to Java SDK:" checkfilename="lib/tools.jar" type="file" result="directory"> <choice value="/usr/lib/java/" os="unix" /> <choice value="/opt/java" os="unix" /> <choice value="C:\Program Files\Java" os="windows" /> <choice value="C:\Java" os="windows" /> </spec> </field>