View Full Version : Custom actions and merge modules

04-09-2002, 10:23 AM

I have a merge module with a custom action which runs some VBScript. This custom action is automatically inserted into the InstallExecuteSequence when merged. This is done by inserting The following two rows in ModuleInstallExecuteSequence in the module:

(InstallFiles, 1950, -, -, -)
(MyCustomAction, -, InstallFiles, 1, -)

I.e. MyCustomAction is to be run directly after the InstallFiles action in the main sequence. However, what actually happens is that the custom action runs much earlier in the sequence, and the files are installed after it is run.

The custom action is defined as VBScript, Execute Immediately, Always Execute.

Has anyone had this problem? Can anyone think of why this could be happening? I'm at a loss.


/ Mats

04-09-2002, 10:27 AM
I forgot to add that I opened the finished installer in Orca, and everything looks all right. The InstallExecuteSequence table looks correct - the custom action has been inserted with the sequence number 1951.

/ Mats

04-09-2002, 12:30 PM
You have your CA defined as immedate, but InstallFiles runs as deferred. If you change your CA to deferred you shoud have it execute when you want.

04-10-2002, 01:39 AM
Ah, thanks. That worked. I obviously have some way to go in learning exactly how Windows Installer works :-).

However, I think the IS documentation for custom actions is misleading - the "Immediately" option is described as "Choose this option to have the action execute when it is encountered in the sequence." If you don't realize that the sequence is first traversed and script is generated (which I guess is what happens), then it sounds like this is exactly what you want. So, if any IS people are reading this, you might consider clarifying this. Or maybe it's just me.

Anyway, thanks. I've got it now.

/ Mats