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
- :
- UseDLL() not working in Basic MSI
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
‎Jun 09, 2010
03:19 PM
UseDLL() not working in Basic MSI
Hello,
I'm new to Basic MSI installs and I'm having problems getting UseDLL(..) to work. It works just fine in my Installscript MSI install, but it never works in a Basic MSI. I took a look into the documentation and there's nothing in there that says it is not compatable with Basic MSI's, so does anything know how to get it to work?
Here's my code:
I'm new to Basic MSI installs and I'm having problems getting UseDLL(..) to work. It works just fine in my Installscript MSI install, but it never works in a Basic MSI. I took a look into the documentation and there's nothing in there that says it is not compatable with Basic MSI's, so does anything know how to get it to work?
Here's my code:
szDLL = SUPPORTDIR ^ "MyDLL.dll";
ChangeDirectory (SUPPORTDIR);
if (UseDLL (szDLL) != 0) then
MessageBox ("UseDLL failed.", INFORMATION);
abort;
endif;
(7) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 09, 2010
03:31 PM
Assuming converting it to "MSI DLL" format, etc., and calling directly as a custom action aren't in the cards, perhaps try getting the value of the SUPPORTDIR property, rather than the variable (see "Placing Files in the .msi Database and Extracting Them During Run Time" and "SUPPORTDIR"), or place in the Binary table and use StreamFileFromBinary?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 10, 2010
09:34 AM
Thanks for the reply.
It wasn't a pathing issue. I wasn't sure how to convert my DLL to MSI DLL format, so I tried putting it into the binary table and calling StreamFileFromBinary and this worked.
Thanks again.
It wasn't a pathing issue. I wasn't sure how to convert my DLL to MSI DLL format, so I tried putting it into the binary table and calling StreamFileFromBinary and this worked.
Thanks again.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 11, 2010
08:24 AM
Hello Scottd72,
I have the same problem. Can you explain me how to do to use StreamFileFromBinary please?
thanks.
I have the same problem. Can you explain me how to do to use StreamFileFromBinary please?
thanks.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 11, 2010
10:25 AM
I can tell you how I used StreamFileFromBinary(), but I'm not sure it is the correct way. Maybe someone could chime in if I am wrong. Also, a warning, as a result of doing this I had corrupted my project file - so I'm guessing my approach is not correct or else this is a bug in IS.
Fortunately, there is a simple workaround for this file corruption issue which can be found here: http://community.flexerasoftware.com/showthread.php?t=190268
Anyway, to answer your question. I put my DLL file into supportfiles. Then, I went to Direct Editor -> Binary and added my DLL there, with the name MY_DLL and the ISBuildSourcePath as\support files\MyDLL.dll. Then in the custom action script I put this:
Hope this helps.
Fortunately, there is a simple workaround for this file corruption issue which can be found here: http://community.flexerasoftware.com/showthread.php?t=190268
Anyway, to answer your question. I put my DLL file into supportfiles. Then, I went to Direct Editor -> Binary and added my DLL there, with the name MY_DLL and the ISBuildSourcePath as
nLength = MAX_PATH + 1;
MsiGetProperty(hwnd, "SUPPORTDIR", szSupportDir, nLength);
szFileName = szSupportDir ^ "MyDLL.dll";
nResult = StreamFileFromBinary (hwnd, "MY_DLL", szFileName);
if (UseDLL (szFileName) != 0) then
MessageBox ("UseDLL failed.", INFORMATION);
abort;
endif;
Hope this helps.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 11, 2010
10:34 AM
Thank you very much. 😮
I will try that on monday, because I must go now.
I hope this will work for me too.
I will try that on monday, because I must go now.
I hope this will work for me too.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 14, 2010
01:45 AM
Hi,
Now I'm not so tired, I know that your problem isn't the same as mine. (mine is explain here : http://community.flexerasoftware.com/showthread.php?p=456292&posted=1#post456292)
I manage to use my dll using the custom actions (new standard dll > stored in binary table)
(you can found my project in the topic which is linked, if this can help you...)
But my problem is only to use strings in functions of the DLL.
Thank you very much for your help.
Have a good day.
Now I'm not so tired, I know that your problem isn't the same as mine. (mine is explain here : http://community.flexerasoftware.com/showthread.php?p=456292&posted=1#post456292)
I manage to use my dll using the custom actions (new standard dll > stored in binary table)
(you can found my project in the topic which is linked, if this can help you...)
But my problem is only to use strings in functions of the DLL.
Thank you very much for your help.
Have a good day.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 07, 2013
03:49 PM
What happens if the DLL I want to use resides on the PC in a directory from a different install? Will UseDLL still work? Will I have to change BACK to the install dir (where I am running setup.exe from) after UseDLL is successful?
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)