Click here to Skip to main content
Click here to Skip to main content

Tagged as

SQL Server 2008 R2 – Unattended Silent Install

, 27 Sep 2010
Rate this:
Please Sign up or sign in to vote.
Unattended silent install of SQL Server 2008 R2

There is existing documentation on MSDN about How to: Install SQL Server 2008 R2 from the Command Prompt, but this post focuses on creating a silent unattended install of SQL Server 2008 R2 (Standard or Enterprise) using a configuration file. With the instructions below, you’ll be able to create a new customized SQL silent installation in minimal time. Note that the configuration below doesn’t work with the Express edition of SQL Server 2008 R2.

  • Run setup.exe
  • Click on the installation tab
  • Click “New Installation”
  • Go through the wizard: Enter product key, accept license, install setup support files, and select the features you want to install:

  • Continue the installation until you reach the “Ready To Install” step. Notice the path to the configuration file highlighted below in blue.

  • Now that you have the configuration file, copy it to your own folder or network share where you want to start the unattended installation.
  • Cancel setup since we’re interested in the unattended silent mode of installation; not the UI one.
  • Edit the configuration file as follows:
    • Set QUIET to “True”. This specifies that Setup will run in a quiet mode without any user interface (i.e. unattended installation)
      QUIET="True"
    • Set SQLSYSADMINACCOUNTS to “BUILTIN\ADMINISTRATORS”. This will ensure that administrators on the machine are added as members of the sysadmin role. You can set its value based on your needs (Example: SQLSYSADMINACCOUNTS=”domain\YourUser”), but this is the more generic approach.
      SQLSYSADMINACCOUNTS="BUILTIN\ADMINISTRATORS"
    • Add PID and set its value to your product license key. If your setup.exe already comes preloaded with the key, there is no need to add this option to the configuration file.
    • Add IACCEPTSQLSERVERLICENSETERMS and set its value to “True”. This is required to acknowledge acceptance of the license terms when the /Q (i.e. QUIET) parameter is specified for unattended installations.
      IACCEPTSQLSERVERLICENSETERMS="True"
    • Remove the ADDCURRENTUSERASSQLADMIN parameter. The reason is that this parameter can’t be used when SQLSYSADMINACCOUNTS is specified, and it only applies to Express installations.
    • Remove the UIMODE parameter as it can’t be used with the QUITE parameter.
    • Remove INSTALLSHAREDDIR, INSTALLSHAREDWOWDIR, INSTANCEDIR parameters since we want to install on the default installation directories.
    • That’s it. If you want to change the features that this setup will install, there is no need to go with the full steps again. You can simply change the value for the FEATURES parameter. For example, the features I selected (shown in the first screenshot above) will generate FEATURES=SQLENGINE,SSMS, ADV_SSMS in the configuration file. You can change that based on your needs. The full list of available feature parameters and their descriptions is located here.

After getting the configuration file ready, you’ll need to create a batch file that will run the silent unattended setup. Simply, create a new file  ”InstallSQL2008R2.bat” with extension = “.bat” with the following content, and make sure you replace <path to SQL setup folder> and <path to config file> with the proper values.

@ECHO off
echo Installing SQL Server 2008 R2
date/t
time /t
"<path to SQL setup folder>\setup.exe" /ConfigurationFile="<path to config file>"
date/t
time /t

All we’re doing in the script above is running SQL setup.exe and passing the configuration file as an argument to it. You can download both the batch and config files here.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Ali BaderEddin
Software Developer Microsoft
United States United States
http://mycodelog.com/about/

Comments and Discussions

 
QuestionUnattended Silent Install now work when starting setup from "Install custom action" PinmemberJaydeep Jadav27-Oct-12 0:08 
This is not working when we run setup from process.start from "Install custom action".
That will show up popup for setup manually.
AnswerSQL Server 2008R2 Express config file PinmemberMSoteros127-Jul-12 4:47 
AnswerRe: SQL Server 2008R2 Express config file [modified] PinmemberMichael900010-Jul-13 4:17 
QuestionPossible with mssql express PinmemberMember 81040403-Apr-12 21:50 
AnswerRe: Possible with mssql express PinmemberAli BaderEddin5-Apr-12 3:17 
GeneralRe: Possible with mssql express PinmemberMichael900010-Jul-13 4:21 
QuestionA plethora of thanks! PinmemberMember 147103920-Aug-11 14:18 
AnswerRe: A plethora of thanks! PinmemberAli BaderEddin20-Aug-11 21:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140827.1 | Last Updated 28 Sep 2010
Article Copyright 2010 by Ali BaderEddin
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid