call function in a dll - Advanced Installer Community
azhockeynut
Posts: 8
Joined: Fri Feb 14, 2014 4:27 pm

call function in a dll

I am evaluating the product, so far so GREAT!
I have a custom c# dll that we wrote, I want to package it with our installer, and use some of its functions.

I need help trying to do this, maybe I have it out of order or something?

I have a CA for it, (the dll works, I wrote a console app and tested the function fine), but no matter how I call the dll (attacked native dll, installed, standard) I cannot seem to make it work. Remember I want to package it.

Our app we are installing requires lots of configuration, as an example, email notification, the dll has a function SendMail, when passed the parameters it will send a mail as a test. We want to test things before we write all of the configurations. The questions are in the interview stage of the install, and the files are copied at the end, naturally, so it is not there yet to call if I package it. Is there a way to have a single step that unpackages that one file, say to %TEMP%, so I can use it? I will delete it off the customer system during the install finalize.


so as an example, my CA calls %TEMP%\mailchecker.dll
Function SendMail
Action Data: [SMTP_TO] [SMTP_FROM] [SMTP_PORT] [SMTP_HOST] [SMTP_PASS] [SMTP_USER] [SMTP_AUTH_DOMAIN] [SMTP_SUBJECT] [SMTP_BODY] [SMTP_USESSL]

Or in another spot I tried the std dll, pointing to it, return type Unicode string (it can return success/failure) property is MailSent tried both calling conventions (standard and C) and have the arguments listed, no joy it fails.

I usually get an error like this Error 4157. Failed to load

any help or tutorial that someone can offer, I need to decide if we are buying shortly

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

Re: call function in a dll

Hi,

Can you add your file using the [Temporary Files] toolbar button available in the Files and Folders page and see if it works? In this case the temporary file will be copied on the machine during the CostFinalize standard action, at the beginning of the setup and removed during the InstallFinalize standard action.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
azhockeynut
Posts: 8
Joined: Fri Feb 14, 2014 4:27 pm

Re: call function in a dll

that is what I am going to try next. the dev making the dll says he needs to make it a bit differently so it understands the msi info and session info. hope to try soon

Return to “Building Installers”