sskanna82
Posts: 7
Joined: Wed Jun 24, 2009 7:59 am

Call a function from a standard dll

Hi,
I do not like to use the ODBC connectivity for SQL Scripts running process,Instead of that i want to create a vb.net based dll for SQL scritping process. But i dont know how to Call a function from a standard dll with advanced installer setup. It am not clear about the below document reference in Advanced Installer.Any can suggest how to acheive this?

Call a function from a standard dll
This predefined custom action can be used to call a function from a dll. Unlike native dll custom action where the function you call must have a predefined signature this custom action allows you to call a function with any signature. Use the Edit Function dialog to easily describe the signature of the function you want to call (the result will be shown in the "Action Data" field).

Regards,
Kannan.S
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Call a function from a standard dll

Hello,

I have posted a solution for your problem. It can be found here. Please feel free to get back with any issues you might encounter.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
Moumita
Posts: 9
Joined: Mon Oct 12, 2009 12:42 pm

Re: Call a function from a standard dll

I have a .net dll which have a fuction with the folowing signature
public void CreateFile()

But during installation whenever i am trying to call this function following error msg are shown ...what I am missing to set in my installer

Function 'CreateFile' not found in dll 'dll path'
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Call a function from a standard dll

Hello,

Please note that managed code custom actions are not supported by Windows Installer. You will have to use unmanaged code to build your custom action in order for it to properly work with you installer.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
Moumita
Posts: 9
Joined: Mon Oct 12, 2009 12:42 pm

Re: Call a function from a standard dll

hi

Is there any way to access .net dll or .net weservice from advanced installer.

.Net Installer Class action ???????
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Call a function from a standard dll

Hello,

You can try using the .NET Custom Action to achieve this. Note that you will need to implement certain methods of the Installer Class in order for your custom action to function properly. More details can be found on this page.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
Moumita
Posts: 9
Joined: Mon Oct 12, 2009 12:42 pm

Re: Call a function from a standard dll

Hi

I have gone through your link . its really good.
But my requirement is something different.

I have .net Window application,
.net dll,
.net webservice

I have to use advanced installer because I need to add many dialogs in my setup file
one of them have a combobox which will be populated by a webservice call.
After installation I need to call another webservice method and the .net dll method
to perform some activity.

Approach I have taken :

I have create a professional project pointing to my window Application.
Using Custom Action wizard I have setup the custom action ( Point to the dll and the function )
but when running it is giving an error message "function not found in the dll"

Please response as soon as possible .
Last edited by Moumita on Mon Oct 19, 2009 12:24 pm, edited 1 time in total.
Moumita
Posts: 9
Joined: Mon Oct 12, 2009 12:42 pm

Re: Call a function from a standard dll

Using your advanced installer
How can I call an exe after installing
Moumita
Posts: 9
Joined: Mon Oct 12, 2009 12:42 pm

Re: Call a function from a standard dll

GabrielBarbu wrote:Hello,

You can try using the .NET Custom Action to achieve this. Note that you will need to implement certain methods of the Installer Class in order for your custom action to function properly. More details can be found on this page.

Regards,
Gabriel

thanks , I have done this
Moumita
Posts: 9
Joined: Mon Oct 12, 2009 12:42 pm

Re: Call a function from a standard dll

using Professional type project can we change the dialog image and text ???
please reply soon
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Call a function from a standard dll

Hi,

In a Professional project you can change only the installer theme by using the Global Properties page. If you want to modify the installation dialogs you can use only an Enterprise project.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Moumita
Posts: 9
Joined: Mon Oct 12, 2009 12:42 pm

Re: Call a function from a standard dll

well.....thak u


Now in my custom action section I have called an Exe in Commit

Exe is working fine but when I am closing the exe it gets an error.

System.InvalidOperationException: Could not find default endpoint element that references contract 'SASPServiceAPI.Service1Soap' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.

Exe is calling an webservice ....websevice calling is ok ....It shos a list of data and it updates a db table .....but when I am trying to close the form it shows the above error
Moumita
Posts: 9
Joined: Mon Oct 12, 2009 12:42 pm

Re: Call a function from a standard dll

I have attached my the exe in commit action ........
but what i have observed that exe is called two times ...why ??????
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Call a function from a standard dll

Hi,
Exe is working fine but when I am closing the exe it gets an error.
For EXE custom actions any return value different than 0 is interpreted as failure. Most likely the EXE you are launching is not returning 0. You can try using the "Synchronous execution, ignore return code" option in the Custom Action Properties pane.
have attached my the exe in commit action ........
but what i have observed that exe is called two times ...why ??????
I'm not sure why you are encountering this behavior. Can you please send us the .AIP (project) file you are using and a verbose log of the installation to support at advancedinstaller dot com so we can investigate them?

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Feature Requests”