How to call 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!

sagar
Posts: 39
Joined: Tue Dec 13, 2011 2:53 pm

How to call function from standard dll

Hi,
I have created one class library project in which I have written the function to update .config file.When I called that function by adding call function from standard dll custom action.When I try to install my web project installer is throwing "Function UpdateURL not found in dll" error message.
Please tell solution for above problem.I have attached the .api file with this post.
Attachments
Demo.aip
(36.37 KiB) Downloaded 740 times
sagar
Posts: 39
Joined: Tue Dec 13, 2011 2:53 pm

Re: How to call function from standard dll

Hello,
Do you got any solution for my problem.Please give me replay
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: How to call function from standard dll

Can you please select directly the DLL file, instead of manually creating its path, to make sure it is correctly resolved by the package? You should get a reference like this one, "[#MyFile.dll]".

Also, if the DLL is written in .NET you can try using the following type of custom actions:
http://www.advancedinstaller.com/user-g ... rp-ca.html

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sagar
Posts: 39
Joined: Tue Dec 13, 2011 2:53 pm

Re: How to call function from standard dll

Hi Bogdan,
Thank you for your replay.By taking reference from your last post I have created .Net installer class to update .config file which is present in .xap file, But when I try to use

Code: Select all

Dim zipFile As ZipFile = New ZipFile("C:\Program Files\Test\Test\TH5WebApp\ClientBin\SilverlightApplication.xap")
installer show me error "dialog ErrorDlg has the error style bit set,but is not an error dislog ".I have writen that code in Install function.
1>If ZipFile object is not supported in installer then Please tell me other method to read the content in .xap file & modify that file.
I have attached .api project with this post.
Attachments
Test.aip
Demo project
(27.12 KiB) Downloaded 652 times
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: How to call function from standard dll

Please note that in my previous post I was recommending the fledged C# method, not the .NET Installer Class custom action. For the latter one you need a different implementation, more complicated.

If you have created the fully fledged C# custom action as in the link from my previous post you simply add it as "New Attached Custom Action". For step be step instructions on how to add the custom action analyze the last paragraph from the same article:
http://www.advancedinstaller.com/user-g ... rp-ca.html

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sagar
Posts: 39
Joined: Tue Dec 13, 2011 2:53 pm

Re: How to call function from standard dll

Thank you very much it work.
I have small problem regarding accessing installer public property inside VB custom action Project.I have written following sentence to get property

Code: Select all

Dim pro As String= session["YOUR_PROPERTY"]
installer give me exception that "Cannot access session details from a non-immediate custom action".
Is this the right code to get the public property?
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: How to call function from standard dll

Hi,

Yes, the code is correct. Here you can see more details given by my colleague on how to set/get properties:
http://www.advancedinstaller.com/forums ... 751#p47436

The error message you receive appears because the custom action is not set as "Immediate", from Custom Actions page. Windows Installer allows only Immediate custom actions to set/get public properties, deferred custom action have can only read a reduced set of reserved properties. To fix the problem just select the custom action and set it as "Immediate", then rebuild the package.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sagar
Posts: 39
Joined: Tue Dec 13, 2011 2:53 pm

Re: How to call function from standard dll

When I select "Immediate execution" option in custom action page,Installer get terminated abnormally.
I have call that custom action by using DoAction event of button.
sagar
Posts: 39
Joined: Tue Dec 13, 2011 2:53 pm

Re: How to call function from standard dll

Do you got any solution about this problem?
sagar
Posts: 39
Joined: Tue Dec 13, 2011 2:53 pm

Re: How to call function from standard dll

I have attached .api file with this post.In this project I called custom action at Init Event of FolderDig.
When Folder dialog open installer get terminated abnormally.
Please give me solution for above problem.
Attachments
IPSetUp.aip
(9.54 KiB) Downloaded 487 times
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: How to call function from standard dll

The problem is that you have added the custom action as an installed one, not attached. So the file is not yet available on the machine at the moment "FolderDlg" is loaded.

The solution is very simple, delete the current custom action, right click on "UI Custom Actions" tree and select "New Attached Custom Action" from the context menu, then go back in Dialogs page and add the custom action on FolderDlg.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”