G
Guest
I have a C# service where I have included a ProjectInstaller class to handle
the installation. I experiance a number of oddities, and I don't know if I'm
doing anything wrong, or if the Installer class is behaving odd.
1. I added code in the Committed event handler to start the service. It
never ran. I added code to *all* events in order to track what events that
was fired. Only the BeforeUninstall, AfterUninstall, BeforeInstall and
AfterInstall was activated. Why didn't I get any of the other events?
2. I tried to override the Install, Commit and Rollback methods just in case
I really needed to do that (the Install class documentation isn't clear on if
that is a requirement or not). Only the Install method is called, none of the
other.
OK, I went on and placed my service start code in the AfterInstall event
since that is always fired, then I noticed another problem:
My project is configured to automatically uninstall any previous version
before installing the new one. I presumed that the Uninstall methods from the
*old* version would be used when uninstalling the old version, and that the
Install methods from the *new* version would be used when installing the new
version. This is not the case.
Whenever I upgrade my project, the *old* ProjectInstaller class is used for
both the uninstall and the install!? The effect is that I will *always*
install the new version with the ProjectInstaller class from the old version.
In my oppinion, this is illogical, stupid and dangerous.
Am I doing something wrong here, or is this "expected" behaviour from the
ProjectInstaller class?
the installation. I experiance a number of oddities, and I don't know if I'm
doing anything wrong, or if the Installer class is behaving odd.
1. I added code in the Committed event handler to start the service. It
never ran. I added code to *all* events in order to track what events that
was fired. Only the BeforeUninstall, AfterUninstall, BeforeInstall and
AfterInstall was activated. Why didn't I get any of the other events?
2. I tried to override the Install, Commit and Rollback methods just in case
I really needed to do that (the Install class documentation isn't clear on if
that is a requirement or not). Only the Install method is called, none of the
other.
OK, I went on and placed my service start code in the AfterInstall event
since that is always fired, then I noticed another problem:
My project is configured to automatically uninstall any previous version
before installing the new one. I presumed that the Uninstall methods from the
*old* version would be used when uninstalling the old version, and that the
Install methods from the *new* version would be used when installing the new
version. This is not the case.
Whenever I upgrade my project, the *old* ProjectInstaller class is used for
both the uninstall and the install!? The effect is that I will *always*
install the new version with the ProjectInstaller class from the old version.
In my oppinion, this is illogical, stupid and dangerous.
Am I doing something wrong here, or is this "expected" behaviour from the
ProjectInstaller class?