dstmartin
Posts: 4
Joined: Mon Dec 22, 2008 6:13 pm

Merge Module Parameters

I know this has ben discussed here before, however, that case was somewhat different from what I'm about to describe.

I have created a merge module for a database application that delivers an "add-on" module for the base application (contained in the base install). In the base installation, I collect information necessary to form a connection string, and use the connection string in the base install to execute SQL scripts. I am aware that I can directly execute SQL in the install, and I use that functionality, however, I must run some executables (as custom actions) and then a second set of SQL Scripts to initialize my database. The merge module must also execute SQL Scripts to initialize it's functionality in the database.

As a result of this, I would like to pass the connection string (and a couple other pieces of information) to the Merge module. I have tried this a a configurable parameter tied to a User-defined property in the base installation, however, all I seem to get is the Property Name in the merge module. The previous thread here implies that FORMATTED properties can be passed as parameters, but other references seem top contradict this, stating that parameters will always be unformatted due to the interface.

So to restate; what I want to do is a pass a User-defined Property from the base application to a merge module. I would like to loosely couple the merge module, and prefer not to use a reference to the MM property with the MM GUID appended. I have thought of using a file to pass the data from the base install to the merge module, but do not want to do this as there may be password data in the connection string, etc.

Is there a means of passing Property *data* from the base install to the merge module? I would think that I could specify a Property at design time that would pass the DATA at runtime. Am I missing something here?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Merge Module Parameters

Hi,

Unfortunately an installer property in a merge module cannot be set to a formatted value through a configurable parameter (the MSM doesn't support this). However, you can set the property by using a custom action inside the merge module. Since all formatted fields would append the merge module GUID to the property, you can use a ScriptInline custom action (you can control which property uses a GUID).

For example, if the property in your merge module is called TEST_MSM and the property in your MSI is called TEST, the "Script Text" field used by the custom action can look like this:

Code: Select all

Session.Property("TEST_MSM.CFF8DAF9_350F_4C26_BB4D_2A04E601EBDC") =  Session.Property("TEST")
Where "CFF8DAF9_350F_4C26_BB4D_2A04E601EBDC" is the GUID of the merge module.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”