Windows service / command line tools question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • clsmith66

    Windows service / command line tools question

    I've been asked to find out if a project is possible, but I'm not having much
    luck finding the information I need, I hope some one can help. I need to see
    if I can build a windows service on the fly customized to a specific client.
    Is it possible to run the VS command line tool through another application
    (VB.NET)? I'm thinking I can run the tools as a process and pass the
    necessary parameters to the process, but I'm not sure how to go about this.
    If that is possible, how hard would it be to build the setup project for the
    service using the command line tools? I've used the command line tools a
    little bit to build a regular application, but I guess what I need to know is
    there any special commands/parameters needed to build a setup package using
    the command line?

    Any help would be greatly appreciated.

    Chris
  • Adam May

    #2
    RE: Windows service / command line tools question

    Hi clsmith66,

    What sort of customisation are you looking to do to each service?

    What you're looking for may be do-able using Custom Commands sent to the
    service.

    Adam

    --
    Adam May
    Sydney, Australia
    MCSD.Net


    "clsmith66" wrote:
    [color=blue]
    > I've been asked to find out if a project is possible, but I'm not having much
    > luck finding the information I need, I hope some one can help. I need to see
    > if I can build a windows service on the fly customized to a specific client.
    > Is it possible to run the VS command line tool through another application
    > (VB.NET)? I'm thinking I can run the tools as a process and pass the
    > necessary parameters to the process, but I'm not sure how to go about this.
    > If that is possible, how hard would it be to build the setup project for the
    > service using the command line tools? I've used the command line tools a
    > little bit to build a regular application, but I guess what I need to know is
    > there any special commands/parameters needed to build a setup package using
    > the command line?
    >
    > Any help would be greatly appreciated.
    >
    > Chris[/color]

    Comment

    • clsmith66

      #3
      RE: Windows service / command line tools question

      I need to be able to set variables for items like smtp and mac address for
      the individual servers. I know I could build theses into a .config file, but
      I've been asked to put them in the complied version. I was thinking of just
      building a template service application and then just before build, edit
      these values in a specified class and then build the service and installer.

      Chris

      "Adam May" wrote:
      [color=blue]
      > Hi clsmith66,
      >
      > What sort of customisation are you looking to do to each service?
      >
      > What you're looking for may be do-able using Custom Commands sent to the
      > service.
      >
      > Adam
      >
      > --
      > Adam May
      > Sydney, Australia
      > MCSD.Net
      >
      >
      > "clsmith66" wrote:
      >[color=green]
      > > I've been asked to find out if a project is possible, but I'm not having much
      > > luck finding the information I need, I hope some one can help. I need to see
      > > if I can build a windows service on the fly customized to a specific client.
      > > Is it possible to run the VS command line tool through another application
      > > (VB.NET)? I'm thinking I can run the tools as a process and pass the
      > > necessary parameters to the process, but I'm not sure how to go about this.
      > > If that is possible, how hard would it be to build the setup project for the
      > > service using the command line tools? I've used the command line tools a
      > > little bit to build a regular application, but I guess what I need to know is
      > > there any special commands/parameters needed to build a setup package using
      > > the command line?
      > >
      > > Any help would be greatly appreciated.
      > >
      > > Chris[/color][/color]

      Comment

      • Adam May

        #4
        RE: Windows service / command line tools question

        Hi Chris,

        Is there a particular reason that you want to compile the variables in? Is
        it for security that they can't be changed?

        After much thought about your problem, I think this is the best solution:

        1. Create a command line vb app that takes your params as command line
        options and uses a TextFileReader/Writer to change your .vb file according to
        the params.

        2. Create a batch file that takes params and calls the tool mentioned above,
        passing the params through. It then goes on to call vbc to compile your
        service.

        As I said, it's a bit fiddly, but it'll do what you need it to do.

        HTH,

        Adam

        --
        Adam May
        Sydney, Australia
        MCSD.Net


        "clsmith66" wrote:
        [color=blue]
        > I need to be able to set variables for items like smtp and mac address for
        > the individual servers. I know I could build theses into a .config file, but
        > I've been asked to put them in the complied version. I was thinking of just
        > building a template service application and then just before build, edit
        > these values in a specified class and then build the service and installer.
        >
        > Chris
        >
        > "Adam May" wrote:
        >[color=green]
        > > Hi clsmith66,
        > >
        > > What sort of customisation are you looking to do to each service?
        > >
        > > What you're looking for may be do-able using Custom Commands sent to the
        > > service.
        > >
        > > Adam
        > >
        > > --
        > > Adam May
        > > Sydney, Australia
        > > MCSD.Net
        > >
        > >
        > > "clsmith66" wrote:
        > >[color=darkred]
        > > > I've been asked to find out if a project is possible, but I'm not having much
        > > > luck finding the information I need, I hope some one can help. I need to see
        > > > if I can build a windows service on the fly customized to a specific client.
        > > > Is it possible to run the VS command line tool through another application
        > > > (VB.NET)? I'm thinking I can run the tools as a process and pass the
        > > > necessary parameters to the process, but I'm not sure how to go about this.
        > > > If that is possible, how hard would it be to build the setup project for the
        > > > service using the command line tools? I've used the command line tools a
        > > > little bit to build a regular application, but I guess what I need to know is
        > > > there any special commands/parameters needed to build a setup package using
        > > > the command line?
        > > >
        > > > Any help would be greatly appreciated.
        > > >
        > > > Chris[/color][/color][/color]

        Comment

        • clsmith66

          #5
          RE: Windows service / command line tools question

          I will look into creating the batch file and passing the parameters in that
          way. To answer your questions, I was asked specifically to hardcode these
          variable into the application, you are right, so the technicians who will be
          using this service can not change them. Thanks for you help, I think I'm on
          the right path now.

          Chris

          "Adam May" wrote:
          [color=blue]
          > Hi Chris,
          >
          > Is there a particular reason that you want to compile the variables in? Is
          > it for security that they can't be changed?
          >
          > After much thought about your problem, I think this is the best solution:
          >
          > 1. Create a command line vb app that takes your params as command line
          > options and uses a TextFileReader/Writer to change your .vb file according to
          > the params.
          >
          > 2. Create a batch file that takes params and calls the tool mentioned above,
          > passing the params through. It then goes on to call vbc to compile your
          > service.
          >
          > As I said, it's a bit fiddly, but it'll do what you need it to do.
          >
          > HTH,
          >
          > Adam
          >
          > --
          > Adam May
          > Sydney, Australia
          > MCSD.Net
          >
          >
          > "clsmith66" wrote:
          >[color=green]
          > > I need to be able to set variables for items like smtp and mac address for
          > > the individual servers. I know I could build theses into a .config file, but
          > > I've been asked to put them in the complied version. I was thinking of just
          > > building a template service application and then just before build, edit
          > > these values in a specified class and then build the service and installer.
          > >
          > > Chris
          > >
          > > "Adam May" wrote:
          > >[color=darkred]
          > > > Hi clsmith66,
          > > >
          > > > What sort of customisation are you looking to do to each service?
          > > >
          > > > What you're looking for may be do-able using Custom Commands sent to the
          > > > service.
          > > >
          > > > Adam
          > > >
          > > > --
          > > > Adam May
          > > > Sydney, Australia
          > > > MCSD.Net
          > > >
          > > >
          > > > "clsmith66" wrote:
          > > >
          > > > > I've been asked to find out if a project is possible, but I'm not having much
          > > > > luck finding the information I need, I hope some one can help. I need to see
          > > > > if I can build a windows service on the fly customized to a specific client.
          > > > > Is it possible to run the VS command line tool through another application
          > > > > (VB.NET)? I'm thinking I can run the tools as a process and pass the
          > > > > necessary parameters to the process, but I'm not sure how to go about this.
          > > > > If that is possible, how hard would it be to build the setup project for the
          > > > > service using the command line tools? I've used the command line tools a
          > > > > little bit to build a regular application, but I guess what I need to know is
          > > > > there any special commands/parameters needed to build a setup package using
          > > > > the command line?
          > > > >
          > > > > Any help would be greatly appreciated.
          > > > >
          > > > > Chris[/color][/color][/color]

          Comment

          • Adam May

            #6
            RE: Windows service / command line tools question

            Chris,

            No problems. I'd be interested to hear how you get on.

            Cheers,

            Adam
            --
            Adam May
            Sydney, Australia
            MCSD.Net


            "clsmith66" wrote:
            [color=blue]
            > I will look into creating the batch file and passing the parameters in that
            > way. To answer your questions, I was asked specifically to hardcode these
            > variable into the application, you are right, so the technicians who will be
            > using this service can not change them. Thanks for you help, I think I'm on
            > the right path now.
            >
            > Chris
            >
            > "Adam May" wrote:
            >[color=green]
            > > Hi Chris,
            > >
            > > Is there a particular reason that you want to compile the variables in? Is
            > > it for security that they can't be changed?
            > >
            > > After much thought about your problem, I think this is the best solution:
            > >
            > > 1. Create a command line vb app that takes your params as command line
            > > options and uses a TextFileReader/Writer to change your .vb file according to
            > > the params.
            > >
            > > 2. Create a batch file that takes params and calls the tool mentioned above,
            > > passing the params through. It then goes on to call vbc to compile your
            > > service.
            > >
            > > As I said, it's a bit fiddly, but it'll do what you need it to do.
            > >
            > > HTH,
            > >
            > > Adam
            > >
            > > --
            > > Adam May
            > > Sydney, Australia
            > > MCSD.Net
            > >
            > >
            > > "clsmith66" wrote:
            > >[color=darkred]
            > > > I need to be able to set variables for items like smtp and mac address for
            > > > the individual servers. I know I could build theses into a .config file, but
            > > > I've been asked to put them in the complied version. I was thinking of just
            > > > building a template service application and then just before build, edit
            > > > these values in a specified class and then build the service and installer.
            > > >
            > > > Chris
            > > >
            > > > "Adam May" wrote:
            > > >
            > > > > Hi clsmith66,
            > > > >
            > > > > What sort of customisation are you looking to do to each service?
            > > > >
            > > > > What you're looking for may be do-able using Custom Commands sent to the
            > > > > service.
            > > > >
            > > > > Adam
            > > > >
            > > > > --
            > > > > Adam May
            > > > > Sydney, Australia
            > > > > MCSD.Net
            > > > >
            > > > >
            > > > > "clsmith66" wrote:
            > > > >
            > > > > > I've been asked to find out if a project is possible, but I'm not having much
            > > > > > luck finding the information I need, I hope some one can help. I need to see
            > > > > > if I can build a windows service on the fly customized to a specific client.
            > > > > > Is it possible to run the VS command line tool through another application
            > > > > > (VB.NET)? I'm thinking I can run the tools as a process and pass the
            > > > > > necessary parameters to the process, but I'm not sure how to go about this.
            > > > > > If that is possible, how hard would it be to build the setup project for the
            > > > > > service using the command line tools? I've used the command line tools a
            > > > > > little bit to build a regular application, but I guess what I need to know is
            > > > > > there any special commands/parameters needed to build a setup package using
            > > > > > the command line?
            > > > > >
            > > > > > Any help would be greatly appreciated.
            > > > > >
            > > > > > Chris[/color][/color][/color]

            Comment

            Working...