Windows Installer problems

C

Claire

Hi
(Visual studio 2005)
My windows installer Setup project needs to install a desktop application
plus an optional Windows Service, into a single destination folder. Both
applications share the same assemblies and are part of the same solution.
Installation of the Windows Service is optional and is to be installed on a
single PC on a LAN, the desktop applications install to one or more pcs on
the same LAN.
Ive added the setup to my solution. Ive added a Checkboxes (A) dialog to the
user interface and will test CHECKBOXA1=1 to query if the service is to be
installed.
I've added the service to Install,Commit,Rollback and Uninstall nodes in the
Custom Actions window.
Ive added the condition CHECKBOXA1=1 to each of the actions.

When I install and uncheck CHECKBOXA1, the service isnt installed but the
files are copied to the target directory. Correct.
I uninstall this and the files and directory are deleted. Correct.

When I install and check CHECKBOXA1, the service IS installed (not running
as this has to be started manually afterwards). Correct.
I uninstall. The service remains in the services list, the files in the
directory are deleted. A file called service.InstallState is to be found in
the install directory.

What am I doing wrong please? If I try to install after this I'm told that a
service with this name already exists and it fails with a rollback.

thanks
Claire
 
C

Claire

Ok, so I realize the cause of the problem. It's having the condition
CHECKBOXA1 = 1 in the Uninstall Custom Action. When I remove that then the
service uninstalls ok (if I selected to install it)
But now I can see that I'll have problems if I didnt install it in the first
place.

So how can I test to see if the service was installed and only uninstall if
it's there?

thanks
 
C

Claire

But now I can see that I'll have problems if I didnt install it in the
first place.

So how can I test to see if the service was installed and only uninstall
if it's there?

For future reference

In the uninstall section, change "CHECKBOX1A=1" to "(?my.service<>2)" where
my.service is the name of the service as in "Primary output from my.service"
 
A

Anoop Sathyavan

Hi Claire,

We are facing the same problem for a similar situation.

Were you able to find a solution to this problem? If yes we would really
appreciate if you could share with us the same.

Awaiting your response.

Regards,
Anoop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top