Stevo3000
Posts: 30
Joined: Fri Jan 23, 2009 12:00 pm

Install SQL Express as a Feature

Hi,

We use AI to distribute our flagship product which comes in standalone, server and client flavours. We use a single installer with a feature for each version. This is important as some customers can have more than one feature and they must be able to install in one process. We need the ability to install SQL Express as a custom action as the client version does not need it.

The installer must run on Windows 2000 onwards.

Regards,
Steve Hipwell
Farmade Management Systems Ltd
Bogdan
Posts: 2791
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Install SQL Express as a Feature

Hi Steve,

Here is what you could try:
-- you can add the SQL package as an Attached Custom Action under the InstallFinalize standard action in the InstallExecuteSequence
-- please note that the Execution Properties group should have selected the radio button "Asynchronous execution, do not wait for return."
-- the Condition field of the custom action should contain the Feature State of the desired feature
-- the Feature State can be picked using the Edit Condition dialog

Please let me know if you have any questions.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Stevo3000
Posts: 30
Joined: Fri Jan 23, 2009 12:00 pm

Re: Install SQL Express as a Feature

Hi,

How can we check the registry to decide if the custom action should be activated?

Regards,
Steve Hipwell
Farmade Management Systems Ltd
Bogdan
Posts: 2791
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Install SQL Express as a Feature

Hi Steve,

You can check the registry using a registry search in the Search page. The name of the search is actually an installer property which will contain the result of the search.
If it is empty then it means SQL Express is not installed.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Stevo3000
Posts: 30
Joined: Fri Jan 23, 2009 12:00 pm

Re: Install SQL Express as a Feature

Hi,

Thanks for the quick response, that solves that problem.

One further issue. How do we only have the remove the custom action from a build as we can do in the prerequisites?

Regards,
Steve Hipwell
Farmade Management Systems Ltd
Bogdan
Posts: 2791
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Install SQL Express as a Feature

Hi Steve,

You cannot remove the custom action from a certain build. However you can condition it to run only on a specific build using the property "AI_BUILD_NAME".
Just simply add to the condition field something like this:

Code: Select all

 AI_BUILD_NAME  = "My_Build" 
Assuming that "My_Build" is the name of the build. This will make the custom action to run only if the build name is the one specified in the condition.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Stevo3000
Posts: 30
Joined: Fri Jan 23, 2009 12:00 pm

Re: Install SQL Express as a Feature

Hi,

We need the ability to only include the custom action in certain builds for the same reason that prerequisits can be turned off for some builds, 3rd party installers are too big to be included in a lightweight web based installer.

As custom actions are the only way to install third party software based on user interaction there really ought to be the same control that there is for prerequisits.

Regards,
Steve Hipwell
Farmade Management Systems Ltd
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Install SQL Express as a Feature

Hi Steve,
As custom actions are the only way to install third party software based on user interaction there really ought to be the same control that there is for prerequisits.
This improvement is already on our TODO list and it will be available in a future version of Advanced Installer.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Stevo3000
Posts: 30
Joined: Fri Jan 23, 2009 12:00 pm

Re: Install SQL Express as a Feature

This aproach does not appear to work. If I call the installer directly from the command line (elevated to admin) then I can install SQL 2008 x64, but the custom action always fails. Why would this be happening?
Stevo3000
Posts: 30
Joined: Fri Jan 23, 2009 12:00 pm

Re: Install SQL Express as a Feature

It appears that the SQL installer is running from a different root process than when we run it from the command line. I belive this is why it will not install correctly. I take it that this was checked as a valid aproach for chaining installs before it was suggested?
Stevo3000
Posts: 30
Joined: Fri Jan 23, 2009 12:00 pm

Re: Install SQL Express as a Feature

This does not work on XP, Vista or Windows 7. We need a solution for this, how did you get it to work when you tested it?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Install SQL Express as a Feature

