PDA

View Full Version : Installing SQL Express



notlogan
09-06-2013, 11:28 AM
Currently our application will be installed on multiple workstations - I have that handled pretty well. We are pre-installing .net redistributable if necessary and that works well.

We need to install SQL Express once per network - if not already present. Currently we copy the Microsoft Install to the DVD and let the user click it if necessary.

My question is would we be better served in terms of ease of use and professional appearance to install the SQL redistributable as an optional in Setup Builder?

linder
09-06-2013, 12:30 PM
Hello,

What about an option in the install. For example, a dialog that displays two radio buttons:

- Workstation Install
- SQL Express Install (Network)

Then, depending on the selection, do the workstation or network install from your setup.exe.

Friedrich

notlogan
09-11-2013, 12:09 PM
That might work. Would that be handled in the "Features" section or Setup Types?

linder
09-12-2013, 12:58 AM
You can handle this via "Features" or a simple "If Statement".

Friedrich

notlogan
09-18-2013, 09:34 AM
I want to give the users two options:
1. Install application.
2. Install SQL server.

If I use the Features will that give the user radio buttons to click?

If I install SQL server I'm going to do a command line installation. I assume I can execute a command from Setup Builder that will install SQL.

linder
09-18-2013, 10:17 AM
Hello,

You can do both exclusive options or multiple selections. If you would like to provide exclusive options, you can display radio buttons. If you would like to provide multiple selections, you can use checkboxes.

You can use Features and then enable/disable it programmatically (based on the radio/checkbox values). Absolutely no problem.

You can do command line installations from within your install without any problem. In fact, all redistributable installations are command line (behind-the-scenes) installs.

Does this help?

Friedrich

linder
09-18-2013, 11:04 AM
BTW, if you are interested in a 'quick and dirty' example on how to do the Features stuff, just let me know and we'll create an example project for you (exclusive radio options or multiple checkbox selections?).

Friedrich

notlogan
09-18-2013, 11:20 AM
An example would be great.

We're trying to decide the best way to go but the easiest will probably be a check box for each.

Because it might take very long to download SQL from the internet we were going to include SQLEXPRADV_x86_ENU on the installation disk. Will I have to copy that to the user's hard drive or can I run it from the disk?

This is our command script:

SQLEXPRADV_x86_ENU /ACTION=Install /FEATURES=SQL /INSTANCENAME=DataBinder /SQLSVCACCOUNT="NT AUTHORITY\LOCAL SERVICE" /SQLSYSADMINACCOUNTS=BUILTIN\ADMINISTRATORS /IACCEPTSQLSERVERLICENSETERMS=True /NPENABLED=1 /TCPENABLED=1 /QS

notlogan
09-18-2013, 01:15 PM
I set up Features and Setup Types to choose app, SQL, or both. Now I need to "wire them up" so the selected options are installed.

So I created:

If Feature "SQL Server" selected Then
Run i want to run a command from the installation media - don't know if this is possible...do I have to copy the command & SQL files to the destination computer first??? If so I might just tank this entire attempt and just have the users hit SQL from the CD prompt if they want to install SQL...

Elseif Feature "application" selected Then
create folders
install files
create shortcuts

Else (both)....... I get lost here....I don't want to copy the 30 or 40 files I'm installing into this if block along with the SQL command....is there an OR condition???***or can I have a setup type list that is check boxes instead of radio buttons. that would solve this problem.
End

notlogan
09-19-2013, 06:14 AM
After setting up my features and types I don't see anything in the script that would indicate conditional installation based on type selection. I need to install and/or run a command; not sure where to do it.

linder
09-19-2013, 06:58 AM
Working on a demo project for you right now :) No need to use Setup Types in your case; Features are the way to go.

BTW, Setup Types are based on Features. You select the Features that you would like to associate with each Setup Type. Wen an end user selects a certain Setup Type, only those features that you associated with that Setup Type are installed.

Friedrich

notlogan
09-19-2013, 07:57 AM
I might have done it....checking SQL script functionality now....

It took me a while to notice the piping character in a screen shot on check boxes. It wasn't clear in the help files that options were generated by the piping character. I kept looking for a way to enter a number.

