XiaoFaye
Posts: 11
Joined: Mon Jun 16, 2014 9:22 pm

can I call a function in a .NET dll file?

Can I call a function in a .NET dll file during the installation using Advanced Installer? My company is going to replace the WISE installer, we are looking for an alternative. Thanks!
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: can I call a function in a .NET dll file?

Hi and welcome to Advanced Installer forums.

Thank you for your interest in Advanced Installer.

Yes, you can achieve this if your DLL file is created as described in the How do I create fully fledged C# custom actions article or if it is a .Net Installer Class custom action.

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
XiaoFaye
Posts: 11
Joined: Mon Jun 16, 2014 9:22 pm

Re: can I call a function in a .NET dll file?

Hi

Thanks for the answer, I understand the dll need to be written as described. but if this is a third-party component which we can't make any changes, that means the only thing I can do is building a wrapper dll as described for it?


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

Re: can I call a function in a .NET dll file?

Hi,

Yes, you can try to create a wrapper DLL or EXE file and it should work. After you create the wrapper, you can call it using the "Launch attached file" or "Call function from attached native DLL" custom actions and in order for that wrapper to find the third party DLL, you should place the third party DLL in the "Windows Volume -> Temporary" folder from the "Files and Folders" page using the [Temporary File] toolbar button.

Another workaround (maybe easier), is to use the "Run Windows PowerShell Script" predefined custom action, and call your DLL functions using PowerShell script.

However, you can first try to see if the third party DLL is not already a native Windows Installer DLL.

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

Return to “Common Problems”