InstallShield UseDLL()在同一目录中找不到dll依赖项

问题描述 投票:0回答:1

我有一个dll文件,我尝试在安装期间使用我的一个安装脚本中的UseDLL()加载。这个dll有2个dll它依赖。它们都位于主dll的同一目录中。

在使用旧的installshield构建安装时 - 它发现它的依赖关系并且工作正常。当我尝试使用IS2016构建它时,它失败了,因为它没有找到它的依赖项。 (如果我把这两个dll放在SysWOW64中 - 它找到它们并且工作正常)。

问题是什么?

谢谢,杜迪

dll dependencies installshield installscript
1个回答
1
投票

它看起来像InstallShield 2018 makes this easier通过一个名为DLL_DIRECTORY_SUPPORTDIR的新启用/禁用标志。但是在InstallShield 2016中,您很有可能添加以下InstallScript代码以在SUPPORTDIR中查找依赖项。如果您的DLL位于不同的目录中,请替换它。

// Add prototype for SetDllDirectory(); this typically goes near the top of your script
prototype number kernel32.SetDllDirectoryW(wstring);
// Call it; this goes in a function called before your UseDLL call
SetDllDirectoryW(SUPPORTDIR);

请注意,这样做会消除对DLL种植的一些保护,因此,只有在确保有问题的DLL主动抵制此类操作或者您检查并保护相关目录时才最安全。 (我不确定InstallShield是否会为你做这件事。)

© www.soinside.com 2019 - 2024. All rights reserved.