HOWTO: Work with silent install


Prev Up

Article ID: Q100007

The information in this article applies to:

  • Direct I/O, version 4.4


Sometimes it is advisable to run the installation of Direct I/O without any visual clue for the user.
In addition there may be the need to customize the installation to avoid the installation of unneeded program parts.
This article give you the details about the configuration options currently available.


Create the response file

A normal (non-silent) setup receives the necessary input from the user in the form of responses to dialog boxes. However, a silent setup does not prompt the user for input. A silent setup must get its user input from a different source. That source is the InstallShield Silent response file (.iss file).
A response file contains information similar to that which an end user would enter as responses to dialog boxes when running a normal setup. InstallShield Silent reads the necessary input from the response file at run time.

The format of response files resembles that of an .ini file, but response files have .iss extensions. A response file is a plain text file consisting of sections containing data entries.
There are two ways in which you can create an InstallShield Silent response file: you can run the setup and have InstallShield record and create the response file for you, or you can write the response file from scratch.

Recording a response file

You have the option of letting InstallShield create the response file for you. Simply run your setup with the Setup.exe /r command line parameter. InstallShield will record all your setup choices in Setup.iss and place the file in the Windows folder.

Manually creating a response file

You can also create the response file completely by hand. As mentioned, the Setup.iss file is similar to an .ini file. The sections of an InstallShield response file must be in the following order:

  1. Silent Header Section
  2. Application Header Section
  3. Dialog Sequence Section
  4. Dialog Data Sections (one per dialog box)

