Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How can I change the windows service name during setup?

How can I change the windows service name during setup?

Scheduled Pinned Locked Moved C#
sysadminquestionsalesworkspace
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    astanton1978
    wrote on last edited by
    #1

    I would like to have multiple instances of a windows service (one for each customer) running on the same server. So far my only solutions have been to change the name in the project installer and rebuild the setup, or use a non-friendly transform file (feels like a hack) in Wise. Ideally, the setup program should ask for the name of the service and install appropriately. (So I don't have to recompile or re-instruct the installer tech.) I cant find any way to do it with the built in setup and deployment projects. Does anybody have a similar experience or possible solution?

    P 1 Reply Last reply
    0
    • A astanton1978

      I would like to have multiple instances of a windows service (one for each customer) running on the same server. So far my only solutions have been to change the name in the project installer and rebuild the setup, or use a non-friendly transform file (feels like a hack) in Wise. Ideally, the setup program should ask for the name of the service and install appropriately. (So I don't have to recompile or re-instruct the installer tech.) I cant find any way to do it with the built in setup and deployment projects. Does anybody have a similar experience or possible solution?

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      The class could have a ServiceName property (or public readonly string) that the installer can use. When instantiating each service the underlying property could be set appropriately. I'm at the point now where I have a database table containing service configuration; the EXE reads it to find out what services it should run, loads the DLLs, instantiates the appropriate classes with their names and descriptions and such, and runs them. To create a new service I need only derive a class with the method it should execute, add a row to the configuration, and uninstall/reinstall the EXE. Each service is in its own DLL; the EXE needn't be recompiled.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups