windows - 如何创建 list 文件以将我的可执行文件/插件指向我的特定版本的 Qt.dll?

标签 windows qt deployment dll manifest

我无法理解 list 的工作原理/它们的用途。

我的情况是这样的:我需要部署自己的实现 Qt 的独立 .exe 以及实现 Qt 的插件(.8bf、photoshop 插件、伪装的 .dll)。

我有自己的 Qt DLL,我用自定义命名空间和中缀名称编译了这些 DLL,我想将其安装到 C:\Program Files\MyCompany\Qt 中

我可以使用 list 让我的 .exe 和插件“指向”这些 Qt DLL 吗? exe 和插件都位于 C:\Program Files\MyCompany 的不同子目录中,插件的 shell 链接安装在 photoshop\plug-ins 目录中。

list 是我正在寻找的东西吗?如果是,需要采取哪些步骤才能实现?似乎 Qt DLL 需要一些 list 来识别/注册自己,但在 msdn 链接上进行循环追逐之后,我决定在这里提问(在搜索之后,当然只找到部分相关的问题)。

最佳答案

听起来让您的程序集对程序集缓存可用可以解决您的问题 - 这也是 GAC 旨在解决的问题 - 但它有点矫枉过正。

只需在两个目录中提供相同版本的这些 DLL。


list 用于确保您的程序使用特定版本的 DLL(或一组 DLL)。

最著名的例子是当您的应用程序尝试加载 comctl32.dll 时。

这个 dll 通常可以在您的 system32 中找到:

 Directory of C:\Windows\System32

11/20/2010  09:25 ᴀᴍ           633,856 comctl32.dll
               1 File(s)        633,856 bytes

除非您做了任何特别的事情,否则您将获得此版本的 dll(5.82 版)。但程序通常需要此版本的 comctl32。大多数为 Windows XP 或更新版本编写的程序都希望确保它们加载 comctl32版本 6。他们通过在可执行文件的程序集 list 中指定一个条目来实现这一点,表明他们想要一个特定版本的公共(public)控件库:

<dependency>
   <dependentAssembly>
      <assemblyIdentity 
               type="win32" 
               name="Microsoft.Windows.Common-Controls" 
               version="6.0.0.0" 
               processorArchitecture="X86" 
               publicKeyToken="6595b64144ccf1df" 
               language="*">
      </assemblyIdentity>
   </dependentAssembly>
</dependency>

现在,如果应用程序尝试加载 comctl32.dll,即使在其搜索路径中(甚至在同一文件夹中)已有一个版本,Windows 也会代替 给它 版本 6 comctl32.dll。这个 dll 隐藏在特殊的位置,人们不应该接触的地方:

 Directory of C:\Windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7600.16385_none_421189da2b7fabfc

07/13/2009  09:03 ᴩᴍ         1,680,896 comctl32.dll
               1 File(s)      1,680,896 bytes

Bonus chatter: The reason WinSxS is so large is because it contains every version of every dll that someone might want. i count 3,619 assemblies in there. The reason you don't want to delete WinSxS is that a program wants one of those dlls.

听起来您想要的解决方案是为 Qt 创建一个程序集 list (它定义了一系列相关的 dll),然后注册那个程序集Windows 并排系统。

不幸的是,似乎为了放置在 WinSxS 中,程序集文件必须进行数字签名。 似乎只有通过 Windows Installer 才能将程序集安装在并排缓存中:

You should install shared side-by-side assemblies as components of a Windows Installer package. This can be the same installation package used to install or update your application. If the shared assembly is shipped as part of multiple applications, you should provide a merge module that can be incorporated into these applications' installation packages and create a catalog for the files in the assembly.

Windows Installer version 2.0 or later is required to install assemblies. For more information, see the Windows Installer SDK and the sections under Installation of Win32 Assemblies.

另见

关于windows - 如何创建 list 文件以将我的可执行文件/插件指向我的特定版本的 Qt.dll?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6310152/

相关文章:

windows - 有人在使用 Visual Studio 2008 时遇到速度缓慢的情况吗?

c++ - 仪器一直告诉我我有内存泄漏

maven - 在 Nexus 中部署 Artifact 时出错

node.js - 应用引擎部署关闭, "The Node.js binary could not be verified"

java - 在 jBoss AS 中创建模块

windows - PHP Kohana 3.2.2 多部分形式 $_POST 未在 MAC 上设置但适用于 Win

Windows中的python选项卡完成

c++ - 如何在 Qt Creator 项目向导中添加自定义构建步骤?

c - Dll注入(inject)失败

c++ - 从 Qt4 上的另一个表单捕获表单的关闭事件