Section names are contained in square brackets, as in [InstallShield Silent].
Data entries follow their section names, and consist of <name=value> pairs, as in Dlg0=Welcome-0.
Follow these steps to create the response file:

  1. Create a text file named Setup.iss using any text editor.
  2. Enter the silent header into Setup.iss.
    All response files begin with a response file silent header. The response file silent header allows InstallShield to identify the file as a legitimate InstallShield response file. It also helps to verify that the response file corresponds to an setup created with the proper version of InstallShield.
    The format of the silent header is shown below. Enter the following lines at the beginning of your Setup.iss file:

    [InstallShield Silent]
    File=Response File

    The Version=v5.00.000 line indicates the version of the InstallShield Silent response file, not the version of InstallShield. Use v5.00.000 in all response files. Future versions of InstallShield that use later response file versions will be able to read earlier response file versions, so response file backward compatibility will be maintained.
  3. Enter the application header into Setup.iss.
    The response file application header is the second block of information in the response file, immediately following the response file silent header. The response file application header allows setup developers to identify response files visually. It is not used by the setup script or by Setup.exe. Setup developers can use the application header to identify exactly which setup the response file is for, since it is often difficult to determine this by looking at the dialog box data.

    The format of the application header is shown below. The values assigned to Name, Version, and Company are derived from the values written to the registry in the call to the InstallationInfo function in your setup script. Enter the following lines into your Setup.iss file below the silent header:

    Name=<ProductKey from InstallationInfo>
    Version=<VersionKey from InstallationInfo>
    Company=<CompanyKey from InstallationInfo>
  4. Enter the dialog box sequence into Setup.iss.
    The third block of information in the response file, after the silent header and the application header, is the response file dialog box sequence. The dialog box sequence section lists all dialog boxes you would need to use in a normal setup (including custom dialog boxes), in the order in which they would appear. The dialog boxes are listed under the section heading [DlgOrder].
    The dialog box numbering sequence begins at 0. There is no limit to the number of dialog boxes you can list.

    The order and the number of dialog boxes is significant. When InstallShield Silent runs, if either the number or the order of the dialog boxes does not match the order or the number of the dialog boxes in the non-silent setup, the silent setup fails and the log file
    records the failure. Make one entry for each occurrence of a dialog box. A given dialog box may be listed more than once if it appears more than once in the setup.
    The format for a dialog box sequence entry is Dlg<#>=<DialogIdentifier>. Dlg<#> consists of the letters Dlg and a sequence number. The first dialog box in the setup is Dlg0. Each dialog box after that increments the value of <#> by one.

    <DialogIdentifier> is in the form functionname-<#>, where functionname is the name of the function that created the dialog box, and <#> represents the sequential order of that particular dialog box in the setup.
    For custom dialog boxes, you can use any unique alphanumeric name for the functionname portion of <DialogIdentifier>. For example, you could refer to a custom dialog box as MyDialog. If the tenth dialog box in the setup were the second occurrence of the custom dialog box MyDialog, there would be an entry in the dialog box sequence section thus:
    The <DialogIdentifier> expression will be used to identify the dialog box data section for the dialog box.
    Always end the dialog box sequence section with a statement of the form Count=<number of dialog boxes> that specifies the exact number of dialog boxes listed in the dialog box sequence section. Count every entry. Since dialog box numbering begins with 0, the value of Count will always be 1 greater than the highest <#> value for a dialog box sequence.

    The example below lists two dialog boxes, the Welcome dialog box and the AskOptions dialog box. Enter your dialog box sequence list into Setup.iss as shown in the example below.

  5. Enter the dialog box data into Setup.iss.
    The last block of information in a response file is the response file dialog box data. The response file dialog box data is a collection of sections containing the values returned by each dialog box identified in the dialog box sequence section. Each dialog box has its own section. The values listed are the same values that the dialog box returns in a normal, user input-driven setup. You can also create dialog box data sections for custom dialog boxes.
    Dialog box data section format

    The format for a dialog box data section is shown above. The [<DialogIdentifier>] section header identifies the specific dialog box and is followed by the dialog box data entry list. <DialogIdentifier> is the same expression used to list the dialog box in the dialog box sequence section.
    Data entry items are in the format keyname=value. The keyname is a name for a value returned by a dialog box and recorded in the response file. All dialog boxes, including custom dialog boxes, return a value for the keyname Result, reflecting the button that was clicked to end or exit the dialog box. Many dialog boxes will also set or return a value in a variable.

    The name of the variable used in the script is meaningless relative to the Setup.iss file. However, in the Setup.iss dialog box data sections, each built-in and Sd dialog box has its own set of keynames which map to its parameters. The keynames are important and must be exact as defined for each dialog box.

    Result standard values

    All dialog boxes, including custom dialog boxes, return a keyname value called Result, indicating which push button was clicked to end the dialog box. Unless otherwise indicated, the Result standard values are:
    • 12 for the Back button
    •   1 for the Next or OK button

    Recording component and subcomponent selections

    Some dialog box functions allow the user to select components and subcomponents. There are three kinds of dialog box data keyname entries used to record component and subcomponent selections in response files: type, count, and <#> (described below).
    Every set of component selections and every set of subcomponent selections has one type keyname entry, one count keyname entry, and as many <#> keyname entries as are required to document each individual component or subcomponent selection.

    When creating keynames to record component selections, precede the type, count, and <#> keyname entries with the word "Component", thus:
    When creating keynames to record subcomponent selections, precede the type, count, and <#> keyname entries with the name of the component to which the subcomponents belong, thus:
    Program Files-type
    Program Files-count
    Program Files-0
    Program Files-1
    To create complete value entries, use the equal sign to attach the values to the keynames. (The types of values assigned to each kind of keyname are described below.) The following example shows complete value entries for two components, Program Files and Binary Files, and two subcomponents of Program Files, Executables and Support Elements:
    Component-0=Program Files
    Component-1=Binary Files
    Program Files-type=string
    Program Files-count=2
    Program Files-0=Executables
    Program Files-1=Support Elements

    Type keyname entry

    The type keyname indicates the data type of the components or subcomponents list. Since InstallShield dialog boxes currently use only string lists for components and subcomponents lists, type is always equal to "string", as in Component-type=string. Future versions may use number lists, in which case type could equal "number".

    Count keyname entry

    Count is equal to the number of selections for a given component or subcomponent entry. For example, if two components were selected for installation in the ComponentDialog dialog box, the count dialog box data entry would be Component-count=2. If two subcomponents of the Program Files component were selected, there would be a Program Files-count=2 entry.

    <#> keyname entry

    The number portion of the <#> keyname entry is simply a sequential (one-up) number, beginning with 0, that numbers each recorded component or subcomponent selection. Since numbering begins with 0, the greatest number value will always be one less than the value of count.
    The value assigned to a <#> keyname entry is the selected component's or subcomponent's visible name (the string passed as the second parameter to ComponentAddItem when the components or subcomponents list was built).

    For example, assume the ComponentDialog dialog box offers the user a component selection of Program Files, Help Files, Sample Files, and Utilities. If the user selects Program Files and Help Files, then the dialog box data section for that instance of the ComponentDialog dialog box will have two list item entries and will look something like this:
    Component-0=Program Files
    Component-1=Help Files
    The following example shows how subcomponent list selections are recorded. The example is for an instance of the SdComponentMult dialog box. The example shows that two components - Program Files and Help Files - were selected. It also shows that four subcomponents were chosen - Main Files, Aux. Files, Main Help, and Tutorial Files. Main Files and Aux. Files are subcomponents of Program Files, and Main Help and Tutorial Files subcomponents of Help Files.
    Component-0=Program Files
    Component-1=Help Files
    Program Files-type=string
    Program Files-count=2
    Program Files-0=Main Files
    Program Files-1=Aux. Files
    Help Files-type=string
    Help Files-count=2
    Help Files-0=Main Help
    Help Files-1=Tutorial Files

    Dialog box data keynames list

    The dialog box data keynames for the InstallShield dialog boxes are listed in the table below. The first column contains the dialog box names. The second column lists the keynames applicable to each dialog box. The third column contains descriptions of the values associated with the keynames.

    Dialog box Keyname Description
    SdAskDestPath-<#> Result Standard values
    szDir The path entered in the Destination Directory edit field.
    A single . tells InstallShield to use standard values.
    SdFinish-<#> Result 1 = Finish
    bOpt1 1 = "Yes, I want to view the README file." is checked
    0 = "Yes, I want to view the README file." is not checked
    bOpt2 1 = "Yes, I want to launch [app name]" is checked
    0 = "Yes, I want to launch [app name]" is not checked
    SdLicense-<#> Result 12 = Back
    1 = User selected "Yes"
    SdRegisterUserEx-<#> Result Standard values
    szName The text entered in the Name field.
    A single . tells InstallShield to use standard values.
    szCompany The text entered in the Company field.
    A single . tells InstallShield to use standard values.
    szSerial The text entered in the Serial (number) field.
    A single . tells InstallShield to use standard values.
    SdSetupTypeEx-<#> Result Typical
    SdStartCopy-<#> Result Standard values
    SdWelcome-<#> Result Standard values

  6. Save and close Setup.iss.

