|The "HookInto" Command|
MAKEMSI has many "hooks" which allow you to insert processing at certain locations. With code written in "layers" it may be that each of these layers might wish to use the same "hook" and therefore interfere with each other if you were not careful.
This macro allows you to hook into the processing without accidently removing any hooking that may have previously have been defined.
Note that this macro is implemented by the "HookInto.MMH" header file and since you typically want to set up hooks before MAKEMSI begins you will have to specifically include the supporting header. You may safely include the header any number of times, the example below demonstrates how this is done with the PPWIZARD "#include" command.
This command takes these parameters:
This processing will be scheduled "before" any that currently exists.
This processing will be scheduled "after" any that currently exists.
Note that the macros you supply are not expanded until the hook is used.
The following code shows code being "inserted" into the "MAKEMSI_HOOK_ASAP_AFTER_LOG_DIRECTORIES_DEFINED" hook:
#( ;--- Code we wish to execute early in build (but after logging locations known) --- #define SuspendCpuIntensiveTasks ;--- Need to perform latter when the logging directory is known! -------- #evaluate ^^ ^<$Rexx4SuspendCpuIntensiveTasks>^ #) #include "HookInto.MMH" ;;We haven't already included the MAKEMSI headers... <$HookInto "MAKEMSI_HOOK_ASAP_AFTER_LOG_DIRECTORIES_DEFINED" Before="SuspendCpuIntensiveTasks">