Problem during call from standard DLL custom action - Advanced Installer Community
kocrotus
Posts: 3
Joined: Mon Nov 30, 2015 4:04 am

Problem during call from standard DLL custom action

Hello all, I am quite new to advanced installer and currently trying the trial version of the advanced installer with architect edition(I want to try the custom dialog with dll call). I' am impressed how so many advanced capabilites translated into "non script" action in advanced installer :D .

I used to play around with installshield and loved the way installshield ability to load and call my DLL during installation process. I tried to implement the same scenario with advanced installer and see if this product also has the same capabilities.

I've browsed and searched this forum and googling about the dll load, but so few of them explaining how to successfully load and call the DLL from within the installer.

I've problem with call dll , because the log showed me error about can not find specified module.
For information, I've put my DLL in temporary folder and my DLL depends on some other DLL that I already put in the same temporary folder.
But, no matter what I do , the process of calling the DLL always failed , here is a piece of my log :
=========================================================
...
...
...
...

ction 10:26:44: AI_ExtractTempFiles.
Action start 10:26:44: AI_ExtractTempFiles.
MSI (c) (D4:C8) [10:26:44:640]: Invoking remote custom action. DLL: C:\Users\wisnu\AppData\Local\Temp\MSIE594.tmp, Entrypoint: ExtractTempFiles
MSI (c) (D4!AC) [10:26:44:697]: PROPERTY CHANGE: Adding AITEMPFILESEXTRACTED property. Its value is 'YES'.
MSI (c) (D4!AC) [10:26:44:737]: PROPERTY CHANGE: Adding AI_COMPANION.DLL property. Its value is 'C:\Users\wisnu\AppData\Local\Temp\companion.dll'.
MSI (c) (D4!AC) [10:26:44:786]: PROPERTY CHANGE: Adding AI_COMPHLPR.DLL property. Its value is 'C:\Users\wisnu\AppData\Local\Temp\comphlpr.dll'.
MSI (c) (D4!AC) [10:26:44:825]: PROPERTY CHANGE: Adding AI_SYST_MDI.DLL property. Its value is 'C:\Users\wisnu\AppData\Local\Temp\syst_mdi.dll'.
MSI (c) (D4!AC) [10:26:44:872]: PROPERTY CHANGE: Adding AI_LMGR_HLPRIS.DLL property. Its value is 'C:\Users\wisnu\AppData\Local\Temp\lmgr_hlpris.dll'.
MSI (c) (D4!AC) [10:26:44:913]: PROPERTY CHANGE: Adding AI_LOGSDK.DLL property. Its value is 'C:\Users\wisnu\AppData\Local\Temp\logsdk.dll'.
MSI (c) (D4!AC) [10:26:44:948]: PROPERTY CHANGE: Adding AI_TEMP_FILE_ROLLBACK_INFO property. Its value is 'C:\USERS\WISNU\APPDATA\LOCAL\TEMP\COMPANION.DLL|C:\USERS\WISNU\APPDATA\LOCAL\TEMP\|C:\USERS\WISNU\APPDATA\LOCAL\TEMP\COMPHLPR.DLL|C:\USERS\WISNU\APPDATA\LOCAL\TEMP\SYST_MDI.DLL|C:\USERS\WISNU\APPDATA\LOCAL\TEMP\LMGR_HLPRIS.DLL|C:\USERS\WISNU\APPDATA\LOCAL\TEMP\LOGSDK.DLL'.
Action ended 10:26:44: AI_ExtractTempFiles. Return value 1.
MSI (c) (D4:A8) [10:26:45:003]: Doing action: MigrateFeatureStates
Action 10:26:45: MigrateFeatureStates. Migrating feature states from related applications
Action start 10:26:45: MigrateFeatureStates.
Action ended 10:26:45: MigrateFeatureStates. Return value 0.
MSI (c) (D4:A8) [10:26:45:092]: Doing action: WelcomeDlg
Action 10:26:45: WelcomeDlg.
Action start 10:26:45: WelcomeDlg.
MSI (c) (D4:A0) [10:26:47:656]: PROPERTY CHANGE: Modifying USER_INFO_PROP property. Its current value is ' '. Its new value: ' C'.
Action ended 10:26:48: WelcomeDlg. Return value 1.
MSI (c) (D4:A8) [10:26:48:870]: Doing action: AI_DATA_SETTER_5
Action 10:26:48: AI_DATA_SETTER_5.
Action start 10:26:48: AI_DATA_SETTER_5.
MSI (c) (D4:A8) [10:26:48:936]: PROPERTY CHANGE: Adding CustomActionData property. Its value is 'C:\Users\wisnu\AppData\Local\Temp\lmgr_hlpris.dll?I;RES_VERIFY_MY_DATA;C;verifyMyData;S;S;P;USER_INFO_PROP?'.
Action ended 10:26:48: AI_DATA_SETTER_5. Return value 1.
MSI (c) (D4:A8) [10:26:48:980]: Doing action: UserInfoDlg
Action 10:26:49: UserInfoDlg.
Action start 10:26:49: UserInfoDlg.
Action ended 10:26:49: UserInfoDlg. Return value 1.
MSI (c) (D4:A8) [10:26:49:081]: Doing action: LMGR_HLPRIS_VERIFY_MY_DATA
Action 10:26:49: LMGR_HLPRIS_VERIFY_MY_DATA.
Action start 10:26:49: LMGR_HLPRIS_VERIFY_MY_DATA.
MSI (c) (D4:C0) [10:26:49:170]: Invoking remote custom action. DLL: C:\Users\wisnu\AppData\Local\Temp\MSIF741.tmp, Entrypoint: CallStdFcn
Error 4157. Failed to load C:\Users\wisnu\AppData\Local\Temp\lmgr_hlpris.dll. Error:The specified module could not be found.

