1

Avoid windows service installation during installation if it is already exist I am creating windows service which I don't want to Un-installed so how can I avoid or override the existing windows service.

And also put "Not (Installed OR PREVIOUSVERSIONSINSTALLED)" in Custom action condition but still getting service already exists.

Is their any other method to do so by using installer.cs

Thnx in advance

1 Answer 1

1

This is a new install, so you don't need Installed in your condition - the product you're installing can't already be installed!

-Not PREVIOUSVERSIONSINSTALLED- should work, so maybe you need to verify that you're actually doing a RemovePreviousVersions upgrade, and you've incremented the Version in the Setup properties and accepted the request to change the codes. It won't work if you are upgrading a per user to a per machine (or vice versa). One will not upgrade the other and PREVIOUSVERSIONSINSTALLED won't be set.

2
  • 1
    thx for info bt I dnt want to uninstalled the service which is previously installed but when I installed new setup it should be skip the service installation
    – user5487967
    Nov 16, 2015 at 3:50
  • And that is in fact the question I answerd. PREVIOUSVERSIONSINSTALLED as a condition on thr install custom actions will prevent it being installed again by the custom action code if your RemovePreviousVersions upgrade is set up correctly.
    – PhilDW
    Nov 16, 2015 at 19:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.