InnoSetup hangs after install due to dll

2019-08-31 04:40发布

I am using a custom DLL inside an InnoSetup wizard.
All works well.

Except that AFTER install completes successfully, the main GUI windows closes (as expected) but the icon remains in the task bar.
(the install process still exists and can be easily killed from the task-manager)

I presume the DLL is leaving some unreleased resource or reference, and the InnoSetup finalizing code is waiting on it. Any hints on specific resources that the IS is waiting on ?

Thanks

1条回答
Lonely孤独者°
2楼-- · 2019-08-31 05:25

After significant debugging and hair-pulling, the deadlock occurs is Delphi unit finalization code.

If threads are started/terminated in the finalization code, valid-looking code will hang when innosetup tries to release the dll.

I know the DLL_THREAD_ATTACH routines are serialized by windows, so this is probably the problem. Innosetup itself is written in delphi, and this can be reproduced by a simple dephi program, which calls a delphi DLL, which calls a delphi DLL which thread termination code in a unit finalization routine

Hope this helps someone in the future

查看更多
登录 后发表回答