PDA

View Full Version : Installing Sql Server during install step?



jazzman007
12-15-2005, 03:23 PM
Hey All -

We are working on the installer for our product, which in its grandest form has a client, a server, and a database, and in its simplest form is just the client and database. As such we would like to include the default database (Sql Express 2005) with our installer. I'm aware of the fact that there's no prerequisite or modules for this...so to avoid confusion that's not my question. :rolleyes:

My question is is it at all possible to install the database during the installation of our product? Under the current plan, we can't simply do a prerequisite and always install it since (hopefully) the single install will be capable of installing the product in any form, which may or may not need to install Sql. Idealy, it would install after the features have been determined (database being one of them) and the installation phase is running. I'm a bit worried because what I've learned about IS and windows installer, that's not possible.

This is in an InstallScript MSI project in IS 11.5, and the product is build on .NET 2.0.

Is this at all possible? Or should be change our plans now?

Thanks in advance,
John

hidenori
12-16-2005, 12:15 PM
I think it's possible in InstallScript MSI projects and Basic MSI projects, but there is one limitation. You can launch Microsoft SQL Server 2005 Express redistributable from InstallScript or custom action once the installation starts.

The problem is the built-in SQLLogin dialog needs the server present on the system to validate the connections. In order to accomplish your requirement, you need to remove the code so you can proceed the dialog. In an InstallScript MSI project, the following code in the OnSQLLogin() function needs to be replaced with "bDoneLogin = TRUE;"


nRetVal = SQLRTServerValidate( ISMSI_HANDLE );

nSize = MAX_PATH;
MsiGetProperty( ISMSI_HANDLE, "IS_SQLSERVER_STATUS", sTemp, nSize );

if( sTemp != "0" ) then

nSize = _MAX_PATH;
MsiGetProperty( ISMSI_HANDLE, "IS_SQLSERVER_STATUS_ERROR", sMessage, nSize );

if( nSize = 0 ) then
sMessage = SdLoadString( IDS_IFX_SQL_ERROR_LOGIN_FAILED );
endif;

MessageBox( sMessage, MB_OK );

else
bDoneLogin = TRUE;
endif;

Hope this helps.

jazzman007
12-20-2005, 10:05 AM
Hi hidenori,

Thanks for the input! Could you offer a starting point of how I'd package and launch the SQL Express installer during installation of my product? Would it be in the support files and I just execute it? Or would a custom action be better? Idealy the 'Database' would be one Feature, and I'd imagine I'd need at least one Component in that feature from which to do the work, does that sound right?

In regards to your reply about the SQLLogin dialog, if the database is installed prior to needing that dialog, is there still the issue you mentioned? If the SQLLogin dialog isn't needed (we may have our application run actual sql scripts instead of IS), is it still a problem?

Thanks in advance,
John