Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

using dll in installscript


2 replies to this topic

Peter Bi

Peter Bi
  • Members
  • 68 posts

Posted 17 January 2002 - 20:42

Hi,

I am using Dev7.02 Basics on W2K.
I am to create a package, the package install services using an external install.dll, but I got problem to load the dll. Since I need to call multiple funcitons in one CA, so I can't stream the dll into binary table, I have to do something like calling UseDLL(..). Here is what I am doing:
1) Create a component, which contains the dll file and will be installed to INSTALLDIR/setup folder.
2) In the IScript CA, I load the dll using UseDLL(INSTALLDIR^"setup"^"mydll.dll").
3) Call the functions of the dll.
4) At the end of CA, call UnUseDLL(INSTALLDIR^"setup"^"mydll.dll").

I got error on loading the dll ...

Here is the problem I guess, my script CA points to the correct location (C:\Program files\mycompany\myproduct\setup) on target machine, but when the CA executed, the folder hasn't been created and there is nothing it can load, even I changed the CA to a deferred one (I read a while ago that there is no 'deferred' CA in Dev7? But I still have the option with CustomAction wizard), it still doesn't work.

It seems the CA can't load dlls from the target folders (if I'm wrong, please correct me here - and let me know how I can do it), so how can I make the CA executed after the files (including dll and other files) have been installed?

Thanks,
Peter


gunaveluj

gunaveluj
  • Members
  • 20 posts

Posted 30 January 2002 - 20:26

I think the only possible solution is to ship your dll along with the product. If your dll is accessing some system calls try using the api's kernel32.dll from within installscript. Most of the other functionality can be performed with in installscript.

mandrews

mandrews
  • Members
  • 44 posts

Posted 31 January 2002 - 15:43

Maybe I'm not understanding the whole problem, but can't you put your DLL in Setup Files/Billboards > Language Independent and then load it using SUPPORTDIR^ "mydll.dll"?