eandersen
Posts: 12
Joined: Fri Nov 28, 2008 7:24 am

DLL written in C#

Is it possible to write DLL's in C# to be used in Custom Actions?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: DLL written in C#

Hi,

I'm afraid that Windows Installer supports only C++ DLLs for attached and installed custom actions. Therefore, C# DLLs are not supported. However, in Advanced Installer you can try using a .NET Installer Class Action.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kkim
Posts: 44
Joined: Thu Apr 12, 2007 3:58 pm

Re: DLL written in C#

cosmin wrote:Hi,

I'm afraid that Windows Installer supports only C++ DLLs for attached and installed custom actions. Therefore, C# DLLs are not supported. However, in Advanced Installer you can try using a .NET Installer Class Action.

Regards,
Cosmin
This is unfortunate indeed! I just had our programmer write a C# DLL!!!

Is it possible to do a work around such as calling an application and getting a TRUE/FALSE output instead?
eandersen
Posts: 12
Joined: Fri Nov 28, 2008 7:24 am

Re: DLL written in C#

I need to get some properties returned from the DLL code.
If I made an EXE file written in C#, will that work?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: DLL written in C#

Hi,
If I made an EXE file written in C#, will that work?
Unfortunately EXE custom actions run in a different process, therefore they don't have access to installer properties. However, you can pass properties to the EXE by using its command line.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
marcelo
Posts: 103
Joined: Fri Sep 28, 2007 2:07 pm

Re: DLL written in C#

Hi,

You could make ur C# dll "Com Visible" then register it at install time (using Regasm) and use it as a com object during the install..

Cosmin, is there any issue on doing so?

Hope it helps,
Marcelo
eandersen
Posts: 12
Joined: Fri Nov 28, 2008 7:24 am

Re: DLL written in C#

Hi,

Thanks for the suggestion. I will try it some time in the near future. At the moment I have settled for a VB Script that can handle most of what I wanted to do in the a DLL.

Regards
Erling
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: DLL written in C#

Hi,
marcelo wrote:You could make ur C# dll "Com Visible" then register it at install time (using Regasm) and use it as a com object during the install..
Cosmin, is there any issue on doing so?
Unfortunately this custom action would need to run as deferred, so it cannot set or access installer properties. Only Immediate custom actions can set or access properties.

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

Return to “Common Problems”