We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

chandrabhushan
Posts: 76
Joined: Thu Jul 02, 2015 10:58 am

Injecting SQL database in the user installed SQL server

Hi Team,
Thanks for the continuous support That helps us to create An very good installer .
I have a new requirement (Multi Database installer), As follows And i have to do it in following steps :-

1. In the choose component/installation it should ask for database choice for example SQL or H2 Db
2. My installer should be able to detect(Identify) that SQL Server is installed on the target system
2(A) - if no . it should pop up that its not installed .
2(B)- If yes it should show a dialogue to Enter the SQL Server credentials .
3. Post capturing the details installer should be able to connect to the machines Running SQL server and upload /Inject the .sql or Backup file to the sql server along with other installations simultaneously .

Please help me with this as it is an urgent requirement . Please reply as step by step .
chandrabhushan
Posts: 76
Joined: Thu Jul 02, 2015 10:58 am

Re: Injecting SQL database in the user installed SQL server

Hi,
Waiting for reply ..... :)
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Injecting SQL database in the user installed SQL server

Hi,

I apologize for the delayed reply.
1. In the choose component/installation it should ask for database choice for example SQL or H2 Db
I'm afraid that I do not fully understand this requirement. Can you please give me more details (maybe exemplify)?
2. My installer should be able to detect(Identify) that SQL Server is installed on the target system
To achieve this, you can go in the "Search" page and create a search that detects if any version of SQL Server is installed on the machine. For example, you can search for the following registry entries:

Code: Select all

HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\90\Tools\ClientSetup\CurrentVersion\CurrentVersion
HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\100\Tools\ClientSetup\CurrentVersion\CurrentVersion
HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\110\Tools\ClientSetup\CurrentVersion\CurrentVersion
HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\120\Tools\ClientSetup\CurrentVersion\CurrentVersion
2(A) - if no . it should pop up that its not installed .
You can add a "Display message box" custom action and attach it to a button or place it to be performed after a specific standard action. Also, use the properties of the above search as a condition for it.
2(B)- If yes it should show a dialogue to Enter the SQL Server credentials .
Add, the "SQLConnectionDlg" dialog in the "Dialogs" page, then right-click on it, use the "Show only if..." option and use the properties of the above search as a condition for it.
3. Post capturing the details installer should be able to connect to the machines Running SQL server and upload /Inject the .sql or Backup file to the sql server along with other installations simultaneously .
Go in the "SQL Databases" page, create a new SQL Connection and add the SQL scripts that you want to be executed. For more details you can take a look on the Configuring Databases with SQL Scripts tutorial.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
chandrabhushan
Posts: 76
Joined: Thu Jul 02, 2015 10:58 am

Re: Injecting SQL database in the user installed SQL server

Hi eisubie,
Thanks for detailed reply

There is a change in plan
1. i want my installer to detect that if SQL Server is running on target system . How to achive that .
I tried the custom action "detect service " but unable to understand how to use it .
2. i am planning to give radio button with two options
1. H2 DB -->
2. SQL Server
If user checks the sql server and (if finds running) then next button should take it to the sql connection dialogue and if (not running) exits installation .

Please help me with this
Thanks
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Injecting SQL database in the user installed SQL server

Hi,
1. i want my installer to detect that if SQL Server is running on target system . How to achive that .
I tried the custom action "detect service " but unable to understand how to use it .
If you want to detect if SQL Server is installed, you can search for the registry entries I mentioned in my previous post. If you want to detect if it is running on the machine, you can use one of the "Detect process" or "Detect service" custom actions.
2. i am planning to give radio button with two options
1. H2 DB -->
2. SQL Server
If user checks the sql server and (if finds running) then next button should take it to the sql connection dialogue and if (not running) exits installation .
The custom actions mentioned above return a property with the state of the process/service (i.e. AI_PROCESS_STATE or AI_SERVICE_STATE). You can right-click on the "SqlConnectionDlg" dialog, use the "Show only if..." option and use those property as a condition for it (i.e. AI_PROCESS_STATE = "Running").

Also, on the "Next" button of the dialog that contains the radio buttons, you can add a "Display error message" custom action which will be executed only if the process is stopped (i.e. AI_PROCESS_STATE = "Stopped").

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
chandrabhushan
Posts: 76
Joined: Thu Jul 02, 2015 10:58 am

Re: Injecting SQL database in the user installed SQL server

Thanks for the reply.
I want to use Selection tree (Drop Down) to choose the database type (H2,SQL,DB2) in my installation . But it automatically takes the features list , Please note that i am already using Selection tree for choose feature.
Please tell me how i can implement another choose database (selection tree) for my installation .
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Injecting SQL database in the user installed SQL server

Hi,

I'm afraid that the "Selection Tree" control can be used only for displaying and modifying the state of all the features available in the package. It cannot be used for displaying only some features.

For this you can use check boxes or a check list, then use their properties as a condition for your databases.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”