Wednesday 11 November 2009

The INSTANCESHAREDWOWDIR command line value is not valid. Please ensure the specified path is valid and different than the INSTANCESHAREDDIR path

Bit of a long title, but it's taken me a while to figure this one out, so I thought I'd make a note of how to work around it in case it's useful to anyone else.

I bought (rented) a dedicated server with SQL Server Express 2005 installed as part of my development process for Caesars Arcade. I figured I'd replace SQL Server Express 2005 with 2008, seeing as it's free and should do fine for what I want.

However, when I tried to install SQL Server Express 2008 through the Microsoft Web Installer by clicking on one of the "install" buttons on the SQL Server Express web page it tried to install and failed. The log stated:

Overall summary:
Final result: SQL Server installation failed. To continue, investigate the reason for the failure, correct the problem, uninstall SQL Server, and then rerun SQL Server Setup.
Exit code (Decimal): -2068578304
Exit facility code: 1204
Exit error code: 0
Exit message: The INSTANCESHAREDWOWDIR command line value is not valid. Please ensure the specified path is valid and different than the INSTANCESHAREDDIR path.

The solution seems to be this:
Just below the table on the SQL Server Express web page that contains the "install" buttons is a statement, "If you have Express already installed, are looking to embed SQL Server Express into an application, or need guidance on whether you should perform a custom install, click here."

Click on the "click here" which takes you to a Microsoft blog with a table under the title "Customize". Select the version of SQL Server you want and download it to your computer. When it is downloaded, double click it. It will extract lots of files and, after a short time, open a window titled "SQL Server Installation Center".



Normally, you would click on an option in this window to start the installation, but DON'T. Instead, leave this window open (closing it will delete all the files we just extracted and we need those to run our installation) and do a search for "setup.exe". It should be in a temporary directory somewhere, in my case it put it into D:/random_digits/ where random digits is a long list of letters and numbers. It's a different generated directory everytime you run the extractor.

In this directory, create a shortcut to the setup.exe file and add these switches to the "target" command (arrowed in the below diagram):

/action=Install /INSTALLSHAREDWOWDIR="C:\Program Files (x86)\Microsoft SQL Server (x86)" /INSTALLSHAREDDIR="C:\Program Files (x86)\Microsoft SQL Server"

so that you have something like:
D:/eafd3324ee23/setup.exe /action=Install /INSTALLSHAREDWOWDIR="C:\Program Files (x86)\Microsoft SQL Server (x86)" /INSTALLSHAREDDIR="C:\Program Files (x86)\Microsoft SQL Server"



Now double click the shortcut to run the installer program, still leaving the "SQL Server Installation Window" open so that the files don't disappear.

Go through all the steps and when you get to your feature selection page it should look like this the image below. When you go past this page, it shouldn't stop you with the warning about the directories.



Once you've put all your options in, you should just be able to sit back and wait (for a long time) while it installs SQL Server Express.

One final point. I don't know if it's important, but I uninstalled SQL Server Express 2005 before going through the installation of SQL Server Express 2008.