A sample response file is included to help familiarize you with the format.

Play back the silent setup

After you have created the response file, you are ready to run the setup in silent mode using InstallShield Silent. When running an setup in silent mode, be aware that no messages are displayed. Instead, a log file named Setup.log captures setup information, including whether the setup was successful. You can review the log file and determine the result of the setup.
To launch InstallShield Silent, run Setup.exe with the /s option.

InstallShield also provides the /f1 and /f2 switches so you can specify the name and location of the response file and the location of the log file. See the examples below or Q100006 for more info.
To verify if a silent setup succeeded, look at the ResultCode value in the [ResponseResult] section of Setup.log. InstallShield writes an appropriate return value after the ResultCode keyname.

Check for errors

The Setup.log file contains three sections. The first section, [InstallShield Silent], identifies the version of InstallShield Silent used in the silent setup. It also identifies the file as a log file.
The second section, [Application], identifies the installed application's name and version, and the company name.

The third section, [ResponseResult], contains the result code indicating whether or not the silent setup succeeded. An integer value is assigned to the ResultCode keyname in the [ResponseResult] section. InstallShield places one of the following return values after the ResultCode keyname:

0  Success.
-1  General error.
-2  Invalid mode.
-3  Required data not found in the Setup.iss file.
-4  Not enough memory available.
-5  File does not exist.
-6  Cannot write to the response file.
-7  Unable to write to the log file.
-8  Invalid path to the InstallShield Silent response file.
-9  Not a valid list type (string or number).
-10  Data type is invalid.
-11  Unknown error during setup.
-12  Dialog boxes are out of order.
-51  Cannot create the specified folder.
-52  Cannot access the specified file or folder.
-53  Invalid option selected.

The Setup.log file for a successful silent setup of InstallShield is shown below.

[InstallShield Silent]
File=Log File
Name=Direct I/O


DIRECTIO -a /r /f1"C:\Program Files\MyInstallation\mysetup.iss"

Runs Direct I/O in recording mode. At the end the response file mysetup.iss will contain all input data from this installation.
You could use this file to duplicate your installation as shown below or you could modify it as explained above.

DIRECTIO -s -a /s /f1"C:\Program Files\MyInstallation\mysetup.iss"

Installs Direct I/O without any window popping up or other visual clue using your own response file.

All valid command line options are explained in Q100006.

Direct I/O and Paule are registrated trademarks of Ingenieurbuero Paule. All other products mentioned are registered trademarks or trademarks of their respective owners.
Questions or problems regarding this web site should be directed to Webmaster.
Copyright 1998-2018 Ingenieurbuero Paule. All rights reserved. Impressum.
Last modified: 2018-04-24.
Printer friendly