Problem: Can I silently deploy SQL Express?
Solution: Yes you can, read on…..
Here’s how I did it…
So, firstly you’ll need to download SQL Express, in this example I’m going to use SQL Express 2012 SP1.
This is available for download from here: http://www.microsoft.com/en-gb/download/details.aspx?id=35579.
First thing you need to do is create a configuration file for silent install. This can be run by opening a command prompt browsing to the folder you stored your five files and running the following command:
This will launch the set up for you, you must now follow it through to the last step (Ready to Install)
Take note of the path highlighted above. Browse to this location and copy this configuration file.
You’ll need to edit this file because it wont be quite right for what you want. So let’s crack it open and take a look. First thing you’re going to have to do is add on the end the following:
This will ensure when you throw the silent install command that it wont fail on this.
If you’re like me you’ll want the Management Tools installing so you’ll need to add “,ADV_SSMS” to the end of this:
Also make it truly silent by ensuring this setting is present:
You’ll need to comment out the UI mode setting as this will cause an error when deploying so edit as such:
(Notice the semi-colon a the beginning of the line, it (for some reason) isn’t commented out on the auto-generated configuration file.
You’ll probably require Named Pipes enabled so lets edit that section:
and finally I changed the admin account to mimic your environment:
Now I did read that you can approach this last section by adding “%username%” but of course that’s only going to work for you if that’s what you want.
I wrote a quick powershell script to edit the SQLSYSADMINACCOUNTS section to what I needed, this probably wont be your approach as its pretty specific to my place of work, however if you do use the –replace operator on a ForEach statement remember that the is a special character which will need to be escaped, therefore don’t replace “DOMAINAdministrator” instead replace “DOMAIN\Administrator” (note the double slash)
One final thing, I used the VB wrapper by Johan Arwidmark (Thanks Johan!) to install it. Personally my Powershell script edits the ConfigurationFile.ini and then calls the VBwrapper. In the VBwrapper ensure you edit…
<script language=”VBScript” src=”……ZTIUtility.vbs”/> – To point to your ZTIUtility.vbs location properly
and keep an eye on the file names in the script. wrapper.wsf (2.7KB)
OK so how do we deploy it? well that depends on which direction you chose, first I would test either calling the VBwrapper or running your powershell script to make changes and then calling the VBwrapper (I’d be happy to try and help if anyone needs it). Thereafter you can place the downloaded SQL files, the VBWrapper, your configuration file and your powershell script into a single folder and add them in as an application calling whichever script you need to use.
I hope this helps.