cjschrattenthaler
Posts: 4
Joined: Thu Jul 28, 2005 9:14 am
Location: Austria
Contact: Website

Nested Installation?

Hi!

I have to install the MSDE2000 and/or Microsoft SQL-Server Express Edition 2005 with my application.

Can anyone tell me, how to do this?

I think I need nested Installations, but I cant find this Feature for .exe-files.

Greetings,
Christian.
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi Christian,

Nested installations are a special kind of Custom Actions and they are available only for MSI files. Therefore, you can not use MSI Custom Actions in case of MSDE because it uses an EXE bootstrapper and multiple external MSI files.

To install MSDE2000 as part of your application you need to use the set of 25 Merge Modules provided by Microsoft. You can put all these Merge Modules in a new Feature and the user may select whether this Feature will be installed or not.

On the other hand, Microsoft SQL Server 2005 Express Edition can be added as a Prerequisite.

Regards,
Denis
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
cjschrattenthaler
Posts: 4
Joined: Thu Jul 28, 2005 9:14 am
Location: Austria
Contact: Website

Please tell me more...

Hi!

I can't use a prerequisite, because the MSDE2000 or the MS-SQL 2005 Express should be available as a feature, and not automatically be installed.

You did you men the system to install the MSDE2000? The file copy is no problem, but then I have to start the setup.exe, and this doesn't work. You write from an other solution, how do you mean this would work?

Kind greetings,
Christian.
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi Christian,

SQL Server 2000 Desktop Engine(MSDE) SP3 may be downloaded from:
http://www.microsoft.com/downloads/deta ... laylang=en
The downloadable file ("sql2kdesksp3.exe") includes all of the files that are
required to install a new instance of Desktop Engine (.msi files), to upgrade all
existing instances of Desktop Engine (.msp files), as well as to consume merge
modules (.msm files) into applications.
MSDE2000 can be installed separately from your application, using the supplied EXE
and MSI files or they can be installed by your application if you use the merge
modules (MSM files). Note that you cannot use the EXE and MSI files to install MSDE as part of your application's setup.

Therefore, in order to install MSDE2000 with your application you have to use the 25 merge modules. These are the necessary steps:
1. In the Organization page, create a new Feature (for example, "MSDE2000")
2. Add the merge modules in AdvInst in the Merge Modules page.
3. For each merge module you can specify the Feature that will contain the components of the merge module, after the merging process ends. In order to do this, double click on each merge module and select the "MSDE2000" feature created previously.
4. Build the package.

However, if you try to install the resulting package, the install process will fail due to some issues related to the MSDE merge modules. In order to correct this problem, you need to edit the MSI package with Orca (a MSI database editor included in the Platform SDK) and change the sequence of one Custom Action in both sequence tables ("InstallExecuteSequence" and "InstallUISequence"). Another solution would be to use a VBScript that performs this modification automatically.

This is an intricate process, but, if you want to install MSDE with your application, please let me know and I will give you more details. Instead, I would recommend that you distribute the MSDE installation files (EXE bootstrapper and MSI files) such that your users can install MSDE separately if they require it.

Regards,
Denis
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,

In what follows I shall describe a method of installing MSDE as part of your application's setup routine using the EXE bootstrapper and MSI files provided by Microsoft. It will be available as a feature, therefore, users may select whether it will be installed or not. However, I do not recommend using this method for several reasons:
a) The MSDE setup files will be installed with your application.
b) The "sa" administrator password will be visible to anyone using a MSI database editor such as Orca. This can be avoided if you create a DLL Custom Action that will generate a random password at install time, store this password in a Property and use the value of this property on the command line for the MSDE "setup.exe".

These are the steps you should follow:
1. In the Files and Folders page of AI, add the whole MSDE directory structure. The folders "MSI" and "MSM" (depending on the MSDE release you are using) can be excluded from the project.

2. In the Organization page, create a new Feature ("MSDE2000" for example) and add all the Components corresponding to the MSDE2000 files to this Feature.

3. Switch to the Custom Actions page and make sure that the "InstallFinalize" item is visible in the tree control.

