I am creating a Universal Windows App which uses a dynamic library (wkhtmltopdf) that seems to have a dependency on comctl32.dll through its Qt implementation. Now, I am able to run the application just fine on my development machine (Windows 10 Pro 1607 Build 14393.1770) however, on the target machine (Windows 10 Enterprise 2015 LTSB) I get the following error:
LdrpInitializeNode - ERROR: Init routine 67ABDD60 for DLL "C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.10240.16384_none_49c02355cf03478c\COMCTL32.dll" failed during DLL_PROCESS_ATTACH
When running the application I noticed my dev machine has different version of this library (5.82.14393.447). I understand comctl32.dll 6.0 is not redistributable but I haven't seen the same remark for 5.82. I still decided to package my version of the library and call LoadPackagedLibrary
manually. This, on my dev machine ends up loading both version (as shown in the Visual Studio Modules window); on my target machine, it loads the "newer" version yet still tries to load the one on WinSxS and the failure still happens:
LdrpPreprocessDllName - INFO: DLL COMCTL32.dll was redirected to C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.10240.16384_none_49c02355cf03478c\COMCTL32.dll by SxS
It seems I simply do need to make WinSxS not load its version of ComCtl32.dll since, I hacked by replacing C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.10240.16384_none_49c02355cf03478c\COMCTL32.dll
in the target machine with my version of the library. However, this is not desired.
Is there a way to redistribute the working version of ComCtl32.dll such that it won't try to load it from WinSxS? Perhaps through a manifest file or a running an MSI on the target machine?