Microsoft KB Archive/824042

From BetaArchive Wiki
Knowledge Base


PRB: The SQL Server Desktop Engine Setup Program May Stop Responding When It Is Started from an External Application

Article ID: 824042

Article Last Modified on 6/30/2005



APPLIES TO

  • Microsoft SQL Server 2000 Desktop Engine (Windows)



SYMPTOMS

If you start SQL Server Desktop Engine (also known as MSDE 2000) from a custom installer, the SQL Server Desktop Engine Setup program may stop responding.

This problem occurs when your custom installer uses the WaitForSingleObject function from its main thread to wait for the SQL Server Desktop Engine Setup program to return.

CAUSE

During installation, several InstallShield components that communicate their progress by broadcasting messages to all top-level windows run. Because the messages are sent synchronously, if the calling application owns a top-level window and is not processing messages that are sent to its message loop, the InstallShield process stops responding until the application closes.

WORKAROUND

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. To work around this problem, the parent process can use the WaitforInputIdle function before it calls the WaitForSingleObject function. The parent process can also spawn a second thread that starts the SQL Server Desktop Engine Setup program. This method has an advantage that the main setup process continues to be responsive while the SQL Server Desktop Engine setup occurs.
The following example is a Microsoft Visual C++ code sample that demonstrates the use of WaitforInputIdle:

int InstallMSDE() 
{
 DWORD dwRes = 0;
 if (!CreateProcess(_T("setup.exe"), NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
 { 
dwRes = GetLastError(); 
DisplayError(dwRes); 
}
 //Wait for MSDE setup to return
WaitForInputIdle(pi.hProcess, INFINITE); 
WaitForSingleObject(pi.hProcess, INFINITE); 
}

MORE INFORMATION

During SQL Server Desktop Engine setup, you can enable the verbose log option to create the setup log in the appropriate location. For example, you can start the SQL Server Desktop Engine Setup program by using following code:

Setup.exe /L*v <Full_Path_of_MSDELog>\msdestp.log

This setup log contains all the information about the setup process. You can analyze the setup log file and debug the SQL Server Desktop Engine setup process.

The setup process is made up of many actions, and each action returns a value that is based on action status. The following table lists the return values and their predefined meanings.

Return Value Meaning
1 Success
2 User Cancelled
3 Fatal (Unrecoverable) Error
4 Install Suspended, Waiting for Reboot



In this scenario, the appearance of a return value of 2 does not occur because the installation is unattended and the user cannot interact with the setup process to cancel any action. When you analyze the setup log file, look for the actions with a return value of 3 or 4.

For additional information about how to troubleshoot SQL Server Desktop Engine setup, click the following article number to view the article in the Microsoft Knowledge Base:

317328 HOW TO: Troubleshoot a SQL Server Desktop Engine 2000 Installation and Upgrade


REFERENCES

For additional information about how to track the progress of an unattended installation of SQL Server Desktop Engine 2000, click the following article number to view the article in the Microsoft Knowledge Base:

315463 HOW TO: Implement a SQL Server 2000 Desktop Engine Callback Function and Example


247221 PRB: Unattended Install of SQL Server 7.0 or MSDE 1.0 Stops Responding


Keywords: kbunattended kb3rdparty kbthread kbcodesnippet kbdebug kbsetup kbupgrade kbprb KB824042