cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
iwesley
Level 4

Custom Action Sequence of events ...

Hi,

I can't figure out how to get my CA to execute in the correct order. I'm missing something really simple. My custom action takes [INSTALLDIR] as a parameter, and I have found that I have to call it not too early, or too late, or [INSALLDIR] is not aviable.

I have InstallFiles as default Sequence Number of 4000, and my custom action is 4825 in the Execute table. My CA is a VB .NET .DLL and is set for Immediate Excution after RegisterProgIdInfo which is sequence 4800. It is also set for 'Synchronous ignore exit code'. I need my CA to occur AFTER the files are installed in [INSTALLDIR]. For some reason, the order of events is RegisterProgIdInfo, my CA, then Install files - or 4800, 4825 then 4000. What gives?

Thanks ...:confused:
Labels (1)
0 Kudos
(4) Replies
Christopher_Pai
Level 16

INSTALLDIR ( and all other directory properties ) isn't set until after CostFinalize. However, for more comprehensive insight I suggest the following required reading:

Installation Phases and In-Script Execution Options for Custom Actions in Windows Installer
0 Kudos
iwesley
Level 4

Thank you, I have a plan. I will store INSTALLDIR in a property and it will always be available, thus I can move my CA to the end of the application.
0 Kudos
iwesley
Level 4

Hi Folks,

What I'm trying is not working. I need to wait until the files are on the hard drive, then I need to modfy a file. My .dll has dialogs for testing purposes.

I need to pass [INSTALLDIR] to my .DLL, but when I try this in execute sequence after InstallFiles [INSTALLDIR], and my other properties, are always blank. When I try in UI sequence, I get the correct [INSTALLDIR] path in 'Immediate Execution', but it executes before the files are copied. When I try 'commit execution', I get error 2762 that it can't write to the script record.

In short, I can get the right path before the files are written - this is useless. I can get a null path after the files are written - this is useless ... How can I get my custom action to execute after the files are written and to accept [INSTALLDIR] or my own custom property [INSTALLDIR_COPY]?

Thanks
0 Kudos
RobertDickau
Flexera Alumni

Deferred actions need some extra care to get property values using MsiGetProperty or Session.Property. Searching the world for "CustomActionData" will show the trick of it: see for example newish InstallTalk blog post http://blogs.flexerasoftware.com/installtalk/2011/06/it-wants-me-to-do-what-some-notes-on-customactiondata-in-installshield.html and ancient newsletter tip http://www.flexerasoftware.com/webdocuments/PDF/CustomActionData.pdf.
0 Kudos