- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- UseDLL fails to load dll
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
UseDLL fails to load dll
Hi,
I have IS 2022 InstallScript MSI project.
In install script setup.rul I try to use UseDLL but it fails to load the dll. The dll does not have any dependencies.
I also tried with a dll that does have dependencies and they are all in the same folder.
As seen below, I even hard-coded the path and dll name in UseDLL directly to rule out any issues.
I also added c:\testfolder to the system level path env variable to make sure there are no loading issues.
Kindly help.
nResult = UseDLL ("C:\\testfolder\\test.dll");
if (nResult = 0) then
MessageBox ("UseDLL successful \n\n.dll file loaded.", INFORMATION);
else
MessageBox ("UseDLL failed.\n\nCouldn't load .dll file.", INFORMATION);
//abort;
endif;
thanks.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
folks appreciate any help with this...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
wanted to add that I am trying to load dll that is 64bit.
I tried to load also a 32 bit dll but that also failed.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
update:
I am able to load 32bit dll.
However, what I want is to load a 64bit dll. Can someone kindly confirm if it is a known with InstallShield not being able to load 64bit dll?
Please suggest as to how I can load 64bit dll.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
agshah,
What language is your DLL written in? We haven't explicitly compiled and used DLLs as 64bit, but in C# when compiled as AnyCPU we are able to use them via DotNetCoCreateObject instead.
https://docs.revenera.com/installshield26helplib/LangRef/DotNetCoCreateObject.htm
The only DLL we use with UseDLL is an ancient 32bit C++ one that we have not converted yet. I don't see any explicit limitation listed in the UseDLL documentation pertaining to 32/64bit, so I can't say for sure if 64bit is or is not supported.
HTH
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
agshah,
What language is your DLL written in? We don't specifically build a DLL as 64bit, but are able to use a C# DLL compiled as AnyCPU with the DotNetCoCreateObject function instead.
https://docs.revenera.com/installshield26helplib/LangRef/DotNetCoCreateObject.htm
We do have one ancient 32bit C++ DLL we haven't converted yet that we use with UseDLL. I don't see any restrictions listed in the UseDLL documentation on whether or not 64bit DLLs are supported, so I can't say for sure.
Perhaps this would help as well
https://community.flexera.com/t5/InstallShield-Forum/UseDLL-to-load-64bit-dll/m-p/99459
HTH
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi,
thanks very much for your response. The 64bit dll I am trying to load is written in C lang. We have a 32bit version of the same dll which I am able to load.
The first link you provide does not apply to me because we are using a 64bit C dll and not managed Any CPU assembly.
I looked at your second link and I am familiar with that. I have set the settings such as x64 in my project so it meets the requirement.
I am thinking, isn't InstallShield 32 bit still? If so, that may explain why I am not able to load 64 bit dll. I wish someone from InstallShield can provide some input and also advise how to load 64bit C dll and invoke API.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @agshah
We wont be able to load 64 bit dll using use dll function, its a limitation. And we have an enhancement request for the same and which will be fixed in our upcoming releases.
You can refer our KB article, which explain on how to use 64 bit. please refer it.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi Varul,
When will the enhancement be available so we can load a 64 bit dll, either through UseDLL or by any other means in InstallShield?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
How did u fix the issue with 32 bit dll?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi Lukesh,
We are able to load 32bit dll using UseDLL but not 64bit dll and I have not heard from InstallShield if IS 2024 will be able to load it. As per some replies, IS 2024 was supposed to have this enhancement. But again, no replies from IS.