cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bigdavelamb
Level 3

Install SQL Server Express 2008 if feature selected

Hello

I am trying to figure out the best way to install SQL Server Express 2008 if the user selects a feature or maybe an option in a custom dialog.

I then wish to run some SQL scripts (which include creation of a database) on the new instance or existing instance(depending if they chose to install SQL Server or not). I do not want to use prerequisites as they may have SQL 2008 installed but wish to put our scripts into a new instance and therefore I need the option to install SQL Server Express or use an existing instance.

It would be handy to install the Management Studio as well but not essential at this point! Any help would be brilliant as I have been scratching my head all day thinking what would be the best way to accomplish this (I am using MSI Basic, but could switch if it makes things easier).

Thank you.
David
Labels (1)
0 Kudos
(6) Replies
hidenori
Level 17

You may want to consider using Feature Prerequisites in order to accomplish your requirement. You can use the standard feature selection dialog or you can have a custom dialog to change the feature state so that a new instance of Microsoft SQL Server 2008 will be installed based on your end user's input.

Hope that helps.
0 Kudos
bigdavelamb
Level 3

Hi hidenori

You are correct, I did not know you had all that control on prerequisites on what conditions to launch under. Thank you for the help.

David
0 Kudos
bigdavelamb
Level 3

Hi

As part of this prerequisite, I am running SQL installer with additional command line syntax however I would like to replace the instancename with a name that the user types in via a textbox dialog, I have tried:

/qs /ACTION=Install /FEATURES=SQLENGINE /INSTANCENAME=%MYTEXTBOXPROPERTY% /SQLSVCACCOUNT="NT AUTHORITY\Network Service" /NPENABLED=1 /TCPENABLED=1 /ADDCURRENTUSERASSQLADMIN="True" /INDICATEPROGRESS

However the value %MYTEXTBOXPROPERTY% remains the same and never gets replaced, is this actually possible?

Thanks.
David
0 Kudos
hidenori
Level 17

%MYTEXTBOXPROPERTY% will be expanded as an environment variable. In order to specify a property, you need to enclose the name with square brackets as follows:

/qs /ACTION=Install /FEATURES=SQLENGINE /INSTANCENAME=[MYTEXTBOXPROPERTY] /SQLSVCACCOUNT="NT AUTHORITY\Network Service" /NPENABLED=1 /TCPENABLED=1 /ADDCURRENTUSERASSQLADMIN="True" /INDICATEPROGRES
0 Kudos
mike1983
Level 3

0 Kudos
bigdavelamb
Level 3

Thank you hidenori - works a treat!
0 Kudos