Traditional Silent Mode for InstallScript MSI Installations (Setup.iss)

InstallShield DevStudio

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 end user for input. Instead, a silent installation must get its user input from a different source. For InstallScript MSI installations, that source is the InstallShield Silent response file (.iss file).

Note

An installation program created by a Basic MSI project does not use response files for silent installations. Instead, the values of public properties such as USERNAME, COMPANYNAME, and INSTALLDIR should be set at the command line.

A response file contains information that an end user would ordinarily enter as responses to dialog boxes when running a normal installation. During a silent installation (when the user runs Setup.exe with the /s argument), Setup.exe 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 the .iss extension. A response file is a plain text file consisting of sections containing data entries.

Creating Response Files

To create a response file, run Setup.exe with the /r argument, which runs the installation normally, and additionally creates the response file used by a silent installation. By default, the response file is called Setup.iss, and is created in the Windows or WinNT directory. To specify a different name or location for the response file, use the /f1 argument to Setup.exe.

The contents of a typical response file are as follows:

     [{82A0E076-6B5F-11D5-8803-204C4F4F5020}-DlgOrder]
     Dlg0={82A0E076-6B5F-11D5-8803-204C4F4F5020}-SdWelcome-0
     Count=5
     Dlg1={82A0E076-6B5F-11D5-8803-204C4F4F5020}-SdRegisterUserEx-0
     Dlg2={82A0E076-6B5F-11D5-8803-204C4F4F5020}-SdAskDestPath-0
     Dlg3={82A0E076-6B5F-11D5-8803-204C4F4F5020}-SetupType-0
     Dlg4={82A0E076-6B5F-11D5-8803-204C4F4F5020}-SdFinish-0

     [{82A0E076-6B5F-11D5-8803-204C4F4F5020}-SdWelcome-0]
     Result=1

     [{82A0E076-6B5F-11D5-8803-204C4F4F5020}-SdRegisterUserEx-0]
     szName=Jerome K. Jerome
     szCompany=User's Software Corporation
     szSerial=12345678
     Result=1

     [{82A0E076-6B5F-11D5-8803-204C4F4F5020}-SdAskDestPath-0]
     szDir=C:\Program Files\Sample Co\Sample App 3000\
     Result=1

     [{82A0E076-6B5F-11D5-8803-204C4F4F5020}-SetupType-0]
     Result=301

     [Application]
     Name=Sample App 3000
     Version=1.00.0000
     Company=Sample Co
     Lang=0409

     [{82A0E076-6B5F-11D5-8803-204C4F4F5020}-SdFinish-0]
     Result=1
     bOpt1=0
     bOpt2=0

The response file contains saved information about the number of dialog boxes displayed, the order in which the dialog boxes were displayed, the values of any data entered or selected by the end user, and which button the user clicked to exit the dialog box.

For example, the response file contains this section corresponding to the SdWelcome dialog box:

     [{82A0E076-6B5F-11D5-8803-204C4F4F5020}-SdWelcome-0]
     Result=1

The section header ([{82A0E076-6B5F-11D5-8803-204C4F4F5020}-SdWelcome-0]) indicates that the data pertains to the SdWelcome dialog box for a product with ProductCode (and PRODUCT_GUID) value “{82A0E076-6B5F-11D5-8803-204C4F4F5020}”. (The -0 at the end of the header indicates that this is the first call to SdWelcome. If the installation displayed a second SdWelcome dialog box, its header would end with -1.)

The Result=1 entry indicates the return value from the SdWelcome function. As described in the SdWelcome help page, the return value 1 indicates that the user clicked the Next button.

Similarly, the SdRegisterUserEx section stores the user name, company name, and serial number entered by the user, in addition to recording that the user clicked the Next button.

Running Silent Installations

To run an installation silently based on the contents of a response file, the end user runs Setup.exe with the /s argument. By default, Setup.exe looks for a response file called Setup.iss in the same directory as Setup.exe, but the /f1 argument can be used to specify an alternative name and location of the response file.

A silent installation program does not display a dialog if an error occurs. Instead, status information for the silent installation is recorded (by default) in a file called Setup.log, created in the same directory as the response file being used. The end user can specify a different name and location for the log file using the /f2 argument to Setup.exe.

See Also