I have a small web app (Mvc) that I need to periodically update (no ftp or other access).
I would like that from the "Super Ultra Mega administratior" page direcly in the app I can spin up the update process.
I know this is not the best security approach but I can live with it and I would like to avoid a permanent service that continuosly ping for a new version when this is not really necessary.
What I think right now is to have a windows service with the correct write permission credential that could be called from a secured web page to :
- stop iis service (not stricly required)
- download via a secured url the latest version of the app (zip file)
- backup the zipped old web app on the server in a dir (c:\backups\v1_01102010.zip)
- uncompress the downloaded zip file in the dir of the web app
- restart iis
- (eventually be able to revert the process)
Does something like this already exist?
I have seen a bunch of auto updater for .net mainly targeted to winform or desktop applications that seems too complicated for this simple process.
I do not need to write or modify the registry but just automate the zip extr开发者_JAVA技巧action without user interaction.
Well if you are going to write a web service then getting it to handle the zipping and unzipping of files shouldnt be too difficult. There are zip libraries which you can use within c# ( http://www.icsharpcode.net/OpenSource/SharpZipLib/ ). Stopping and Starting IIS can be done using the ServiceController class ( http://msdn.microsoft.com/en-us/library/system.serviceprocess.servicecontroller.aspx )
精彩评论