InstallShield UseDLL()在同一目录中找不到dll依赖项 [英] InstallShield UseDLL() doesn't find dll dependencies in the same directory

查看:183
本文介绍了InstallShield UseDLL()在同一目录中找不到dll依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有1个dll文件,我尝试在其中一个安装脚本中使用UseDLL()加载该dll文件. 这个dll有2个dll取决于它.它们都位于主DLL的同一目录中.

I have 1 dll file which I try to load during the installation with UseDLL() in one of my installscripts. this dll has 2 dlls it depends on. they both located on the same directory of the main dll.

在使用较旧的installshield进行安装时,它会发现它具有依赖性并可以正常工作. 当我尝试使用IS2016构建它时,它失败了,因为找不到它的依赖项. (如果我将这两个dll放入SysWOW64中-它会找到它们并可以正常工作.)

When in build the installation with an older installshield - it find it's dependencies and works fine. When I try to build it with IS2016, it fails because it doesn't find it's dependencies. (If I put these 2 dlls in SysWOW64 - it finds them and works fine).

出什么问题了?

谢谢, 杜迪

推荐答案

它看起来像InstallShield 2018

It looks like InstallShield 2018 makes this easier through a new Enable/Disable flag called DLL_DIRECTORY_SUPPORTDIR. But in InstallShield 2016 there's a good chance you can add the following InstallScript code to find dependencies in SUPPORTDIR. If your DLLs are in a different directory, substitute that instead.

// 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是否会为您执行此操作.)

Note that doing this removes some protection against DLL planting, so it is safest to do this only if you ensure the DLLs in question are either proactively resistant to such things, or if you vet and secure the directory in question. (I'm uncertain whether InstallShield does this for you.)

这篇关于InstallShield UseDLL()在同一目录中找不到dll依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