Hi,
This aproach does not appear to work. If I call the installer directly from the command line (elevated to admin) then I can install SQL 2008 x64, but the custom action always fails.
I'm not sure I understand the problem you are encountering. How does the custom action fail if SQL Server is installed correctly? Can you please give me more details about this?

Since the custom action is scheduled under "InstallFinalize", it will run as Immediate with the user privileges. If you need it to run with Administrator privileges you can enable the bootstrapper and set a Require Administrator execution level.
It appears that the SQL installer is running from a different root process than when we run it from the command line. I belive this is why it will not install correctly.
Please note that an EXE custom action will always use a different process.
I take it that this was checked as a valid aproach for chaining installs before it was suggested?
Yes, this approach was tested numerous times and problems appeared only when the custom action was not set as asynchronous without waiting for return.

If the problem persists, can you please send us the .AIP (project) file you are using to support at advancedinstaller dot com so we can investigate it?


Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Stevo3000
Posts: 30
Joined: Fri Jan 23, 2009 12:00 pm

Re: Install SQL Express as a Feature

SQL 2008 Express never installs successfuly from the AI installer as a custom action.

Running the SQL 2008 Express installer manually works correctly.

I said 'root process', not process.

Our bootstrapper is running as an administrator.

The error message in the log is:
2009-11-04 12:52:16 Slp: ----------------------------------------------------------------------
2009-11-04 12:52:16 Slp: Running Action: MsiTimingAction
2009-11-04 12:52:16 Slp: ----------------------------------------------------------------------
2009-11-04 12:52:16 Slp: Running Action: Install_WatsonX64_Cpu64_Action
2009-11-04 12:52:16 Slp: Sco: Attempting to create base registry key HKEY_LOCAL_MACHINE, machine
2009-11-04 12:52:16 Slp: Sco: Attempting to open registry subkey
2009-11-04 12:52:16 Slp: Sco: Attempting to open registry subkey SOFTWARE\Microsoft\VisualStudio\9.0
2009-11-04 12:52:16 Slp: Target package: "c:\bf02089c5c4332926677c8bab00690ca\x64\redist\watson\dw20sharedamd64.msi"
2009-11-04 12:52:16 Slp: InstallPackage: MsiInstallProduct returned the result code 2.
A quick test for you would be to try and install SQL 2008 Express as a custom action using the following parameters:
/QS /ACTION="install" /HIDECONSOLE /FEATURES="SQLEngine" /INSTANCENAME="INSTANCE" /ENABLERANU="0" /SECURITYMODE="SQL"
/SAPWD="password" /SQLCOLLATION="Latin1_General_CI_AS" /SQLSVCACCOUNT="NT AUTHORITY\SYSTEM" /SQLSVCSTARTUPTYPE="automatic"
/SQLSYSADMINACCOUNTS="BUILTIN\ADMINISTRATORS"
I will email a copy of our .aip file to you.

Regards,
Steve Hipwell
pconlin
Posts: 2
Joined: Tue Dec 15, 2009 4:22 pm

Re: Install SQL Express as a Feature

Has there been a resolution to this issue? I am unable to launch the installer as well but it seems the installer runs when the application is uninstalled.
pconlin
Posts: 2
Joined: Tue Dec 15, 2009 4:22 pm

Re: Install SQL Express as a Feature

Getting closer to a solution. In my case, part of the problem was the Execution Condition of the Custom Action. The default condition appeared to be right but I decided to confirm with the values in the Install Type Dialog. As it turns out using the InstallType variable not equal to the typical install value (I want the action to run when complete) was required to launch the installer for SQL Server.

I saw the SQL Server installation progress but looking at the services running, Add\Remove Programs and the program group there is no trace of SQL Server.

Still investigating but not being overly familiar with the various installations of SQL Server it may be that I just don't know what to look for. Here are the parameters I use for the custom actions:
/TCPENABLED=1 /ACTION="INSTALL" /QS /SQLSVCSTARTUPTYPE="automatic" /SQLSYSADMINACCOUNTS="BUILTIN\ADMINISTRATORS"

Return to “Common Problems”