SQL Server 2008 Express Silent Command-Line Install

July 28, 2010 18:28

I have a need to perform a silent, command-line install of SQL Server 2008 Express as a pre-requisite for a server application. While there's an extensive listing of all the many options available for a command-line install of SQL Server, it still took me a while to sift through what was really needed for a basic, minimal install.

I should add that I'm using InstallShield and setting SQL Server as one of the pre-req's, but it still requires the command-line switches:

image

What you're seeing up there is the right way to do it. Before, I only had the "/q" switch, telling SQL Server to run silently. I thought that was enough. Oh, was I wrong. I ran the install, SQL Server looked like it was doing something, but I kept getting an error dialog from InstallShield saying the SQL Server part of the install did not complete successfully. So, the first thing I did was take a step back and attempt to get just the SQL Server install to run, sans InstallShield, from a plain old command prompt.

The first step was to, of course, get SQL Server Express (I was letting InstallShield download from the web, and who knows what happened to that copy). You've got several choices; I only wanted the basic database, so I chose the "Database Only" option.

image

Note that if you're using a plain vanilla VPC like me with a new Windows OS install, you'll likely also need to install Windows Installer 4.5, which is required by SQL Server.

As you're trying to get your command-line setup correctly, one of the best places I found to determine what went wrong when an install didn't work was to look at the log file in the folder "C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log". Open one of the sub-folders (which are named with the install time) and open the "Summary" text file.

With Windows Installer and SQL Server Express 2008 installed, here's the command-line I wound up using:

   1: SQLEXPR32_x86_ENU.exe /q /ACTION=Install /IACCEPTSQLSERVERLICENSETERMS
   2:    /INSTANCENAME=SQLSERVER /ROLE=AllFeatures_WithDefaults
   3:    /ADDCURRENTUSERASSQLADMIN=TRUE /SQLSVCACCOUNT="NT AUTHORITY\Network Service"
   4:    /FEATURES=SQL

I think it's about as minimalistic as you can get. I'm not so sure about running the sqlserver.exe service under the NETWORK SERVICE account, but that's what I'm going with for the time being. I'll update if I find a recommendation on this, or please leave a comment below if you've got something on this.

Oddly enough, you can't just take those switches and throw them into InstallShield. You'll get a couple of errors during the SQL Server install if you do (take a look at the SQL log files at "C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log" if you do). So, here are the switches I had to use to keep InstallShield happy:

   1: /q /ACTION=Install /INSTANCENAME=SQLSERVER /ADDCURRENTUSERASSQLADMIN=TRUE
   2:    /SQLSVCACCOUNT="NT AUTHORITY\Network Service" /FEATURES=SQL

[ Follow me on Twitter ]


Combine Setup MSI and EXE into a single package with IExpress

May 30, 2010 19:37

IExpress is a little known utility that will combine any number of files into a single, self-extracting executable similar to a WinZip self-extracting executable except IExpress comes standard with XP, Vista, and Windows 7 and is therefore free.

A tool like this one is especially handy as a standard Visual Studio setup project will produce two files: an MSI for your application and a setup EXE (the bootstrapper) for any prerequisites. Because I didn't want to have to tell my client, "First you need to run the EXE, and then run the MSI", I had to have something that would package both of these files into a single package. IExpress does this quite nicely, though there was a bit of a hurdle to overcome (see below).

First, you can find IExpress in the Windows System32 folder. It's an executable that, when run, will present this dialog:

image

I'm not going to go into how to create your first SED file but will instead refer you to this step-by-step tutorial.

Of more interest to me was how to automate the creation of the single package as part of my setup project. Once you have a configured SED, you can use the following command-line syntax in your setup's post-build step to create the single IExpress installer:

IExpress /N /Q $(ProjectDir)myapp.sed

The SED contains all of the info IExpress needs including which files to package up and where to output the final EXE.

I did run into a very annoying issue which burned more than a few hours. I'll detail it here so maybe you won't waste as much time as I did.

My IExpress package contains the following files:

image

Setup.bat is the only thing I tell IExpress to run:

image

The problem with this is that somewhere between VS2005 and VS2008, Microsoft introduced a bug which causes executables launched by self-extracting exe's (produced by IExpress, InstallShield, WinZip, and probably others) to not wait for an accompanying MSI to finish installing. In fact, in the case of IExpress, it appears to remove the MSI before setup.exe has even run it, resulting in this error dialog once setup.exe is ready to hand-off the install to the MSI:

image

Long story short, a poster here came up with a nice workaround. Setup your SED as above, with a batch file included in the contents and make the batch file the only thing IExpress launches. The contents of the batch file are as follows:

MKDIR %Tmp%\<UNIQUE PRODUCT NAME>
XCOPY . %Tmp%\<UNIQUE PRODUCT NAME> /S /E /Y
%Tmp%\<UNIQUE PRODUCT NAME>\setup.exe

Where <UNIQUE PRODUCT NAME> is your application or some other name. Create your new IExpress package EXE either by going through the wizard again or running the command-line as above. If you then launch the package EXE once setup.exe has finished with the prereq's (if any), your MSI should launch.

This workaround has the side-effect of leaving the extracted files behind, but you can always add a final step to remove them.

Conclusion

In this post I gave a high level overview of the self-extracting exe creator, IExpress, which can be found in your Windows\system32 folder. If your application has prerequisites such as .NET 4 or SQL Express, for example, and you want users to not have to choose between running an EXE or an MSI, use IExpress to reduce these two files to one and take the choice (and the uncertainty) away for them.

References


Digital Persona Fingerprint Reader gives "Reader not detected" message

May 22, 2010 16:48

Every once in a while the AuthenTec AES2810 fingerprint reader on my Dell Studio 17 laptop stops working. At the Windows 7 login screen, the fingerprint login option says "Reader not detected". This happens randomly after coming out of hibernation. I've tried a variety of things to fix this; rebooting has been the only thing that takes care of it.

However, I decided to do some more checking since it just happened again and I was able to kick-start it sans a reboot. So I have this documented, here's two possibilities for fixing this (I wasn't sure which did it since, silly me, I was trying the first while the second was still installing):

1.) Verify the "AuthenTec Fingerprint Service" service is running and set to "Automatic" startup type.

image

2.) Use the 8.5.0.251 driver version from Dell's support web site.

image

This seems to have resolved the issue for me for the time being at least.

[ Follow me on Twitter ]


Insufficient available memory to meet the expected demands of an operation…

April 22, 2010 08:54

2010-06-27 - Microsoft has released a hotfix for this issue. I'm installing now. If all goes well, this will be my last update on this issue. 

2010-06-18 - It looks like the VS team is planning to release a hotfix for this issue before VS2010 SP1 comes out. Here's the text of the post dated 6/16/2010:

Hi everyone - I'm writing to let you know that we just started the process of releasing a hotfix for this issue. There is no exact ETA yet, but I'll keep this thread updated with any new developments and post a link as soon as a patch becomes available. 

2010-05-26 - Update: Still having the problem. :-( This resource would seem to indicate that while one condition of the problem was fixed, there is another situation that can cause this problem and it won't be fixed until VS2010 RC1. Ugh. Here is the text of the response:

This is a known issue on VS 2010 RTM that we just recently fixed, so I'm resolving it as Fixed. As you noted, we did previously believe we had fixed this for RTM already, but fixing that part of the issue unfortunately uncovered another bug that could cause the same symptoms. The next version of Visual Studio should not have this problem, and we will very strongly consider this fix for VS 2010 SP1. For now, restarting VS should cause the error to stop displaying and allow cut/copy/paste to work again, though the problem will likely reappear after using VS again for some time and require another restart.

2010-05-03 - Update: Yep, looks like it was StyleCop for ReSharper causing the problem. The good news is that it's fixed, so unless you installed the earlier version you'll never see this problem. Thanks to the developers for getting this fixed so quickly.

2010-04-27 - Update: It's looking like this might be a StyleCop for ReSharper memory leak that has been fixed in their latest release. I reinstalled ReSharper and StyleCop for ReSharper and have not seen the problem re-materialize yet. Keeping fingers crossed.

2010-04-25 - Update: I realized that maybe VS2010 isn't causing the problem at all, and that maybe one of the 3rd party tools just isn't playing nice. So, I uninstalled ReSharper 5.0 (the release build) and I have not seen the problem again. I'll need to play around with it some more and see if it's really gone. But so far, so good. If it is ReSharper, I'll have to see if they're aware of the problem. I don't want to give up using their tool as its become one of my essentials.

I was running into this problem starting either with the Beta or RC version of Visual Studio 2010. I figured it would have been fixed by the time the RTM came out, but not so. The problem occurs after Visual Studio has been running for maybe a day or overnight. Upon highlighting some text and attempting a "copy" (Ctrl-C), I get this error:

 

image

You can see the memory usage of the devenv.exe instances I have opened. The highlighted instance is where I’m currently getting the error.

devenv memory usage

I don’t have a solution for this. Neither does Microsoft, apparently, since here we are on the RTM build and it’s still with us. If I do find a solution, I’ll update this post. If someone else comes along and has some ideas, feel free to comment below. Thanks.

[ Follow me on Twitter ]