Creating a Windows Service with Deployment Manager

swinghouseswinghouse Posts: 120 Bronze 2
edited October 30, 2012 9:21AM in Deployment Manager
Thanks David,

Yes, setting up .config transforms for other types of .NET applications in Deployment Manager proved to be smooth sailing indeed! Great stuff!

May I inquire about another thing? How should I go about registering Windows Services in a Deployment Manager release? Should I create a PowerShell script and put in in Deploy.ps1?

/Mattias

PS. Please let me know if I should start a new thread instead of prolonging this one.

Comments

  • Hi Mattias,

    David Conlin is on holiday, so I will be dealing with your query.

    You can create 4 kinds of Powershell scripts with Deployment Manager:
      -PreDeploy.ps1 -Deploy.ps1 -PostDeploy.ps1 -DeployFailed.ps1
    You may not have come across this help page about creating/updating Windows service from a Powershell script:
    http://www.red-gate.com/supportcenter/Content/Deployment_Manager/help/1.0/dm_powershell_scripts

    If you have any other problems, please let us know. I hope this helps!
    Chirayu Shishodiya
    Software Engineer - Deployment Manager
    Red Gate
  • swinghouseswinghouse Posts: 120 Bronze 2
    HI Chirayu,

    Thanks for the information - very useful!

    I have one issue at the moment. Deployment Manager doesn't seem to pick up the .ps1 files in the NuGet package. I get this message while deploying:
    No scripts with a .ps1 extension were found.

    My .ps1 files, currently PreDeploy.ps1 and PostDeploy.ps1, are located at the root of my NuGet package.

    What might I be doing wrong?

    /Mattias
  • swinghouseswinghouse Posts: 120 Bronze 2
    Success!

    After upgrading the version number of my NuGet package and pointing Deployment Manager at the new version, Deployment Manager picked up my changes and executed the PowerShell scripts!

    /Mattias
  • swinghouseswinghouse Posts: 120 Bronze 2
    I'd just like to point out that, in addition to setting up a PostDeploy.ps1 script using the first example at http://www.red-gate.com/supportcenter/C ... ll_scripts as template, I created a PreDeploy.ps1 script which stops the service if it's already installed.

    Otherwise Deployment Manager, very helpfully, reported the following error message:
    One or more files in the directory may be locked by another process. You could use a PreDeploy.ps1 script to stop any processes that may be locking the file.

    Very nice!

    /Mattias
  • Hi Mattias,

    I am glad you got Deployment Manager configured to use preDeploy and postDeploy scripts.

    Currently, whenever you make changes to your package, you need to increment the version number for the changes to be picked up. We are aware of this and would be looking to fix this in the near future.

    Please let us know if you have any further queries.

    Thanks!
    Chirayu Shishodiya
    Software Engineer - Deployment Manager
    Red Gate
Sign In or Register to comment.