INF: How to Determine When Unattended SQL 7.0/MSDE 1.0 Setup is Complete

ID: Q233337


The information in this article applies to:


SUMMARY

You can automate the installation of SQL Server or Microsoft Data Engine (MSDE) by using an .iss file that records the responses and selections that would be provided by a user during an interactive install. An unattended installation of SQL Server 7.0 or MSDE 1.0 does not provide any graphical feedback of installation progress or of success or failure. If you want to determine when an unattended setup has completed or get additional information about the cause of a failed install you can use the files Sqlstp.log and Setup.log, which are automatically created during the setup.


MORE INFORMATION

Sqlstp.log is a detailed log file that the InstallShield setup program creates in the Windows root directory and updates throughout the installation to detail the setup progress. When an MSDE/SQL Server setup has completed successfully, a line like the following will be seen at the end of Sqlstp.log:


  18:04:48 Installation Succeeded 
For an explanation of the contents of this file see the SQL Server 7.0 Books Online article "Contents of the Sqlstp.log file". Sqlstp.log is very verbose and is a good place to start when troubleshooting installation issues. However, if you need to programmatically determine whether setup succeeded, you should use Setup.log, not Sqlstp.log. A sample Setup.log file would be:

  [InstallShield Silent]
  Version=v5.00.000
  File=Log File
  [Application]
  Name=MSDE
  Version=7.00.000
  Company=Microsoft
  [Status]
  Completed=1
  RebootRequired=0
  [ResponseResult]
  ResultCode=0 
Note that Setup.log has the structure of a standard Windows .ini file.

The following steps should be taken to programmatically determine whether setup was successful:
  1. Execute Msdex86.exe, Msdealpha.exe, or Setupsql.exe with the command line parameters to start an unattended install. These parameters can be found in the MSDE Readme.txt file (for MSDE) or in the SQL Server Books Online article "How to run an unattended installation".


  2. Wait for Msdex86.exe, Msdealpha.exe, or Setupsql.exe to complete. One method for waiting on a process to finish is documented in the following Microsoft Knowledge Base article:
    Q129796 HOWTO: 32-Bit App Can Determine When a Shelled Process Ends


  3. After the InstallShield setup ends, check for the following conditions:



  4. If all three of these conditions are met, the MSDE/SQL setup succeeded. If ResultCode <> 0, Completed <> 1, or either of these two entries is missing, the installation failed.
In many cases you can also determine the general cause of failure by examining the Setup.log file. ResultCode will be a nonzero value for many failure conditions. The most common failure code is -12, which is caused when an unexpected setup dialog appears, or dialogs appear in a different order than the .iss file specifies. If you are using the SQL Server setup wizard to create your .iss file, make sure you proceed sequentially through the setup dialogs; if an error or unexpected dialog appears when running the wizard to create an .iss file you will have to restart the setup wizard to obtain a clean .iss file. If you receive a -12 ResultCode when using a modified version of the Unattend.iss file that is included with MSDE, try again with an unmodified version, and review the changes you made to the file carefully.

Other possible ResultCode values are:

Error code Error code description
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 Cannot 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.


This list can be found in the SQL Server 7.0 Books Online article titled "Scripting".


If setup completes successfully, the Setup.log file will also have a RebootRequired entry in the [Status] section. If RebootRequired=1, the computer will need to be rebooted to fully install all new components. If RebootRequired=0, no reboot is necessary.

The location where the Setup.log file will be created can be set with the -f2 command line parameter. For example, the following command line will cause the Setup.log file to be created in the root of the C: drive:


C:\>MSDEx86.exe -s -a -f1 "c:\temp\unattend.iss" -f2 "c:\setup.log"

If the -f2 parameter is not provided, the Setup.log file will be created in the Windows root directory. Sample .iss files that have been tested are available with both MSDE and SQL Server. The file Unattend.iss automates a typical install of MSDE, and the SQL Server CD includes sample .iss files for the installation of common variations of SQL Server installs (client utilities only, Desktop edition/Standard edition, and so forth).

REFERENCES

For additional information on an unattended installation, see the SQL Server 7.0 Books Online articles "Unattended Installation" and "How to run an unattended installation (Command Prompt)".

SQL Server 7.0 Books Online are available at the following URL:
http://support.microsoft.com/support/sql/

Additional query words:


Keywords          : SSrvInst kbSQLServ700 
Version           : WINDOWS:1.0; winnt:7.0
Platform          : WINDOWS winnt 
Issue type        : kbinfo 

Last Reviewed: July 1, 1999