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

Call a function in a Windows Installer DLL


4 replies to this topic

Ajawl

Ajawl
  • Members
  • 54 posts

Posted 03 December 2001 - 16:45

Hi People,
I am trying to call a function in a Windows Installer DLL stored in the Binary table.
I did a Custom Action to call this funcion.
When I place this Custom Action during the Execute Sequence, it works correctly.
When I place this Custom Action during the UI Sequence, the funcion is called, executed and then it happens an internal error 2735. This Windows Installer error means "Custom action terminated prematurely".
May I not use this kind of Custom Action during the UI Sequence?
What else can I do?
Thank you for your help,
Ajawl

Irina

Irina
  • Members
  • 227 posts

Posted 03 December 2001 - 19:25

Hi,
What does this custom action do? I seems to me you coudln't use some MSI function in UI sequence.

Ajawl

Ajawl
  • Members
  • 54 posts

Posted 04 December 2001 - 11:35

Hi Irina,
Originally, the DLL function called by the Custom Action  executes API functions and then the MSI function MsiSetProperty( ).

Just to test, I compiled again the DLL without code inside the same funcion. But then I had the same Windows Installer Internal Error 2735 while trying to execute the Custom action (which called the empty function) during the UI sequence.

My Custom Action is defined as follows:

Type: 65
Source: NewBinary1 (the DLL is saved at the Binary Table)
Target: MyFunction

The definition of  "MyFunction" in the DLL is as follows:

__declspec(dllexport) void MyFuncion (MSIHANDLE hInstHandle)
{// empty function
}

Is it not possible?

Thank you for your help,
Ajawl


Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 04 December 2001 - 12:37

__declspec(dllexport) UINT __stdcall MyFunction (MSIHANDLE hInstHandle)
{// empty function
  return ERROR_SUCCESS;
}


Ajawl

Ajawl
  • Members
  • 54 posts

Posted 04 December 2001 - 14:42

Thank you Ian.
I compiled "MyFunction" with the calling convention _stdcall and now the Custom Action is working.

Ajawl