1

I am creating an automated build of SQL Server installation which is run from a batch file. Is there any way to change the registry, or other method, of deciding which SQL Server edition (Either Enterprise or Standard) will be installed, or are the two versions still separate builds?

If they are separate builds, I guess I could get around it, by having a "master" batch file call an appropriate "child" batch file, but this would mean having a folder which contains both sets of binaries, which I rather avoid.

3
  • 1
    What media are you using? MSDN ISOs are pre-pidded, and the bits matter; retail media should ask for a license key, and this is what drives the edition (there's nothing in the registry before the installation). Commented Apr 23, 2013 at 19:50
  • Just curious, are you writing your own automated deployment build for SQL Server ? If that is the case, have you looked at SPADE sqlspade.codeplex.com. Its already out there and uses PowerShell.
    – Kin Shah
    Commented Apr 23, 2013 at 19:53
  • @AaronBertrand It is the ISO. Volume licensing Commented Apr 23, 2013 at 20:16

2 Answers 2

1

Per my answer here, the installation media contains every edition, and it's the licence key that dictates which licenced edition is available. The ISO you get from MSDN comes with a key for the edition specified on MSDN, but the key can be replaced with any valid key, as it's in a configuration file.

If you need to deploy an arbitrary licenced edition, you'll need to collect a set of licence keys for each edition you want to deploy, then use conditional logic in your scripts to use whichever one is appropriate.

The main piece you're missing, though, is to perform an edition upgrade. This will take the default install from Enterprise Evaluation to the edition defined by the licence key provided.

Here's the relevant part of the script I used in such a deployment, that uses the licence key that was provided with the installation media (presumably, you'll want to modify that part):

"C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\SQLServer2008R2\Setup.exe"
    /ACTION="Upgrade" /QS /CONFIGURATIONFILE="%installMediaPath%\x64\DefaultSetup.ini"
    /INSTALLMEDIAPATH="%installMediaPath%\x64\Setup" /INSTANCEID="MSSQLSERVER"
    /INSTANCENAME="MSSQLSERVER" /IACCEPTSQLSERVERLICENSETERMS

Note the presence of the user-defined variable %installMediaPath%, which I assume you'll have in your script. This script was written for 2008 R2, but I think it should work with 2012 (untested).

0

Yes, you can read from the registry code similar to this.

long tLong = (long) Microsoft.Win32.Registry.GetValue(keyName, "TestLong",
            long.MinValue);

Then you can use an "if" statement to determine what to do next.

1
  • Thanks but as Aaron says above, there will be nothing in the registry to read at this point. My comment refering to registry was more about - If the version cannot be selected during the silent instal, can it be chaned post install Commented Apr 23, 2013 at 20:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.