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

DLL function calls from script...


3 replies to this topic

posty

posty
  • Members
  • 58 posts

Posted 14 February 2002 - 21:26

I am using ISWI 2.03...

I have a DLL that was given to me by development.  It has 2 functions in it only...

int LoadLicenseFile(char* fileName);
char* GetValue(char* szSectionName, char* szEntryName);

Development also mentioned in the email...

It is built using C++ and 2 APIs are exported. you can see them using Dependency Walker.

And no more need to call CoInitialize/CoUninitialize. No more to register.
You can just directly call those 2 APIs.

The name of the file is HWLIC.DLL.  I put it in the binary table and I prototype it as...

prototype NUMBER HWLIC.LoadLicenseFile( STRING );
prototype STRING HWLIC.GetValue( STRING, STRING );

And then later on when I try to get ready to call it (before CostFinalize so I can set some other information), I do...

szBinaryKey = "LICENSE_FILE";
szDLLFile = SUPPORTDIR ^ "HWLIC.Dll";
szLicenseFile = "C:\\Temp\\license.lic";

// load the DLL from the binary section...
StreamFileFromBinary( hInstall, szBinaryKey, szDLLFile );

nResult = UseDLL( szDLLFile );

nResult = HWLIC.LoadLicenseFile( szLicenseFile );
szStatus = HWLIC.GetValue( "Server", "EDMS_DOCDOMAIN" ); // TRUE
szStatus = HWLIC.GetValue( "Server", "MSPROJECT" );  // FALSE
szStatus = HWLIC.GetValue( "Server", "BIZCOVE" );   // TRUE

nResult = UnUseDLL( szDLLFile );

However, when I make the LoadLicenseFile call, the install just jumps to the finished dialog and that is it.  I don't get an error or anything.

Any ideas?

Thanks.


gunaveluj

gunaveluj
  • Members
  • 20 posts

Posted 20 February 2002 - 04:40

Try debugging with the log option on.

msiexec /i <YourPackageName> /Lv c:\install.log.

If your dll returns 3, then there is a problem with your dll.

It is better if you test this dll out from another c program before it is put in to installshield.

You can also use the single step option that comes with installshield debugger and find out where exactly the problem is occuring.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 23 February 2002 - 08:39

Check the result of your UseDLL call. Also verify (using debugger or a MessageBox) that SUPPORTDIR contains something valid.

Gripper4Hire

Gripper4Hire
  • Members
  • 9 posts

Posted 22 April 2003 - 02:12

Hi,

This is more than a year too late... but to help anyone that may run across this issue in the future using the excellent search feature...

Try prototyping your function like this:

prototype cdecl NUMBER HWLIC.LoadLicenseFile( STRING );
prototype cdecl STRING HWLIC.GetValue( STRING, STRING );

The "cdecl" after the "prototype" keyword seems to have fixed an extremely similar problem I encountered over this past week when calling external UI through a DLL and Installscript in ISWI 2.03

Regards,

Jon Baker
Logitech, Inc.
Jon Baker[br]QuickCam Team -- Logitech, Inc.[br]