473,480 Members | 1,701 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Installer class oddities

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?
Sep 15 '06 #1
3 5080
How do you use code to do all that?

chanmm

"Scewbedew" <Sc*******@discussions.microsoft.comwrote in message
news:DF**********************************@microsof t.com...
>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?

Sep 16 '06 #2
To do what? I only added som tracking code to the events of the
ProjectInstaller class...

"chanmm" wrote:
How do you use code to do all that?

chanmm

"Scewbedew" <Sc*******@discussions.microsoft.comwrote in message
news:DF**********************************@microsof t.com...
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?


Sep 16 '06 #3
"Scewbedew" <Sc*******@discussions.microsoft.comwrote in message
news:DF**********************************@microsof t.com...
>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?
Yep, it's broken. One workaround is to use two Installer classes in two
different assemblies. Put the uninstall stuff in one assembly and the
install stuff in the other assembly.

The best fix is to eliminate the Installer based classes and create an MSI
with something like WiX (see wix.sourceforge.net)
Sep 27 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
14441
by: krisk | last post by:
Could not find ansewr: in ProjectInstaller, RunInstallerAttribute: ..... this.serviceInstaller1.ServiceName = MyServiceName; in the code: public class MyService :...
0
2067
by: Arun Bhalla | last post by:
I'm having some inconsistency problems with my deployment project ("Setup") and its custom actions ("Installer"). I'm using Visual Studio .NET 2003 (.NET 1.1, no service pack) on Windows XPSP1. ...
2
5315
by: MENTAT | last post by:
Hi, I am trying to create an installer for my web application. So I added a web setup project to my solution (I am using VS.NET 2003). Been playing around with it since then and it basically...
0
1376
by: Richard | last post by:
All, There is a KB article pertaining to windows installer running every time an application starts - so I know it's an issue - but the KB article pertains to MS Office only. I am seeing the...
3
1702
by: Mark Assousa | last post by:
Hi, I'm having trouble finding the right news group for this posting so here goes... I am attempting to execute some special actions within an installation project for a standard .Net Windows...
8
6433
by: jacky kwok | last post by:
Dear All: In VS2005 WebSetup installer InstallAddress dialog, there is field to let user to select which website to install the webapp (if there are more than one WebSite in the IIS). I want...
4
1977
by: Rob R. Ainscough | last post by:
The task is brain dead simple - Uninstall prior Windows Service and Install newer version of Windows Service Background: 1. My Windows Service written in .NET 1.1 and deployed via MSI (Windows...
2
12746
by: ashishjainism | last post by:
I am unable to install my windows service and the installutil is throwing the following error: Running a transacted installation. Beginning the Install phase of the installation. See the...
0
2293
by: JDeats | last post by:
I have a new Installer class (derived from System.Configuration.Install.Installer) and I have override methods for Install, Uninstall, Commit. The MSI builder tool I'm using is Advanced Installer,...
0
7041
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6908
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6739
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6929
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4481
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2995
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2984
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
181
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.