Red Gate forums :: View topic - Creating a Windows Service with Deployment Manager
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
Deployment Manager
Deployment Manager forum

Creating a Windows Service with Deployment Manager

Search in Deployment Manager forum
Post new topic   Reply to topic
Jump to:  
Author Message
swinghouse



Joined: 12 Sep 2011
Posts: 94

PostPosted: Tue Oct 16, 2012 12:37 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
chirayu



Joined: 17 Sep 2012
Posts: 51

PostPosted: Tue Oct 16, 2012 10:46 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
swinghouse



Joined: 12 Sep 2011
Posts: 94

PostPosted: Tue Oct 30, 2012 10:17 am    Post subject: Reply with quote

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:

Quote:
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
Back to top
View user's profile Send private message
swinghouse



Joined: 12 Sep 2011
Posts: 94

PostPosted: Tue Oct 30, 2012 10:39 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
swinghouse



Joined: 12 Sep 2011
Posts: 94

PostPosted: Tue Oct 30, 2012 11:47 am    Post subject: Reply with quote

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/Content/Deployment_Manager/help/1.0/dm_powershell_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:

Quote:
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
Back to top
View user's profile Send private message
chirayu



Joined: 17 Sep 2012
Posts: 51

PostPosted: Tue Oct 30, 2012 2:21 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group