cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Kelter
Level 10

merge module support files - PLEASE HELP

someone MUST have a solution to this:

i have a merge module which contains custom actions which depend on some DLLs. since there is no concept of support files in a merge module (nothing automatically extracted to the SUPPORTDIR) i wrote some logic to extract a file from the binary table and then load it. this is only okay in immediate mode CAs, however, as the handle passed to deferred execution CAs is not valid for calls to MsiDataBaseOpenView.

can somebody please help me?
Labels (1)
0 Kudos
(3) Replies
RobertDickau
Flexera Alumni

Can you extract the file in immediate mode and then use (and later delete) it in deferred mode?

(It's unsurprising that you can't access the raw MSI tables during deferred mode, since the installer's internal script is finished by then. General access exceptions are MsiGetProperty+CustomActionData and the other things mentioned in "Obtaining Context Information for Deferred Execution Custom Actions", but those seem to be special cases.)
0 Kudos
Kelter
Level 10

(apologies for the dup threads...i've been posting about this and related issues on the 2008 forum, but nobody looks at that anymore...bad practice + results > good practice + no results)

hmmm...i'll have to revisit that idea...originally i tried to mimic the installshield logic with a CA that would extract all the necessary setup files, and another CA would clean them up at the end of the install, but the files were getting deleted automagically before the deferred execution sequence. perhaps my problem was that i was extracting these files to a directory MSI knows about...so if i extract to a different directory, maybe they won't get cleaned up prematurely, and...i think i've got this... i'll write again with a result...
0 Kudos
Kelter
Level 10

thanks for the tip!!! seems like i had a pile of problems, and only managed to fix one of them at a time. as indicated previously, i was extracting files to SUPPORTDIR, and they were being deleted as soon as the CA ended. this isn't helpful when extracting files for another CA to use.

i ran into another problem in how I was passing MySupportDir to the Deferred CAs...because some of the logic is shared among CAs, some immediate, and some deferred, the following only worked in some cases:
MySupportDir=[MySupportDir.F7043BE0_A202_4A53_BF3D_07086AC51ABC]

then i changed my script to look for
MySupportDir.F7043BE0_A202_4A53_BF3D_07086AC51ABC

which fixed the problem for Def CAs, but broke it for Imm CAs. 😛

this is (somewhat obviously) what i meant to do all along:
MySupportDir.F7043BE0_A202_4A53_BF3D_07086AC51ABC=[MySupportDir.F7043BE0_A202_4A53_BF3D_07086AC51ABC]


in summary, the following are things to keep in mind when you have a merge module with def ex CAs which require support files:
1. Extract these files at the beginning of the installation to a directory that MSI logic doesn't know about
2. Make sure you are useing the ". wherever appropriate
3. Make sure you cleanup these support files at the end of the install.

Also, see this thread for a simple bit of script for extracting a file from the binary table:
http://community.flexerasoftware.com/showthread.php?t=170906

Thanks again Robert!
0 Kudos