Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Setup / August 2005

Tip: Looking for answers? Try searching our database.

Use function from external dll in Custom Action

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Anna - 17 Aug 2005 06:19 GMT
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.

Anna
Phil Wilson - 17 Aug 2005 19:38 GMT
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.
Signature

Phil Wilson
[Microsoft MVP-Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

> Hi,
>
[quoted text clipped - 18 lines]
>
> Anna
Anna - 19 Aug 2005 01:46 GMT
Thanks for your reply Phil.  

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


Anna.

> 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
[quoted text clipped - 24 lines]
> >
> > Anna

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.