4. Add a new Property Set with Formatted Custom Action scheduled on the "InstallFinalize" stage and set the following properties for it:
- Property Name : MSDE_SETUP
- Formatted Text: [#setup.exe] (use the "Edit" button and then the "File" button in the "Edit Custom Action Parameters" dialog to select the MSDE "setup.exe" from your package).

5. Add a new Property Source Custom Action scheduled on the "InstallFinalize" stage, after the previous Custom Action. Set the following properties for it:
- Property Name : MSDE_SETUP
- Source Type : Executable(*.exe)
- Command Line : SAPWD="AStrongSAPwd"
- Execution Properties: Asynchronous Execution, do not wait for return
- Execution Condition :

Code: Select all

((&Feature = 3) AND NOT (!Feature = 3))
where "Feature" is the FeatureID of the "MSDE2000" Feature (select the 7th Predefined Condition from the "Edit Condition" dialog and then select the MSDE2000 Feature from the "Select a Feature" dialog).

Hope this helps.

Regards,
Denis
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
Luciano
Posts: 9
Joined: Mon Apr 10, 2006 10:07 pm

HI,
this question is for denis ...

when u said :
"However, if you try to install the resulting package, the install process will fail due to some issues related to the MSDE merge modules. In order to correct this problem, you need to edit the MSI package with Orca (a MSI database editor included in the Platform SDK) and change the sequence of one Custom Action in both sequence tables ("InstallExecuteSequence" and "InstallUISequence"). Another solution would be to use a VBScript that performs this modification automatically "

can u explain further , cause everytime i try to run my installation, it always give me a 2602 error code ...
Also, how i change the sequence of one custom action ??? (explain with detail plz)

thank in advance

luciano
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,
can u explain further , cause everytime i try to run my installation, it always give me a 2602 error code ...
There are many bugs associated with the MSDE merge modules; most of these bugs are described here:
http://www.installsite.org/pages/en/bugs_msi.htm#wimsm

First, I shall describe possible workarounds for 2 of these bugs. However, I do not recommend using the MSDE merge modules, but rather specifying MSDE as a Prerequisite for your application (see bellow).

The problem that appears in your case is caused by a different bug than the one I was referring to in my previous post. A workaround for the "error 2602" bug is to open the "SQLSVR_RES" merge module in Orca and change the sequence number from 10 to 2 in the "File" table.

A workaround for the "setup initialization failure" bug (the one I was referring to in my previous post) involves the following steps:
a) Open the MSI package for your application (after merging the MSDE merge modules) in Orca.
b) In the "InstallExecuteSequence" table, sort the entries after the Sequence number (click the corresponding column).
c) Locate the Custom Actions whose IDs begin with "GetSqlStates" and "StreamSupportFiles" (this one has an incorrect sequence number).
d) The Action whose ID starts with "StreamSupportFiles" must come before the Action whose ID starts with "GetSqlStates". Thus, change the sequence of the "StreamSupportFiles" Action to the first free sequence number prior to "GetSqlStates". For the package I have tested, this free sequence number was 99.
e) Repeat the above steps for the "InstallUISequence" table.
f) Save the MSI file and quit Orca.


In order to include MSDE as a Prerequisite for your application (the approach I would recommend), follow these steps:

1. Copy the files from the MSDE distribution ("setup.exe", "setup.ini" etc) and the "Setup" directory to the folder where your MSI package is built. The "Msi" and "MSM" folders do not need to be copied.

2. In Advanced Installer switch to the Media page, "Prerequisites" tab and click "New". Select the MSDE "setup.exe" bootstrapper.

3. In the "New Prerequisite" dialog -> "Properties" tab, make the following changes:
a) Display Name: MSDE 2000 (change it as necessary)
b) Location: "File in package"
c) Command Line: SAPWD="AStrongSAPwd" (set the desired password and specify additional parameters such as "INSTANCENAME" or "SECURITYMODE")

4. In the "New Prerequisite" dialog -> "Install Conditions" tab, make the following changes:
a) Criteria: "Registry Value"
b) Registry Value:

Code: Select all

HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\80\Tools\ClientSetup\CurrentVersion\CurrentVersion
c) Minimum: 8.0

You can find a complete list of SQL Server versions here:
http://www.krell-software.com/mssql-builds.asp

5. In the "Media" tab (of the Media page) make sure that "Create EXE setup file", "Leave install files outside", "Archive installation files into CAB files" and "Include CAB files into the MSI database" are selected.

6. After building the project, you will need to distribute all the MSDE setup files ("setup.exe", "setup.rll" etc) including the "Setup" folder, in addition to the setup files of your package generated by Advanced Installer (EXE, INI, MSI). In a future version, AI will support specifying multiple files for a Prerequisite and then you will be able to create a single EXE package that includes all the required files.

Hope this helps.

Regards,
Denis
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
Luciano
Posts: 9
Joined: Mon Apr 10, 2006 10:07 pm

Thank for ur help Denis, I appreciate.

Return to “Common Problems”