Return Value Custom Function from standard DLL - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

Marcel
Posts: 7
Joined: Mon Feb 08, 2010 12:40 pm

Return Value Custom Function from standard DLL

Hello,

I have a dll written in Delphi and was trying to test for a correct return code (1602),
but according to the install log the return code is always 1, even if i simply return 1602 instantly.

Code: Select all

MSI (s) (48:14) [12:37:20:199]: Doing action: InitDatabase
Actie 12:37:20: InitDatabase. 
Actie gestart 12:37:20: InitDatabase.
InitDatabase: 
Actie gestopt 12:37:20: InitDatabase. Return value 1.
I'm calling a method which initializes my firebird database with initial data after the firebird service has been started.
So i've put a custom action after the Start Services in the installExecuteSequence.
If for some reason the action could not be run, the installation is invalid and it should rollback the installation.
The action is Sync, check return code and Deferred.
Any ideas why the return code is always 1 ?
Delphi code:

Code: Select all

Function InitDatabase(aInitialData: pWideChar): HRESULT; stdcall;
begin
  Result := 1602;
end;

Thanks in advance.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Return Value Custom Function from standard DLL

Hello,

Please send your .aip project file and the DLL you are testing this with to support at advancedinstaller dot com so we can investigate this.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
Marcel
Posts: 7
Joined: Mon Feb 08, 2010 12:40 pm

Re: Return Value Custom Function from standard DLL

I will try to get you the project and dll asap.
In the meantime i did some more tests, and found out that when i use the same function
through an Attached Custom Action there appears to be no problem at all.
Using the dll in an Attached Custom Action also has the advantage of being able to access the msi.
I can simply add the data needed in the Action Data and retrieve it within the dll.
After ofcourse translating the msi headers to Delphi.

Return to “Common Problems”