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 / April 2007

Tip: Looking for answers? Try searching our database.

Custom Installer Execution Order

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Keith DuPont - 13 Apr 2007 13:02 GMT
I am attempting to delete some files from my target installation folder prior
to new versions of the files being copied over during the installation.  In
an effort to implement this functionality I created a custom installer class
that I've added to my solution.  I would like specific actions in this custom
installer class to run before files are copied to the target installation
folders.

I have performed the following steps:
1)  Overridden the install method in the custom installer class
2)  Within the overridden install method I call another method to perform my
specific action (delete older versions of a file).  This call happens before
the call to MyBase.Install.
3)  I have added my custom install dll as a custom action to the "Install"
custom action folder.  

The problem is that my delete file method gets called after the new files
have been copied to the target installation directory.

I then attempted to add a BeforeInstall event to the custom installer class
that would call my delete files method in an effort to grab control before
the base install event is processed.  Unfortunately this event did not get
fired until after the new files were copied to the target installation folder.

I have two questions:
1) Is it possible to get control via a custom installer class (or another
methodology) prior to the new files being copied over?

2) Shouldn't the before install event that handles MyBase.BeforeInstall be
called prior to files being copied (or other install actions)?

Thank You in advance,

Regards,
Keith D.
Phil Wilson - 14 Apr 2007 18:47 GMT
In answer to your questions:

1) No, not with Visual Studio setups because that's where the install custom
actions are sequenced - nearly at the end of the installation.

2) No. "Before Install" doesn't mean "before the install". It means "before
the code in the Install custom action".

Why are you deleting older versions of files? If they are literally
versioned code files they'll be replaced anyway with higher versions. Are
they data files?

Signature

Phil Wilson
[Microsoft MVP-Windows Installer]

>I am attempting to delete some files from my target installation folder
>prior
[quoted text clipped - 38 lines]
> Regards,
> Keith D.
Keith DuPont - 16 Apr 2007 12:18 GMT
I was experiencing a problem with my primary output updating during
subsequent installs.  Thanks to one of your responses to another poster I
found the answer I needed (I was not updating the version numbers in my
assemblyinfo file).

The clarifications on the execution order and Before Install event were
extremely helpful.

Thank You for your assistance!
Regards,
Keith DuPont

> In answer to your questions:
>
[quoted text clipped - 50 lines]
> > Regards,
> > Keith D.

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.