[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.setup

Instal flow and custom actions

João Maia

5/7/2008 2:12:00 PM

Hi there,

I am currently developing a web setup project using .net framework
2.0. I am using custom actions, and overriding the Install and
Uninstall methods, yet there's one thing I don't get and maybe you can
give me a hand: what exactly is the flow of the setup project ? At
what time are the entry points for Install called ?

To be a bit more specific, let's say my setup project has some files
it needs to put on the deployment machine (I set these on the File
System tab of the setup project), has to create a web application on
the deployment machine, and makes use of the Install method of a
custom action that I created to to some additional stuff. What I need
to know is exactly when is the install method executed ?

Is it executed after the other actions, as in:

1 - copy files to deployment machine
2 - create web application on deployment machine
3 - call install method on my custom action

Or is it executed first ?

1 - call install method on my custom action
2 - copy files to deployment machine
3 - create web application on deployment machine

Or does it depend on where I have a call to base.Install(savedState)
on my custom action's Install method ? For example, if my method is:

public override void Install(System.Collections.IDictionary
savedState)
{
// do some stuff
base.Install(savedState);~
// do some more stuff
}

Does this mean that the flow is something like:

1 - Do some stuff on Installl method
2 - copy files to deployment machine
3 - create web application on deployment machine
4 - Do some more stuff on Install method

The reason I'm asking this is because I may need to do some things
before the actual installation is started, like for example, put a few
more files on the File System to be copied to the destination machine
than those that were originally put in the setup project, and I would
like to know exactly where I can add the code to do something like
this. I also noticed a few events on the Installer class (that my
custom action inherits from) like BeforeInstall and AfterInstall, but
haven't managed to find out how to use these events.

Can anyone give me a hand here ?

Thanks,

Joao Maia
1 Answer

Phil Wilson

5/7/2008 6:19:00 PM

0

Install custom actions are called after all the files have been installed,
almost at the end of the actual installation. There are events like
OnBeforeInstall but that really means at the start of your custom actions,
which are still called towards the end of the setup.

So the sequence is:

Show UI, Collect web data->Go into progress (MSI execute sequence)->Do
website creation stuff->Install the files->Call custom actions.

If you want to add a few more files, is there some reason you can't just put
them in the setup? Just browse to them from the setup project's IDE and add
them.
--
Phil Wilson
Definitive Guide to Windows Installer
http://www.apress.com/book/view/...


"João Maia" <jmaia@yahoo.com> wrote in message
news:938161f0-f318-4c9c-bc72-876918bb58cb@m73g2000hsh.googlegroups.com...
> Hi there,
>
> I am currently developing a web setup project using .net framework
> 2.0. I am using custom actions, and overriding the Install and
> Uninstall methods, yet there's one thing I don't get and maybe you can
> give me a hand: what exactly is the flow of the setup project ? At
> what time are the entry points for Install called ?
>
> To be a bit more specific, let's say my setup project has some files
> it needs to put on the deployment machine (I set these on the File
> System tab of the setup project), has to create a web application on
> the deployment machine, and makes use of the Install method of a
> custom action that I created to to some additional stuff. What I need
> to know is exactly when is the install method executed ?
>
> Is it executed after the other actions, as in:
>
> 1 - copy files to deployment machine
> 2 - create web application on deployment machine
> 3 - call install method on my custom action
>
> Or is it executed first ?
>
> 1 - call install method on my custom action
> 2 - copy files to deployment machine
> 3 - create web application on deployment machine
>
> Or does it depend on where I have a call to base.Install(savedState)
> on my custom action's Install method ? For example, if my method is:
>
> public override void Install(System.Collections.IDictionary
> savedState)
> {
> // do some stuff
> base.Install(savedState);~
> // do some more stuff
> }
>
> Does this mean that the flow is something like:
>
> 1 - Do some stuff on Installl method
> 2 - copy files to deployment machine
> 3 - create web application on deployment machine
> 4 - Do some more stuff on Install method
>
> The reason I'm asking this is because I may need to do some things
> before the actual installation is started, like for example, put a few
> more files on the File System to be copied to the destination machine
> than those that were originally put in the setup project, and I would
> like to know exactly where I can add the code to do something like
> this. I also noticed a few events on the Installer class (that my
> custom action inherits from) like BeforeInstall and AfterInstall, but
> haven't managed to find out how to use these events.
>
> Can anyone give me a hand here ?
>
> Thanks,
>
> Joao Maia