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

Inno Setup Script to Install SQL Server 2008 R2 with Tools

, 1 Dec 2013 Public Domain
Rate this:
Please Sign up or sign in to vote.
Inno Setup script to install SQL Server 2008 R2 with Tools, creating an instance with special rights and displaying the log.

Introduction

If you want to distribute your program with SQL Server, it's nice for the end user to have an installer that silently does the hard work like choosing the right options and set an instance name.

Prerequisites

You need the Inno Setup installer which can be found on SourceForge:

SQL Server 2008 R2 with Tools can be downloaded from

Background

For my purposes, I needed to install a Windows Service that could connect to SQL Server, which is not possible with a default installation of SQL Server 2008 or higher.

The following option sets the right authorization level:

/SQLSVCACCOUNT="NT AUTHORITY\SYSTEM"  

Using the Code

The example code is for 64 bits installation only.

Compile the following Inno Setup script to create the setup.exe:

;
; Inno Setup script to install SQL Server 2008 R2 with Tools.
; (see download link below for details)
; Shows the install log summary after install.
; 
; Creates instance MYINSTANCE
; Log in from SMSS with: <Computername>\MYINSTANCE
;
#define MyAppName "SQL Server 2008 R2 with Tools"
#define MyAppVersion "1"
#define MyAppPublisher "Test"
#define MyAppURL "http://www.microsoft.com/en-us/download/details.aspx?id=23650"

[Setup]
AppId={{84CDA882-8CF1-4487-85AB-DF7BA0741D2A}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
CreateAppDir=no
OutputBaseFilename=setup
Compression=none
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Files]
Source: "SQLEXPRWT_x64_ENU.exe"; DestDir: "{tmp}"; Flags: ignoreversion

[RUN]
Filename: "{tmp}\SQLEXPRWT_x64_ENU.exe"; 
Parameters: "/Q /IACCEPTSQLSERVERLICENSETERMS /ACTION=Install /FEATURES=SQL,
Tools /INSTANCENAME=MYINSTANCE /SQLSVCACCOUNT=""
NT AUTHORITY\SYSTEM"" /SQLSYSADMINACCOUNTS=""BUILTIN\ADMINISTRATORS"" 
/AGTSVCACCOUNT=""NT AUTHORITY\Network Service"" "; Check: IsWin64()
Filename: "Notepad.exe"; 
Parameters: "{pf}\Microsoft SQL Server\100\Setup Bootstrap\Log\Summary.txt";

Points of Interest

Of course, you could also use a batch file to install SQL Server this way.

Be aware that most versions of SQL Server have slightly different command line options if you are planning to use another version than SQL Server 2008 R2 !

History

  • Version 1

License

This article, along with any associated source code and files, is licensed under A Public Domain dedication

Share

About the Author

RickZeeland
Software Developer
Netherlands Netherlands
Software developer C#, C++, VB, ASP, SQL Server.

Comments and Discussions

 
GeneralInno Setup Script to Install SQL Server 2008 R2 with Tools Pinmembert.alkahtiri10-May-14 1:16 

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 | Terms of Use | Mobile
Web01 | 2.8.1411028.1 | Last Updated 1 Dec 2013
Article Copyright 2013 by RickZeeland
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid