# Silent Installation

This section includes the following topics:

- Introduction
- How Silent Installations Work
  - How to Create a Response File (`.iss`)
  - Running InstallShield in Silent Mode
  - Creating a Log File

Notes

1. This chapter is intended for system administrators who want to deploy Java Plug-in on multiple PCs in the Intranet environment without any user interaction.
2. The examples below are for release 1.4.0. You should be able to adapt them for any release in the 1.4 family.

## Introduction

JavaTM 2 Platform Runtime Environment installations are built using the InstallShield and InstallShield PackageForTheWeb products. These products contain built-in support for silent or unattended installations. This document gives a brief introduction to the steps for running silent installations. Please refer to the documentation provided at the InstallShield Web Site for complete information about silent installations.

## How Silent Installations Work

A normal (non-silent) installation receives the necessary input from the user in the form of responses to dialog boxes. However, a silent installation does not prompt the user for input and 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 reads the necessary input from the response file at run time while performing a silent installation.

The format of a response file 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.

The InstallShield installations can be invoked with the `-s` parameter to run silently. The Java 2 Platform SDK and Runtime Environment installations can be run in interactive or silent mode.

### How to Create the Response File (`.iss`)

Here is an example of how to create the response file:

1. Download the `j2re1_4_0-win.exe` installation bundle.

2. Run the JRE installation bundle with the additional flags `-a -r -f1"<path><filename.iss>`", where `path` is the path to `filename.iss` and `filename.iss` is the name you want to use for your `setup.iss` file. For example:

   > `j2re1_4_0-win.exe -a -r -f1"C:\setup.iss"`

   Note that there is no space between `-f1` and `"<path><filename.iss>"`

3. Go through the install dialogs as normal, selecting the options that you want to be used in subsequent silent installs.

InstallShield will record all of your installation choices in your `setup.iss file`. This response file can be used later for the silent installation.

Here is an example of a response file:

> `[InstallShield Silent]
> Version=v5.00.000
> File=Response File
> [DlgOrder]
> Dlg0=SdLicense-0
> Count=2
> Dlg1=SdAskDestPath-0
> [SdLicense-0]
> Result=1
> [SdAskDestPath-0]
> szDir=C:\Program Files\Java Plug-in 1.4
> Result=1
> [Application]
> Name=Java Plug-in
> Version=1.4
> Company=JavaSoft`

### Running InstallShield in Silent Mode

After you have created the response file, you are ready to run the installation in silent mode using InstallShield Silent. When running an installation in silent mode, be aware that no messages are displayed. Instead, you can request creation of a log file, which will record installation information, including if the installation was successful. You can review the log file to determine the result of the installation.

To launch InstallShield Silent, run your `j2re1_4_0-win.exe` install bundle with the flags `-s -a -s -f1"<path><filename.iss>`", where `path` is the path to `filename.iss` and `filename.iss` is the name of your `setup.iss` file. If you want to register Plug-in with Internet Explorer and/or Netscape 6, include the `-iexplorer` and/or `-netscape6` options in the command line. They can be in any order but must come after the `-a` and before the second `-s`. For example,

> `j2re1_4_0-win.exe` `-s -a -iexplorer -netscape6 -s -f1"<path><filename.iss>"`

Note that there is no space between `-f1` and `<path><filename.iss>`.

If you are doing this from an MS-DOS shell, you may find it convenient to use the "`start /w`" command, as that will cause MS-DOS to wait until the install is complete. For example:

> `start /w j2re1_4_0-win.exe -s -a -s -f1"C:\setup.iss"`

### Creating a Log File

If you want to create a log file describing the installation, use the additional flag `-f2"<path><filename.log>`". This will cause the log to be written to the `filename.log` file. For example:

> `start /w j2re1_4_0-win.exe -s -a -s -f1"C:\setup.iss" -f2"C:\setup.log`"

Note that there should be no space between `-f2` and `"<path><filename.log>"`

To verify if a silent installation succeeded, look at the `ResultCode` value in the `[ResponseResult]` section of `setup.log`. InstallShield writes an appropriate return value after the `ResultCode` keyname.