I'm trying to build a setup for my application using a Windows Installer project. I'm using VS2005. My Windows application requires SQL Server 2005 Express, so I marked that as one of the prerequisites. I built the installer successfully and ran it on one computer running XP. It successfully detected that neither .net 2.0 or SQL Server 2005 Express were installed and installed both of them before installing my application. My application ran just fine and life was good.
I then took the exact same setup.exe and setup.msi and ran them on another computer - also running XP. It didn't attempt to install either of the prerequisites, and seemed to successfully install my application. As soon as my app was launched though it failed with "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"
My application doesn't connect to any external server, it only connects to localhost. When I looked in add/remove programs on the second computer, SQL Server wasn't there - that makes me believe that it's truly not installed.
Finally, I tested the install on a third PC still running XP. The bootstrapper successfully detected that SQL Server wasn't installed and began the download/install of it. At that point, I cancelled the installation (it seems to be a long install process for SQL Server 2005 express and I didn't want to wait through the whole thing).
How do I resolve the bootstrapper's apparent lack of successful detection of SQL Server 2005 Express on this one computer

Prerequisite not working?
domfos
Mike,
Thanks for the pointers. I'm beginning to think that SqlExpressChk is never even run. I looked in the registry on the problem computers and HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server doesn't exist. See my reply to Dave for how I came to this conclusion.
Mike
Dan Heile
Dave,
I had tried this yesterday, but tried again today. The temp directory is located in %USERPROFILE%\Local Settings\Temp. There is definitely not a log file created. I emptied out everything I could from the temp directory (leaving only half a dozen files or so that were currently in use) and ran the setup again. Before clicking the close button at the last step of the install, I looked in the temp directory and a temporary copy of the .msi had been added. As soon as I clicked close, that was deleted. There was also a file CFG94.tmp that was added that did not get deleted when I clicked close. It contained the text
< xml version="1.0" >
<configuration>
<startup><supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>
There was no VSD*.tmp directory created like there is on the other computers I have tested on.That makes me believe that SqlExpressChk.exe (and for that matter dotnetchk.exe) are never even run - since they aren't extracted to the temp directory to begin with.
I did happen to check the permissions on the Temp directory and the user has full rights to that particular folder.
I think it's becoming less of a problem with SqlExpressChk and more of a problem with the bootstrapper.
Mike
Nisa
I will forward this thread to someone else in the company who might be able to help.
In answer to your other question... you can run sqlexpresschk.exe from the command line. All you need to do is get the exit code (maybe some VB.NET code would be the easiest way to do that, using the System.Process class). A 0 (zero) seems to indicate that SQLExpress is already installed. You can also get the exit code from the bootstrapper log. You can find the bootstrapper log by going to the temp dir, looking for a subdir that has a file named something like install.log or installlog.txt. The log should indicate the exit code and values it got and was evaluating. That could help.
pv_pravin
We always create a log file. Since it is under temp dir, I wonder if it got cleaned up Or perhaps it was difficult to find. If you try running the setup.exe again, perhaps you can find the log.
J A Y
Thanks Mike
I'm looking forward to further suggestions on how to resolve this problem. Dave - if you would like a copy of the setup, let me know and I'd be happy to send it to you privately.
Mike
Toseef
LI'll let David continue to work on the issue of "why wouldn't bootstrapper keep a log file" but I'll jump in on the question about SqlExpressChk.exe failing.
In short, I don't know what's happening, but I've been trying to find out. It sounds like you're doing some significant testing, so maybe we can figure this out together. SqlExpressChk.exe scans the registry to determine if a SQL instances named SQLEXPRESS is installed on the computer with the obvious desired outcome. Please take a look at the registry on the problem computers and report the following information, we'll see if we can figure out how/if the registry scanning logic is going wrong.
On a normal computer that has not had any SQL Server installed, you shouldn't find any of these keys. If the default instance of SQL Express has been installed, you would find all theys keys. Let me know what you find.
Thanks,
Mike Wachal
SQL Express team
tnsgod831
Ah - a log file. I didn't know that the installer kept one. That makes sense.
I looked for the log on four of the five PC's I've tested - all of them except PC 4 which I don't have access to right now. I found it on two of them, PC 1 and PC 2. PC's 3 and 5 interestingly don't have log files. Of course, those are the ones giving me the original problem.
Looking through the log files I found, they look normal. They're quite clear and easy to understand. They log the behavior I observed.
Why wouldn't the bootstrapper keep a log file
Ehab EL_Gendy
I'm not exactly sure how to solve this... the workaround on just one computer would be to manually run the SQL Express installer, which should fix up the machine.
That doesn't actually solve the problem in case another computer has the same problem. If you are concerned with this, let me know and we might be able to look into this a bit more.
I'm pretty sure the sqlcheck.exe program uses WMI to determine if SQL Express is already installed.
dobauer
Hi Mike,
Given the registry values, or lack of registry values, then SQL Express should certainly be installed. I'm not sure how the bootstrapper reacts if SqlExpressChk.exe is not even being run, it would appear that it reacts by not installing SQL Express. Hopefully David and the VS team can help shed some light on reason why the "check" programs wouldn't get run.
Mike Wachal
davidacoder
I'm still struggling with this. I've now found another PC that exhibits the same problem and I'm not any closer to a solution or even a work-around. Any more ideas
robinjam
webb_er
I am concerned about this. I've yet to actually deploy my application, it failed during my pre-deployment testing.
Since this is the first project I've ever done with VS, I'm not sure if it's something I did wrong or something wrong with the application.
I'm going to run the bootstrapper on several more PC's to see what happens. I'd also like to get a better understanding of why SQL Express wasn't detected on that computer. Can I run SqlExpressChk.exe manually somehow to see what it returns What criteria does it use to detect whether or not SQL Express is installed
One last thing I'd like to do is handle that particular error in my application so that if it does occur again, I can at least provide some feedback to the user that might be a little more meaningful to them.
Sound reasonable
DDressel
OK, so I've tested this on two more PC's. All have been running XP pro. Things worked successfully on one PC and didn't work on another. To summarize my test results:
PC1 - Detected lack of .net 2 and SQL Express and installed them.
PC2 - .net 2 already installed. Detected lack of SQL Express and installed it.
PC3 - .net 2 already installed. Didn't detect lack of SQL Express, but installed my app anyway.
PC4 - Detected lack of .net 2 and SQL Express and installed them.
PC5 - .net 2 already installed. Didn't detect lack of SQL Express, but installed my app anyway.
Now I'm thoroughly confused. What am I missing
nabe
I've written my own SQL Server Check in C++, using COM and WMI. When I start setup.exe, it does actually create a log file (under %TEMP%\VS***.TMP), and says that it's run my check, and got a value of 0 (when it should have been getting a value of 1). it has also unpacked the chk.exe files into subfolders of the temporary VS***.TMP directory).
If I run the chk.exe from the command line, I get ""The system cannot execute the specified program". I think this is because the executable is dependant on some DLLs that aren't on the machine. Rather than go through the hassle of using Dependency Walker to find the DLLs, and adding them as part of the installation, I'm going to rewrite the chk.exe in C#, since I'm already installing .NET Framework 2.0 as part of the installation.