Monday, March 19, 2012

How to Redistribute sqlExpress

Hi,

I asked this question in another thread that was already going but has had no activeity for a month or so..

I have read the command line artical and the clickonce artical about installing the sqlExpress on the client as a silent install. There are alot of holes in the articals and i am in big time need to get this resolved.

I would like someone to point me in the right direction on:

1. Client install sqlExpress from a link from my site ( with only click here type prompts )

2. Client install sqlExpress from msi that is with my application

3. The absolute mininum componets for sqlExpress to run on the client

4. Is it possiable to install sqlExpress in my application directory and not under the clients G:\Program Files\Microsoft SQL Server ?

*I only need to be able to mirror the exact tables and sprocs so that my clients can work in a disconnected enviroment.

NO problem with reading what every it takes; i just need to be pointed in the right direction.\

HELP! HELP! HELP!

Erik

Hi Erik,

You might find some value in the Embedding white paper and from the Embedding web cast (source code from webcast). These don't specifically discuss web deployment, but they will provide more general information. Since you are only trying to create a local data store for working off line, you might want to consider SQL Everywhere Edition. SQL Everywhere is a light weight database engine that is designed specifically for the task you describe. It doesn't support sprocs, but you can often handle logic directly in your code rather than a sproc. It's a design decision, but you should check out the information. It's is currently in Communit Technology Preview and is available for evaluation and testing. Like SQL Express Everywhere Edition will be free for development and deployment.

I'll attempt to answer your questions below:

1. Client install sqlExpress from a link from my site ( with only click here type prompts )

ClickOnce can set this up automatically for you, so it would help to know what else you need that ClickOnce doesn't do. The smallest thing you need is a link to the installer file. When a user clicks it, the user is prompted to either Run or Save the file. If they click Run, the installer will run in full UI mode. This is effectively what happens when you click the download link on the SQL Express download page.

If you want to hid the UI, then you need to write your own wrapper that will launch the SQL Express installer using the correct command line parameters. (The Embedding white paper will help with wrapper functions.) This is actually how VS Express installation works. When you install it from the web, you are actually downloading a wrapper program that performs some system checks and then gives you some options. Based on the options, it then downloads the appropriate program installers (i.e. VS and SQL) and runs them. If fact, the VS Express wrapper runs SQL Express in quite mode.

If you go the wrapper route, you'll need to make sure your wrapper checks for pre-requisites such as .NET Framework 2.0 and Windows Installer 3.1. This means the wrapper has to be native code rather than managed code. If you can be sure that the target computers have these pre-requisites installed, then you don't have to worry about them, but most the time you can't ensure this.

2. Client install sqlExpress from msi that is with my application

This can't be done. MSI does not support calling other MSIs, hence the wrappers that we always use to call multiple MSIs in order. This is called chaining. Again, ClickOnce does this for you automatically by creating a wrapper that will chain together pre-requisite such as the framework, the SQL installer and your application installer.

3. The absolute mininum componets for sqlExpress to run on the client

The minimum requirements are the SQL Engine, you can install this using the command line:

SQLEXPR.EXE /qn /ADDLOCAL=Sql_Engine INSTANCENAME=SQLEXPRESS

Everything you need will be installed.

4. Is it possiable to install sqlExpress in my application directory and not under the clients G:\Program Files\Microsoft SQL Server ?

Yes, there is a command line argument to control this, I think it is SQLINSTALLDIRECTORY or something equally clever. You can find it in the command line topic in Books Online.

If you're intersted, here are a couple blogs that discuss SQL Everywhere Edition.

Steve Lasker's Blog

SQL Everywhere Edition team blog

Mike

|||

Thank you very much for the reply Mike....

I was not aware of the post untill today...

I have spent about two weeks now strictly windows and command line operations perparing for this sql install... Even thow it will be about three months untill i will release my programs i needed to get a heavy duty soaking in the windows world.. I have worked with the web apps for about two years and i really like the windows app... :)

Your response is going to help me very much... Thanks a lot for taking the time to write this becuase this is such a big part of my solution.

Thanks,

erik

I might have more questions in a day or so...( i posted another one earlier today about how to get the value from the win calculator... after digging deep into the win world i see the usefullyness of interop ).. Dam! can;t be satisfied with just out of the box :)

The SQL Everywhere is extreamly attractive; however, i need just a little bit more than what it has to offer....

No comments:

Post a Comment