mike@wdgcorp.com
Posts: 9
Joined: Mon Jan 22, 2007 9:39 pm

SQL Server 2005 Express Install through custom action fails

I would like to give the end user the option to install SQL Server 2005 Express. This is because we are trying to give demo users a choice between a client or a server install. I don't want to install SQL Server 2005 Express as a prerequisite, unless I have to.

I have 4 checkboxes for .NET 2.0 Framework, Windows Installer 3.1, MDAC 2.8 and SQL Server 2005 Express. If the associated checkbox is selected, via an UI Custom Action (Add Predefined Custom Action, Launch File or Open URL) the product is installed (that's the plan, at least.)

The installs for the SQL Server 2005 Express prereqs (NET FW, WI 3.1 & MDAC 2.8) finish successfully but SQL Server 2005 Express fails.

I have tried 2 different methods for SQL Server install.
1. Launch SQLEXPR.exe. This failed with:
MainEngineThread is returning 110
The system cannot open the device or file specified.

2. I exploded the files out of SQLEXPR.exe. I can install with these files by clicking on setup.exe. But when I included all these files into my install package & ran it I just get a messagebox saying setup failed.

It looks to me, from my research, that this can't be done this way. I would appreciate any feedback if someone has succeeded with this.

Thanks
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

My suggestion is to use prerequisite to install other softwares before your main package does. Also note that two MSI files can not be installed at the same time.

However if you really want to install SQL Server as custom action then you need to schedule it under "InstallFinalize" standard action and use "Asynchronous execution, do not wait for return" as "Execution Properties".

Best Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
mike@wdgcorp.com
Posts: 9
Joined: Mon Jan 22, 2007 9:39 pm

I tried this but install failed in the same ways as before.
mmihalca
Posts: 1
Joined: Sun Feb 04, 2007 4:21 pm
Contact: Yahoo Messenger

SQL Server Express as Prerequisites

My first choice of installing SQL Server Express was to instal it as a prerequisite application.

First step was to get the new version of SQL Express 2005 SP1 so my application will work on fista. Then I downloaded the trial version of Advance Installer.

I've added SQLExpr.exe as a prerequsites but this application starts every time. Even when SQL Express is already installed. This was not a suprise becouse I espected that. My problem is that I could not find a condition that will stop my installation if SQL Express is already instaled. I searched the forum for "SQL Espress" and I can tell you that none of the suggestion given here do not work. So on my opinon we can not do this for GUI.

I already have a .Net C# dll that can determine if SQL Express is installed (based on Microsoft recomandations), but I don't know (yet) how to use this MSI istaller class with AI.

I can not give up until I found a way to safely and properly install SQL Server Express as a prerequisites on the client's computer. After I will succed I wil get back to you with details.


PS: by the way guys from Caphyon: I am proud of you. I represent a Romanian company and I am proud to find other companies that sell software insted of the same old outsourcing. :D

MariusM
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

In the next version of Advanced Installer multiple conditions, search for a ProductCode, return code of an EXE, will be supported as "Installation Conditions" for a prerequisite. Then you will have more options to determine the version of "SQL Espress".

Best Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
mike@wdgcorp.com
Posts: 9
Joined: Mon Jan 22, 2007 9:39 pm

gigi wrote:Hi,

My suggestion is to use prerequisite to install other softwares before your main package does. Also note that two MSI files can not be installed at the same time.

However if you really want to install SQL Server as custom action then you need to schedule it under "InstallFinalize" standard action and use "Asynchronous execution, do not wait for return" as "Execution Properties".

Best Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
Thanks Gigi. I finally got this to work.
Here is what I did.
I exploded out the files from SQLEXPR.exe with SQLEXPR.exe /X.
Then I made a custom action 'EXE with woeking directory' in InstallFianlize as Gigi said to do. The file I am executing is setup.exe.

Thanks, again.
EricNguyen
Posts: 21
Joined: Sat Feb 17, 2007 1:58 am

Hi Gigi,
Why do we have to do it in Install Finalize? In the case that I have to install database server (on user selection, of course - so no, can not put in Prerequisite) but then I also need to run some SQL script, if I install DB server in Install Finalize then do I have any chance to execute my script?
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

The recommended way to install other required applications with your package is to use prerequisites. Note that in the next version of Advanced Installer multiple conditions, search for a ProductCode, return code of an EXE, will be supported as "Installation Conditions" for a prerequisite. Then you will have more options to determine the version of "SQL Espress".
Why do we have to do it in Install Finalize?
Two MSI file can not be installed at the same time unless you schedule it under "InstallFinalize" and use "Asynchronous execution, do not wait for return" as execution properties.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
gsmmc
Posts: 7
Joined: Wed Feb 28, 2007 11:42 pm

Hi gigi,
I stumbled upon your product today looking for a solution to our install needs and found it to be extremely easy to use, intuitive and quick compared to everything else i've tried. (Wise, InstallShield, InstallAware, and more...)

The particular issue described in this thread is the only roadblock that's preventing my purchasing and using the product...

If it's possible in a future version to provide a "None" option in the Install Conditions Criteria that will execute that prerequisite once no matter what every time the install is run, this issue could be resolved smoothly.

The problem with "checking" for the existence of SQL Server Express is that another instance may exist that has installed the application, so everything checks out, but your instance has not been installed. You really need to be able to execute that SQL Server Express install no matter what to make sure your instance is installed. (If it already exists, the SQLEXPR32 install just finishes anyway)

Using the solution proposed in this thread, executing the SQL Server install using a custom action at the end of the install, prevents the ability to make use of the SQL Scripting to actually do something with the SQL Server instance that you're installing. (Unless i'm missing something).

Thanks for your time,
GS
gsmmc
Posts: 7
Joined: Wed Feb 28, 2007 11:42 pm

You know... i've found a pretty simple resolution for the time being. Although i'd still rather use the method described in my post above, for anyone else that's having problems with this it can probably be resolved by doing this:

1. Add a prerequisite for SQL Server Express
2. Add an Install Condition with these options
a) Criteria: Registry Value
b) Registry Value: HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\YOURINSTANCENAME\MSSQLServer\CurrentVersion\CurrentVersion
c) Minimum: The value of your SQL Server Express install (mine is 9.00.3042.00). You may need to install the your SQL Server Express instance once and navigate to the above registry key just to verify.

Make sure to substitute the YOURINSTANCENAME for whatever the instance name you're using is and this should work reliably (for now, until Microsoft decides in the next SQL Server service pack to use a different registry method)

Hope this helps someone,
GS

Return to “Common Problems”