Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

CA (in DLL) AFTER the Files are copied


3 replies to this topic

Thomas Eskesen

Thomas Eskesen
  • Members
  • 86 posts

Posted 19 April 2001 - 13:31

Hi
I have tumbled a week with this problem:
I would like to call my own DLL ( it is in the Binary) to patch some files - after they are copied to the destination!
I'v made a CustomAction to do this.

1. Where in the sequence should i put the Action?
In the end of the Execute part?
Before or after "InstallFinalize"?

2. If I use Immediate execution my DLL code can't find the file!!!
If I don't use Immediate execution i get an error: "Failed to extract file ... from the binary table"
If I try to use "deferred" execution of my action it crashes and can't find the DLL ("deferred" & "Rollback" shouldn't work with DLL's)


How do I do this?

PLEASE HELP!!!

Regards,
A very frustrated
Thomas Eskesen


Joe Fegan

Joe Fegan
  • Members
  • 38 posts

Posted 19 April 2001 - 17:32

If I understand you correctly you have a DLL in the Binary table that you want to run after the product files have been copied to their final destinations.

You can't use immediate execution because the installer is only building the script at that point and no files have been created yet. The custom action must be deferred and must be placed somewhere after InstallFiles and before InstallFinalize in InstallExecuteSequence. If you put it any sooner the files won't have been moved to their target directories yet and so won't exist. If you put it after InstallFinalize it will never run because InstallFinalize runs the installation script so there's no point in adding things to the script afterwards.

Here's what I think you want. A custom action of type 1 (dll in Binary table) plus 3072 (deferred execution) in other words 3073. You could also add 64 if you want to ignore the exit code giving 3137.

The Source field should be the value of the primary key of the row in the Binary table that contains the DLL.

The Target field should be the name of the entry point (function) in the DLL that you want to call. The MSDN documentation on custom action type 1 describes how to declare this function so that the installer can call it. Is it possible that you have declared it incorrectly and that this is causing the installer to crash when it attempts to call it?

Try producing a log file of the installation. It might help narrow it down.


Thomas Eskesen

Thomas Eskesen
  • Members
  • 86 posts

Posted 20 April 2001 - 08:14

Thanx!

But NOW I got it to work:
I am using a CustomAction (Type 131072;
Call my DLL from the Binary table, "Wait for action to Finish Execute", "Immediate Execution", "Always Execute")
Placed AFTER the InstallFinalize in the Execute sequence.

My DLL can now alter the copied files in the destination directory.

Regards,
Thomas