This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Problem calling a DLL function in InstallScript
Subscribe
- 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
‎Jan 23, 2013
02:28 PM
Problem calling a DLL function in InstallScript
Hello...
I have placed the following code in OnFirstUIAfter function:
The prototype is as follows:
And the C++ function has this signature:
I have added the InstallHelper dll in Support Files / Bilboards.
When above code is run, an error teling that the function cannot be located is displayed.
What am I missing?
Thanks a lot in advance
Jaime
I have placed the following code in OnFirstUIAfter function:
UseDLL( SUPPORTDIR ^ "InstallHelper.dll" );
bResult = InstallHelper.SaveDbConnection( ISMSI_HANDLE );
UnUseDLL( SUPPORTDIR ^ "InstallHelper.dll" );
The prototype is as follows:
prototype stdcall NUMBER InstallHelper.SaveDbConnection( HWND );
And the C++ function has this signature:
UINT __stdcall SaveDbConnection(MSIHANDLE hInstall)
I have added the InstallHelper dll in Support Files / Bilboards.
When above code is run, an error teling that the function cannot be located is displayed.
What am I missing?
Thanks a lot in advance
Jaime
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 25, 2013
04:23 PM
Maybe an unresolve reference while loading. You could use filemon/process explorer in order to see if the file is accessed correctly in your temp folder.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 25, 2013
05:54 PM
You might also use Dependency Walker or dumpbin /exports to see if your function is being exported. Did you create a .def file in your DLL project?
It also appears your DLL function has the correct signature to be called directly from an MSI DLL custom action, without needing to go through the script. Is that an option?
P.S. This ancient newsletter tip (PDF) goes over that kind of thing: http://www.flexerasoftware.com/webdocuments/PDF/dlls-for-ipwi.pdf.
It also appears your DLL function has the correct signature to be called directly from an MSI DLL custom action, without needing to go through the script. Is that an option?
P.S. This ancient newsletter tip (PDF) goes over that kind of thing: http://www.flexerasoftware.com/webdocuments/PDF/dlls-for-ipwi.pdf.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 25, 2013
07:54 PM
Thanks... I have uses Dependency Walker and see that the exported function was decorated. I have created a DEF file and now the function is not decorated. I cannot test it right now as I have to solve the other problem before.
But one question regarding this.
According to the PDF you pointed me to, I have to create a custom action and insert it into a sequence, but I have read in IS documentation that for InstallScript project, sequence is not taken into account, and in fact, the sequences view shows a lot of thinks that are not actually displayed when running the installation. That s why I am calling the DLL directly in the script.
I think with the change I have made, it will work, but please explain me what I wrote in the paragraph above.
Thanks
Jaime
But one question regarding this.
According to the PDF you pointed me to, I have to create a custom action and insert it into a sequence, but I have read in IS documentation that for InstallScript project, sequence is not taken into account, and in fact, the sequences view shows a lot of thinks that are not actually displayed when running the installation. That s why I am calling the DLL directly in the script.
I think with the change I have made, it will work, but please explain me what I wrote in the paragraph above.
Thanks
Jaime
RobertDickau wrote:
You might also use Dependency Walker or dumpbin /exports to see if your function is being exported. Did you create a .def file in your DLL project?
It also appears your DLL function has the correct signature to be called directly from an MSI DLL custom action, without needing to go through the script. Is that an option?
P.S. This ancient newsletter tip (PDF) goes over that kind of thing: http://www.flexerasoftware.com/webdocuments/PDF/dlls-for-ipwi.pdf.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 25, 2013
08:47 PM
Thanks... I have tested it and it worked.
Now I need to find the solution for the other errors I encountered.
Regards,
Jaime
Now I need to find the solution for the other errors I encountered.
Regards,
Jaime
RobertDickau wrote:
You might also use Dependency Walker or dumpbin /exports to see if your function is being exported. Did you create a .def file in your DLL project?
It also appears your DLL function has the correct signature to be called directly from an MSI DLL custom action, without needing to go through the script. Is that an option?
P.S. This ancient newsletter tip (PDF) goes over that kind of thing: http://www.flexerasoftware.com/webdocuments/PDF/dlls-for-ipwi.pdf.