cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
alegerlotz
Level 7

Calling InstallScript Custom Actions from a MergeModule

I've written a Merge Module that contains 3 InstallScript Custom actions.

I've set the limited properties available on the custom actions in the .msm, but I can't seem to get these custom actions to run in the .msi generated from a project that includes the merge module. I opened the .msi itself with the InstallShield IDE and the custom actions are visible and clearly tied to the mergemodule, but they are not included in any sequence so they're not being called.

My project is a BasicMSI.

I wouldn't have expected this to work in 11.5 and earlier, but since the underlying guts changed in 12, I figured it would work now.

Is what I'm trying to do possible? If so, what have I done wrong?

Thanks
Labels (1)
0 Kudos
(6) Replies
Christopher_Pai
Level 16

TAke a look at the ModuleInstallExecuteSequence table ( and others ). Basically you teach the merge module where the CA's should be inserted in relationship to standard actions. This way when the MSM is merged into your resultant MSI you'll see your CA's in the InstalExecuteSequence table ( and others ).

http://msdn2.microsoft.com/en-us/library/aa370049(VS.85).aspx
0 Kudos
alegerlotz
Level 7

Thanks Christopher.

I did see this table on Friday and noticed that my actions weren't included there with the others that InstallShield created on its own based on the content of my MM.

I'll add my functions to the table and see what I can get going.

-Al
0 Kudos
Christopher_Pai
Level 16

Each exported function has to have a corrosponding CustomAction row and a corrosponding sequence row. Or you can create a common exported function and use it as a wrapper function ( main() ) for all the others. Eitherway checkout:

http://blog.deploymentengineering.com/2006/06/installscript-ca-performance-issue.html

If you are manually hacking the compiled dll realize that not all exported installscript functions get exported in the dll ( f1, f2, f3 when you look at it with depends.exe ) Only functions that get consumed by CA's actually get exported.

BTW, for somewhat relevant and fun is this article that I wrote:

http://www.macrovision.com/webdocuments/PDF/msi_ice.pdf?link_id=productsTipsTricks
0 Kudos
alegerlotz
Level 7

Its working great now, thanks for the info.

The issue that I thought I was having with the functions not getting called properly was because of a stupid error on my part. Long story short it was a situation where the content of the message box wasn't correct because of a cut/paste error.

I'm really surprised that InstallShield doesn't supply a way to add the custom actions to the sequence in a merge module. Having to edit the ModuleInstallExecuteSequence manually should be unnecessary as it is in an InstallShield project when setting up sequences.
0 Kudos
Christopher_Pai
Level 16

I suppose InstallShield is a little backwards in this area. If you look in your Basic MSI project, sequences view, you'll see you can right click insert a custom action and choose merge module as the source.

In theory, it'll do reflection against the merge module, show the CA and let you insert it. This can be useful where you want a the MSI project to have more control/flexibility in how to consume the merge module. However the MSI approach is the MSM dictates how it gets merged and IS probably show show this in their designers. But direct editor is there though....
0 Kudos
alegerlotz
Level 7

However the MSI approach is the MSM dictates how it gets merged and IS probably show show this in their designers.[/QUOTE wrote:


This is definitely my goal because the msm will be included into multiple projects.
0 Kudos