[英]Override WinSxS mechanism in UWP. Specifically for ComCtl32.dll
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. 我正在创建一个使用动态库(wkhtmltopdf)的通用Windows应用程序,该库似乎通过其Qt实现依赖于comctl32.dll。 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:
现在,我能够在开发计算机(Windows 10 Pro 1607 Build 14393.1770)上很好地运行应用程序,但是,在目标计算机(Windows 10 Enterprise 2015 LTSB)上,出现以下错误:
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
LdrpInitializeNode-错误:DLL“ C:\\ Windows \\ WinSxS \\ x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.10240.16384_none_49c02355cf03478c \\ COMCTL32.dll”的初始化例程67ABDD60在DLL_PROCESS_ATTACH期间失败
When running the application I noticed my dev machine has different version of this library (5.82.14393.447). 运行该应用程序时,我发现我的开发机具有该库的不同版本(5.82.14393.447)。 I understand comctl32.dll 6.0 is not redistributable but I haven't seen the same remark for 5.82.
我知道comctl32.dll 6.0无法重新分发,但我没有看到5.82的注释。 I still decided to package my version of the library and call
LoadPackagedLibrary
manually. 我仍然决定打包我的库版本,并手动调用
LoadPackagedLibrary
。 This, on my dev machine ends up loading both version (as shown in the Visual Studio Modules window); 在我的开发机上,这最终加载了两个版本(如Visual Studio模块窗口中所示)。 on my target machine, it loads the "newer" version yet still tries to load the one on WinSxS and the failure still happens:
在我的目标计算机上,它加载“较新”版本,但仍尝试在WinSxS上加载该版本,并且失败仍然发生:
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
LdrpPreprocessDllName-信息:DLL COMCTL32.dll被SxS重定向到C:\\ Windows \\ WinSxS \\ x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.10240.16384_none_49c02355cf03478c \\ COMCTL32.dll
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. 看来我确实确实需要使WinSxS 不加载其ComCtl32.dll版本,因为我通过用目标计算机替换
C:\\Windows\\WinSxS\\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.10240.16384_none_49c02355cf03478c\\COMCTL32.dll
而被黑客入侵我的图书馆版本。 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? 有没有一种方法可以重新分发ComCtl32.dll的工作版本,使其不会尝试从WinSxS加载它? Perhaps through a manifest file or a running an MSI on the target machine?
可能是通过清单文件还是在目标计算机上运行MSI?
Comctl32 is not supported at all for UWP. COMCTL32是不是在所有的UWP支持。 Even if you manage to get it to "work" it might break at any point in time - - if you run the Windows App Certification Kit (WACK) on your project it will give you errors.
即使您设法使其“正常运行”,它也可能在任何时候中断--如果在项目上运行Windows App认证工具包(WACK),它将给您带来错误。
I'm pretty sure Fusion (the thing that supports binding to different DLL versions) is disabled for UWP as well. 我敢肯定,UWP也禁用了Fusion(支持绑定到不同DLL版本的东西)。 Because apps are self-contained and don't install / share system libraries like legacy apps, binding redirection is not needed.
由于应用程序是独立的,并且不像传统应用程序那样安装/共享系统库,因此不需要绑定重定向。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.