So I created a runtime variable %checkboxresult%, initialized it to 00 then added a check box dialog. then I added If %checkboxresult equals "1" on position "1" then......install the app.
Elsef ... equals "1" on position "2" run command line.....

checking now....

linder
09-19-2013, 08:15 AM
Because it might take very long to download SQL from the internet we were going to include SQLEXPRADV_x86_ENU on the installation disk. Will I have to copy that to the user's hard drive or can I run it from the disk?

No need to copy it to the user's hard drive. Because it is a hefty 700MB-800MB redistributable, I would not embed it into the setup.exe. You can launch it directly from the installation medium (DVD/USB/etc.).

Friedrich

linder
09-19-2013, 08:33 AM
You are too fast for us <bg>. I think you do not need the project any more :) Good job!

BTW, see attached screenshots. You have several completely different options to handle all this. For example, the "Set Feature State..." script function to enable Features programmatically at runtime. But of course, the standard "If/Then/Else" Statements will also work fine!

Friedrich

linder
09-19-2013, 08:40 AM
And to run the SQLEXPRADV_x86_ENU redistributable from the source disk, you can use the %CURDIR% variable.

For example, if you have this:

setup.exe
SQLEXPRADV_x86_ENU.exe

You can use: %CURDIR%\SQLEXPRADV_x86_ENU.exe

Or if you have:

setup.exe
..\SQLServer\SQLEXPRADV_x86_ENU.exe

You can use: %CURDIR%\SQLServer\SQLEXPRADV_x86_ENU.exe

Friedrich

notlogan
09-19-2013, 09:01 AM
My way didn't work so well.....since I didn't enable the app feature it didn't install....I either have to delete features and go with if blocks around my files or go with your method.

linder
09-19-2013, 09:18 AM
If you are interested, I have uploaded the project (it's quick and dirty):

http://www.lindersoft.com/projects/FeaturesDemo_20130919A.zip

There are thousands of possible options to fine tune it :) Just let me know if you have any question.

Friedrich

notlogan
09-19-2013, 09:29 AM
Thanks. We fixed it. We had to put the app files back into the Always Install folder and wrap it inside the If block. The SQL command runs in it's own If block. There really are a lot of ways to get to the same end point. We're very pleased with our decision to go with SetUp Builder. (I'm still upset that Microsoft included a different "free" install builder app in Visual Studio that is totally worthless. I wasted a couple weeks trying to get that program to even do a basic install.)


I have one very minor thing I'm looking at. SQL takes fifteen or twenty minutes to install. At different times SQL windows pop then go away. There are times when the only dialog box on the screen is the Setup Builder Installing box that says "files are copying". This is not technically correct as the app files have long since been copied. It might appear the setup has frozen. Is there a way to force close that box and/or pop another box with "SQL is installing" to overwrite the previous box?

linder
09-19-2013, 10:20 AM
Thanks for your kind words :)

I would suggest to close the standard Progress Dialog ("Progress Dialog: Close") and display a "Wait Dialog..." instead (with "Start on separate thread" enabled). You can change the status text before you start the external SQL install (silently).

You can also change the status text in the standard Progress Dialog ("Progress Dialog: Status Text") but the recommended way is to display the Wait dialog.

What do you think?

Friedrich

notlogan
09-19-2013, 10:59 AM
Prefect. You guys ROCK! (I already told the software company we share a building with to check you out next time they need an install program.)

notlogan
09-19-2013, 12:54 PM
Another glitch.

I had been using the Run Command Line with %SRCDRV% command.....to install SQL. I added a few more parameters to my command and it overflowed the buffer. Can I use the Run Program command with %SRCDRV%SQL.cmd?

notlogan
09-19-2013, 01:08 PM
never mind last post.....run program worked....had to specify SQL.cmd on File Name line and %SRCDRV% on Target Folder line.

I was trying to do %SRCDRV%\SQL.cmd on File Name line.....which is what the script ends up doing anyway.....

linder
09-20-2013, 10:43 AM
Thanks for the update!

Friedrich