Comment 32 for bug 357456

Revision history for this message
In , Focht (focht) wrote :

Hello,

you need to put more love into it else nothing will happen and people will suffer for a long time.
Sure, any solution that creates MTA helper thread within app process remains sort of a hack until Wine Msi can roll its own custom action server.

As already said: avoid using DllMain for dedicated threads.
Ideal would be a place where one can control the startup and shutdown of MTA helper thread within same function scope while avoiding/minimizing the need for recreation it due to multiple custom actions.

Have a look at MSI_InstallPackage. All applicable custom actions are run from within that entry.
MTA helper thread creation should be done before any ACTION_ProcessExecSequence().
MTA helper thread shutdown should be done after ACTION_FinishCustomActions() to ensure deferred/pending custom actions have ended.
Use event signalling not only for shutdown but also for startup to prevent possible race condition between threads, ensuring CoInitializeEx() is called from MTA helper thread before any custom action is run.

Regards