Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Custom Action / Windows Service

3 views
Skip to first unread message

Brian Kavanaugh

unread,
Jan 12, 2006, 11:37:55 AM1/12/06
to
My apologies if this isn't the right news group. We have a .NET 1.1 WinForm
application that, as part of the install, we would like to optionally
install a Windows service. We are using a Deployment Project in VS.NET 2003
to create the msi. The install and uninstall works generally works fine. We
would like, however, to make the service install optional. I added a
"Checkboxes (A)" form to the Start section of the install package. Checking
that variable in the install works fine. However, no matter what the state
was during the install, it always tries to uninstall the service. It, of
course, fails if the service wasn't installed. How do I get this to work
properly?


Brian Kavanaugh

unread,
Jan 13, 2006, 8:58:15 AM1/13/06
to
"Brian Kavanaugh" <a@b.c> wrote in message
news:%23zCWNa5...@TK2MSFTNGP12.phx.gbl...

Here are the various relevant sections of my installer setup:

User Interface - Checkboxes (A)
Checkbox1Property: INSTALLSERVICE
Checkbox1Value: Checked
Checkbox1Visible

Custom Actions
Install -
Arguments: /install
Condition: INSTALLSERVICE
CustomActionData: (empty)
InstallerClass: True
Uninstall -
Arguments: /uninstall
Condition: INSTALLSERVICE
InstallerClass: True


Phil Wilson

unread,
Jan 14, 2006, 3:03:13 PM1/14/06
to
The setup doesn't remember that the checkbox was checked or not. You can fix
this by adding a registry item with the value [CHECKBOXA1] if that's the
property name, saving the value in the registry. In the Search Target
Machine view add a search for that registry item and store it in a property
called (say) GOTSERVICE. Use GOTSERVICE=1 as a condition on the uninstall
custom action. The registry search happens on uninstalls too, so the
property will be set from the registry if it's there.

The reason you have to do this is that if you weren't using a VS setup you'd
put the Service in a Feature and the user would select whether to install it
using one of those standard feature-choice dialogs, and Windows would
remember that the feature was installed and not try to uninstall it. VS
doesn't do anything with features (you get one default feature) and so you
have to do the remembering.
--
Phil Wilson
[Microsoft MVP-Windows Installer]
Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

"Brian Kavanaugh" <a@b.c> wrote in message
news:%23zCWNa5...@TK2MSFTNGP12.phx.gbl...

Brian Kavanaugh

unread,
Jan 17, 2006, 10:53:13 AM1/17/06
to
That worked great. Thanks for the help!

--Brian

"Phil Wilson" <pdjw...@nospam.cox.net> wrote in message
news:%23H9$kSUGGH...@TK2MSFTNGP15.phx.gbl...

0 new messages