Wednesday, March 7, 2012

installing SQL Express via commandline

So, I read this thread: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=416220&SiteID=1, which suggested that I could call SQLEXPR32.EXE (the SP2 download) with the relevant commandline args in exactly the same way I could call setup.exe. Namely, if I were to call:

Code Snippet

setup.exe /qb /settings "c:/setup.ini"

then I should be able to use

Code Snippet

SQLEXPR32.exe /qb /settings "c:/setup.ini"

where my setup.ini contains

Code Snippet

[Options]
ADDLOCAL=SQL_Data_Files,SQL_Replication,Connectivity
INSTANCENAME=AuctionI
SAPWD=auctioni_000
SECURITYMODE=SQL

However, this doesn't seem to be working at all - the commandline params to SQLEXPR32.EXE are completely ignored, and it runs as if they were not specified.

Would be great to get some help on this. I'm equally happy with the set of commands I need to call in order to extract SQLEXPR32 and then run setup, but SQLEXPR32 seems to extract to a random GUID dir, and automatically start setup, neither of which is condusive to automating it.

Thanks,

Dan

hi Dan,

you did not specify the /settings parameter, which identifies the template ini file to be consumed..

I just tested an installation as following:

c:\start /wait c:\share\sqlexpr.exe /qb /settings c:\share\sqlexpress.ini

[file sqlexpress.ini]
[OPTIONS]
ADDLOCAL=SQL_Engine
INSTANCENAME=MyInstance
SAPWD=auctioni_000
SECURITYMODE=SQL
[/file sqlexpress.ini]

and worked as expected..

regards

|||

Hi Andrea,

Isn't that exactly what I have in my code snippet? I have /settings "c:\settings.ini" right there... Also, the key here is that I want this to work with the SP2 download of SQLExpress, specifically, this file: http://go.microsoft.com/fwlink/?LinkId=65212

(not the files that are a result of extracting that file)

Probably I am missing something simple in your reply.

Thanks much,

Dan

|||-- bump --|||bump again|||

hi Dan,

Dan560472 wrote:

Hi Andrea,

Isn't that exactly what I have in my code snippet? I have /settings "c:\settings.ini" right there... Also, the key here is that I want this to work with the SP2 download of SQLExpress, specifically, this file: http://go.microsoft.com/fwlink/?LinkId=65212

(not the files that are a result of extracting that file)

Probably I am missing something simple in your reply.

Thanks much,

Dan

sorry, I've misread your post, but my test actually worked as expected... so the following question comes to mind.. is the setting file available and present in the target file system in order to be consumed by the setup?

regards

|||

Dan-

I am working with this exact process right now for an installation project in my office. In order to use the command line parameters you first have to extract the SQLEXPR32.EXE file by typing something such as c:\(dirname)\SQLEXPR32.EXE /X

Setup will then prompt you for a place to extract the files and you can then use the SETUP.EXE command from that folder with the /SETTINGS option. Hope this helps.

Braden

No comments:

Post a Comment