views:

60

answers:

1

I have an application that runs as a service.

I have altered the services installer object so that I can pass setup data to it from a user input screen on the installation/setup project.

This all appears to work well apart from the following points:

  1. Installation is error free UNLESS there is a copy of my service already installed on the client machine, in which case it throws up a window saying that it is already present and bombs out, even though I have got the setup property RemovePreviousVersion set True.
  2. When a sussessful install has neared completion, I get a message stating that the service cannot be started automatically and to use NET START or service administrator.

So how do I get it to automatically remove the previous version of the service if it is installed?

Also, how do I get it to start the service automatically or ask the user to restart the machine?

+1  A: 

are you changing the Version of the installer? In the properties window, you need to increment the Version property. It will prompt you that you need to create a new Product Code. Just click yes. See if that works for you.

Eclipsed4utoo
The version of the installer? I'll give that a try.
ChrisBD
Okay question one has been answered. Oddly enough (or perhaps not) the installer behaves differently when run from VS to when it's actioned externally.
ChrisBD
What is it doing differently?
Eclipsed4utoo
When you launch it strait from Visual Studio, it's trying to launch things inside its vshost.exe process, which is likely to cause some confusion with services. So, in short, I'd say you don't want to do that. :)
ewall
I am accepting this.Point 2 was caused by an empty custom action being called after the install process. Removal of this, removed the error!
ChrisBD