PDA

View Full Version : Custom Action .DLL Questions



Robbr2084
09-29-2004, 01:10 PM
I've created a custom action .dll using the classic calling convention.

The action is set to fire "After file transfer".

Question #1: Why is it that my .dll gets called "after file transfer", yet no files have been copied yet? As soon as I dismiss the messsage box displayed by my .dll, THEN files start copying...why? This seems broke.

Question #2: Why is it that all four pointers passed into my custom action .dll are all NULL? I've tried moving the custom action up/down the action list and the ONLY place in the list that I get pointers that aren't NULL is when I place it at the bottom of the list "After setup success dialog".

I really need the .dll to get called truly "after file transfer" AND have valid pointers to the various paths passed into the dll. What's the magic to make this happen?

thanks,
-robb (robb_rinard@yahoo.com)

Robbr2084
10-05-2004, 01:48 PM
Hasn't a single soul out there created a custom .dll that uses the pointers to the folders passed in by the installer?

Can no one comment on this matter?

Mike Marino
10-07-2004, 04:24 PM
Question #1: Files have been copied to the system at the Custom Action Location "After File Transfer". You can prove this by creating an EXE Custom Action at this point that Launches an EXE. Run the Install, and when the EXE launches (the setup will hault -- waiting on the EXE) check the file system and the files should be installed. They were in my test I ran.

Question #2: This has to do with an MSI (Windows Installer) concept called Deferred Execution Custom Actions. Basically what this means is that many installer properties are not available to DLL custom actions that are considered deferred. EXE custom actions, can get this information when placed in the exact same place. So if instead of writing a DLL custom action, you wrote a small EXE, by setting the command line parameter of the EXE custom action to [INSTALLDIR] you can get INSTALLDIR to where you need it to.

INSTALLDIR will be populated in Classic Style DLLs in all but the following (deferred) locations:

"After File Transfer"
"After COM Registration"
"After Register Product"
"Before File Transfer"

Robbr2084
10-15-2004, 01:53 PM
Hi Mike, thank you very much for the information.

I tested out a custom action .exe and it worked as you described.

I'll use and .exe instead of a .dll during the install.

It would be nice if the .HLP file that ships with Install X would detail the fact that the 4 string values passed into the .dll are not available in certain places along the install chain. That info would have saved me days of trying to figure out what's going on.

-Robb