MSI (c) (D4!E4) [10:26:50:325]: Product: Aegis LS Manager -- Error 4157. Failed to load C:\Users\wisnu\AppData\Local\Temp\lmgr_hlpris.dll. Error:The specified module could not be found.


CustomAction LMGR_HLPRIS_VERIFY_MY_DATA returned actual error code 1603 but will be translated to success due to continue marking
Action ended 10:26:50: LMGR_HLPRIS_VERIFY_MY_DATA. Return value 1.
MSI (c) (D4:A8) [10:26:50:403]: Doing action: UserInfoDlg
Action 10:26:50: UserInfoDlg.
Action start 10:26:50: UserInfoDlg.
...
...
=========================================================

First, I tought it was because of the dependency to another DLL, but no matter what I did to the DLL source (simple single call without dependency, C call, Standard call), all of them failed in advanced installer.

I also had tried the verbose log using the msiexec command and it showed me the same error about can not find a specific module.

Are there any special requirement to load a custom DLL into the installer ?
Why is it so difficult for advanced installer to call custom DLL, while the installshield can do it easily ?

Thank you.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Problem during call from standard DLL custom action

Hi and welcome to Advanced Installer forums.

Thank you for your interest in Advanced Installer.

In order to achieve what you want, you can add only the DLL's dependencies as temporary files, then launch the DLL through the "Call function from attached native DLL" custom action. You can also read the "Using config file with attached DLL" thread which debates a similar problem.

Let us know if this helped, otherwise give us more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kocrotus
Posts: 3
Joined: Mon Nov 30, 2015 4:04 am

Re: Problem during call from standard DLL custom action

Thank you for the help, but what if I want to call the DLL function with parameter and expect a return value ?

The Call function from attached native DLL seems to have less options, I only saw INstalled file, function, and action data.

So, where to put the param and fetch the return value ?

Thank you
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Problem during call from standard DLL custom action

Hi,

The parameters that you want to use as well as the return value can be put in Windows Installer properties. Then, you can access and work with those properties in your DLL functions (i.e. YourVariable = session["YOUR_PROPERTY"];).

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kocrotus
Posts: 3
Joined: Mon Nov 30, 2015 4:04 am

Re: Problem during call from standard DLL custom action

I've tried to use the custom action : call native function from attached dll and put the dependencies in temporary files. This method is not working, it throwed error and based on my search, it is an indicator that the dependency can not be found.

I think it's very hard to call DLL function in advanced installer, or it seems this product pushes for .net installer class. Well, my dll is object pascal DLL and somehow it run smoothly with installshield.

I think I need to change my method to "Non Installer" mode for the function that I put in my DLL, perhaps after install application , cause it's very very very hard to call DLL with advanced installer.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Problem during call from standard DLL custom action

Hi,

I'm not sure why you encounter this problem. When a DLL file is added using the "Call native function from attached DLL" custom action, that DLL is extracted with a random name in a temporary folder when the installation starts and is removed when the installation is finished. So, the problem may happen if the DLL name and the dependencies name should be the same.

Otherwise, can you please send me the .AIP (project file) and a verbose log of the installation to support at advancedinstaller dot com, so I can investigate them?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”