jrgrady
Posts: 6
Joined: Thu Jul 24, 2008 4:31 pm

Install SQL Express through Custom Action

Hi,

I would like to ask the user if they would like to install SQL Express (via checkbox). How should I go about doing this?
jrgrady
Posts: 6
Joined: Thu Jul 24, 2008 4:31 pm

Re: Install SQL Express through Custom Action

After posting I realized that I was not very specific......I need to know how to execute the SQL Express executable from a checkbox? Is this possible?
jrgrady
Posts: 6
Joined: Thu Jul 24, 2008 4:31 pm

Re: Install SQL Express through Custom Action

OK...I have figured out how to kickoff the SQL Express executable from a checkbox using the "Launch File" custom action.....however, whenever I cancel the SQL Express setup..the Installer throws an error. How do I prevent the error from happening?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Install SQL Express through Custom Action

Hi,

Please note that you can use the "SQL Server 2005 Express" predefined prerequisite. This will prompt the user about installing SQL Express if it's not found on the target machine. This prerequisite will have a checkbox (checked by default) in the prerequisites wizard. Therefore, the user can choose to not install SQL Express.
whenever I cancel the SQL Express setup..the Installer throws an error.
This is because of the return code of the SQL Express installation. Please set the custom action to use the "Synchronous execution, ignore return code" option and let me know if the problem persists.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jrgrady
Posts: 6
Joined: Thu Jul 24, 2008 4:31 pm

Re: Install SQL Express through Custom Action

Hey Cosmin,

Thanks for the reply.
This prerequisite will have a checkbox (checked by default) in the prerequisites wizard.
Is this in design mode where I will see this?
This is because of the return code of the SQL Express installation. Please set the custom action to use the "Synchronous execution, ignore return code" option and let me know if the problem persists.
Is it possible to run the SQL Express executable while another MSI is running? I have read where this may not be possible...can you confirm?

Thanks
James
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Install SQL Express through Custom Action

Hi James,
Is this in design mode where I will see this?
Please note that the prerequisite wizard cannot be edited. Also, it is shown only when a prerequisite needs to be installed.
Is it possible to run the SQL Express executable while another MSI is running? I have read where this may not be possible...can you confirm?
The SQL Express installation package is MSI-based, therefore it cannot run while your main package is being installed. You could use a custom action to launch it after the installation is complete, but it is recommended to use prerequisites.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jrgrady
Posts: 6
Joined: Thu Jul 24, 2008 4:31 pm

Re: Install SQL Express through Custom Action

What I am trying to understand, is how to accomplish what this post is referring to - http://www.advancedinstaller.com/forums ... sql#p16779.

It seems that they are going to give the user an option (with a custom message) before installing SQLExpress, but how it that possible if you can't edit the prereqs screens and you can't launch the sql install during your own install? We are going to run sql scripts during the install, but we would like to allow the user to use an existing sql install (anywhere on the network), or install a new instance of sql express.

Thanks a lot for the help.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Install SQL Express through Custom Action

Hi,
It seems that they are going to give the user an option (with a custom message) before installing SQLExpress,
Actually, this is not specified in the post you mentioned. The user asked for a way to detect SQL Express in order to show a custom text message, not to install SQL Express.
We are going to run sql scripts during the install, but we would like to allow the user to use an existing sql install (anywhere on the network), or install a new instance of sql express.
Although it is not recommended, you can try this approach:
- create a custom dialog which has a checkbox
- set the property of the checkbox to SQL_CHECK
- set the text of the checkbox to something like this: "Install SQL Express"
- go to the Custom Actions page
- use the "Show standard action button on the toolbar to show the "InstallIIS" standard action
- create a new "Launch file or open URL" custom action under it
- set the "Command Line" field to the full path of the SQL Express installation package (for example, if its next to the MSI you can use [SourceDir]SQLEXPR.EXE)
- select the "Asynchronous execution, do not wait for return" option
- set the "Expression" field to:

Code: Select all

(Not Installed) AND (SQL_CHECK)
This way, if the user checks the checkbox which has the property SQL_CHECK, the custom action will run and it will launch the SQL Express installation. Also, since it is launched after the "InstallIIS" standard action as asynchronous, it will not be executed at the same time with the main installation.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jrgrady
Posts: 6
Joined: Thu Jul 24, 2008 4:31 pm

Re: Install SQL Express through Custom Action

cosmin wrote:Hi,
It seems that they are going to give the user an option (with a custom message) before installing SQLExpress,
Actually, this is not specified in the post you mentioned. The user asked for a way to detect SQL Express in order to show a custom text message, not to install SQL Express.
We are going to run sql scripts during the install, but we would like to allow the user to use an existing sql install (anywhere on the network), or install a new instance of sql express.
Although it is not recommended, you can try this approach:
- create a custom dialog which has a checkbox
- set the property of the checkbox to SQL_CHECK
- set the text of the checkbox to something like this: "Install SQL Express"
- go to the Custom Actions page
- use the "Show standard action button on the toolbar to show the "InstallIIS" standard action
- create a new "Launch file or open URL" custom action under it
- set the "Command Line" field to the full path of the SQL Express installation package (for example, if its next to the MSI you can use [SourceDir]SQLEXPR.EXE)
- select the "Asynchronous execution, do not wait for return" option
- set the "Expression" field to:

Code: Select all

(Not Installed) AND (SQL_CHECK)
This way, if the user checks the checkbox which has the property SQL_CHECK, the custom action will run and it will launch the SQL Express installation. Also, since it is launched after the "InstallIIS" standard action as asynchronous, it will not be executed at the same time with the main installation.

Regards,
Cosmin
Thanks Cosmin....I will give this a shot. :D

Return to “Common Problems”