all groups > dotnet setup > august 2005 >
You're in the

dotnet setup

group:

Use function from external dll in Custom Action



Use function from external dll in Custom Action Anna
8/16/2005 10:19:04 PM
dotnet setup: Hi,

I've got a custom action dll (all in C#) that is used by my Project
Installer. Everything works fine. Now, I want the installer to perform one
other thing which can be easily performed by a function in one of my class
libraries, say MyUtil.dll. Since this additional thing should logically be
performed after the installation it is a good candidate for a custom action.
Question: how can I call the function in my dll from my installer class, i.e.
the child of System.Configuration.Install.Installer?
It is written all over the net that you can use custom actions to call
external dlls but I couldn't find anywhere how to do that.

Note: by the time the custom actions start executing MyUtil.dll will be in
my TARGETDIR.

Any help will be much appreciated.

Re: Use function from external dll in Custom Action Phil Wilson
8/17/2005 11:41:51 AM
It seems to me that you could just add an installer class to MyUtil.dll, add
it as another custom action to be called, and in its overridden Install
method you can call your function.
Your general question doesn't seem like an installation issue to me. You're
asking how code in one assembly can call code in another assembly, and there
are ways to do this using Assembly.Load and .NET reflection.
--
Phil Wilson
[Microsoft MVP-Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

[quoted text, click to view]

Re: Use function from external dll in Custom Action Anna
8/18/2005 5:46:01 PM
Thanks for your reply Phil.

I also found the answer here
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/summary_list_of_all_custom_action_types.asp

Anna.

[quoted text, click to view]
AddThis Social Bookmark Button