Sorcerer
Posts: 1
Joined: Mon Sep 03, 2007 1:15 pm
Location: Germany

Pass parameters to merge modules

Is it possible to pass "Windows Installer Properties" as variables to merge modules?
I only found out how to pass static strings.

My merge module has a configureable parameterer (type "Formatted"). When I e.g. try to pass [APPDIR] to the merge module I only get the string "[APPDIR]".

Am I using the wrong type or do I have to do something else different?

Thanks

Simon
ciprian
Posts: 259
Joined: Thu Jul 14, 2005 12:56 pm
Location: Craiova, Romania
Contact: Website

Hi,

Yes it is possible to pass properties. However the value that will end in the configurable field depends on whether that field is formatted or not.

For details on formatted fields please see:
http://msdn2.microsoft.com/en-us/library/aa368609.aspx

To better understand this let's consider two examples:

1. Let's say you have a merge module that has a property which value can be configurable at merge time. The "Value" from the Property table is not formatted. This means that even if you use a property when you configure the merge module, in that field in the end will end up a plain text representing the name of that property.

2. Now let's say that in the same merge module you have defined an environment variable which value is configurable. The value column from the Environment table is formatted. So if you pass a property when you configure the merge module, in that field will end up that property value.

Hope I was clear enogh.

Best regards,
Ciprian
Ciprian Burca
Advanced Installer Team
http://www.advancedinstaller.com
iruff
Posts: 5
Joined: Tue Jul 17, 2007 1:32 pm

Hello,

So if I have a custom action in my merge module, CustAct1, with an execution condition of "NOT Installed AND RUN_CUSTACT1", what is the best way to set RUN_CUSTACT1 from the UI? I'd rather not use an environment variable.

Thanks,
iruff
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

You can set the RUN_CUSTACT1 property by adding the GUID of the Merge Module after it. For example, if the value of RUN_CUSTACT1 depends on a checkbox, then that checkbox will have the property:

Code: Select all

RUN_CUSTACT1.GUID
Note that the module's GUID can be found in the "Module Details" page in the "Module GUID" field (in the Merge Module project).

For example, if the GUID of the merge module is DA1BEA1B_1FFE_4890_B644_01BAEEED34C1 then you will use

Code: Select all

RUN_CUSTACT1.DA1BEA1B_1FFE_4890_B644_01BAEEED34C1
Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
iruff
Posts: 5
Joined: Tue Jul 17, 2007 1:32 pm

pass parameter to merge module

This seems so straightforward, but I just cannot get this to work.

In my merge module, my custom action has the execution condition of "Not Installed AND RUN_CUSTACT1".

1) Does RUN_CUSTACT1 need to be a one of the Properties on the Module Details page?

2) If yes, does it need to be configurable?

3) If still yes, I assume I will choose to add a new parameter. Should its name also be RUN_CUSTACT1? What type does it need to be?

4) In my main project, on the Merge Modules page, I am not clear on what value I would need to assign to the configurable parameter, assuming I needed to add it to the merge module.

5) In my main project, on my checkbox, I have set its property name to RUN_CUSTACT1.module_id. Is this correct, or does it need to be the name of the new parameter from (3)?

I'm sure I'm doing something silly, but thank you for your promptness and patience with assistance!

iruff
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,
1) Does RUN_CUSTACT1 need to be a one of the Properties on the Module Details page?
Yes, you define RUN_CUSTACT1 in the "Module Details" page (inside the Merge Module project) and you initialize it with a default value.
2) If yes, does it need to be configurable?
3) If still yes, I assume I will choose to add a new parameter. Should its name also be RUN_CUSTACT1? What type does it need to be?
4) In my main project, on the Merge Modules page, I am not clear on what value I would need to assign to the configurable parameter, assuming I needed to add it to the merge module.
Please note that a configurable merge module can be configured only at merge time. Also, in your case, you don't need to add parameters to the merge module in order to use the property you need.
5) In my main project, on my checkbox, I have set its property name to RUN_CUSTACT1.module_id. Is this correct, or does it need to be the name of the new parameter from (3)?
Like I mentioned in my previous post, for the checkbox you will use the property name followed by a dot (".") and the actual GUID of the module (the module's GUID can be found in the "Module Details" page in the "Module GUID" field in the Merge Module project).

You can read more about merge modules here:
http://www.advancedinstaller.com/user-g ... tails.html

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
hadas
Posts: 43
Joined: Mon Jan 06, 2014 10:53 am

Re: Pass parameters to merge modules

Hi,

In the main aip i have properties that I need to use in a merge module. Part of the properties are data from the user and part of it is calculated at run time from Search and Custom Action.
What is the best way to pass those properties?
How can I create configurable merge modules? can I update the properties at run time or only in the merge process?

Thanks,
Hadas
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Pass parameters to merge modules

Hi Hadas,
What is the best way to pass those properties?
You can past those properties using the "Set installer property" custom action, or the "Set installer property value" control event. As mentioned by my colleague Cosmin in the above post at point 1), you should define those properties (or similar properties) in the merge modules and then you can set them in the main project as in the example below:
  • Property: MSM_PROP.GUID
    Value: [MAIN_PROJECT_PROP]
How can I create configurable merge modules?
You can create a configurable merge module as described in the Configurable Merge Modules Page article.
can I update the properties at run time or only in the merge process?
Yes, you can update properties at run time with the "Set installer property" custom action, as I mentioned above.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

Re: Pass parameters to merge modules

Is the SET INSTALLER PROPERTY CA done in the parent/main project installer OR in the Merge Module?
You can past those properties using the "Set installer property" custom action, or the "Set installer property value" control event. As mentioned by my colleague Cosmin in the above post at point 1), you should define those properties (or similar properties) in the merge modules and then you can set them in the main project as in the example below:
Property: MSM_PROP.GUID
Value: [MAIN_PROJECT_PROP]
Scott Jeslis
Senior Software Engineer
Cicero, Inc.
sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

Re: Pass parameters to merge modules

Think my answer to my question:
Is the SET INSTALLER PROPERTY CA done in the parent/main project installer OR in the Merge Module?
is from the Main Project as noted here:

viewtopic.php?t=28629
Scott Jeslis
Senior Software Engineer
Cicero, Inc.
sjeslis
Posts: 308
Joined: Mon Aug 22, 2011 11:40 pm
Contact: Website

Re: Pass parameters to merge modules

Doing the SET INSTALLER PROPERTY from Main Project resolved my troubles.
Scott Jeslis
Senior Software Engineer
Cicero, Inc.
Catalin
Posts: 6586
Joined: Wed Jun 13, 2018 7:49 am

Re: Pass parameters to merge modules

Hello Scott,

Please note I have answered your other forum thread here:

viewtopic.php?f=2&t=45648&p=117044#p117044

Hope it helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”