Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NuGet as an application update mechanism

Tags:

c#

.net

nuget

We are developing a .NET 3.5 application (Windows Forms), which is comprised of 3 main parts.

As part of the deployment process, we'd like to be able to continuously update the components after being installed.

I have been thinking about setting up a NuGet server, and packaging component updates as NuGet packages.

Has anyone done such a thing before? Do you think NuGet fits this job?

Our requirements are:

  • Receiving of packaged DLL files (but there may be scenarios of additional files in a package
  • Detecting dependency on other components (or component versions)
  • Auto detecting new component versions

We are using TeamCity for continuous integration and for building our product, i know it integrates well with NuGet and can directly create/publish NuGet packages.

The question is how well can i integrate NuGet with our application? is there any client NuGet code to consume packages? I am wondering if this can work out.

like image 556
lysergic-acid Avatar asked Jan 26 '12 07:01

lysergic-acid


2 Answers

1 and 3) Deploying and receiving data from NuGet using NuGet.Core is possible. Check NuGet push... to Windows Azure and the source code for NuGet.exe's Update -Self command.

We're also featuring this scenario in our upcoming NuGet book - Pro NuGet.

2) Hosting your own feed is easy, check www.myget.org or use the NuGet gallery

like image 143
maartenba Avatar answered Oct 13 '22 12:10

maartenba


A bit late to the party but I have developed an open source framework that delivers exactly the requirements asked for.

It's called Sidewinder (http://sidewinder.codeplex.com) - the best way to use it is via it's NuGet packages (http://nuget.org/packages/sidewinder).

Essentially you add a small piece of code at the start of your app and the sidewinder component will check the feed (official or custom) for an update to the packages you need, pull them down and unpack them to a temp folder. It then backs up your app to a zip, launches sidewinder.exe (which will complete installation) and returns control to your app indicating it should terminate as an update is pending. Once your app closes, sidewinder.exe copies the updated content from the temp folder into your application folder and if you include a readme.txt in the nuget package will even shellexec that for you.

like image 30
jimbobdog Avatar answered Oct 13 '22 11:10

jimbobdog