tags:

views:

91

answers:

2

I've written a winforms application that is deployed as a setup/msi install. The main reasons for not using ClickOnce deployment are:

  1. Need persistent data storage in the directory of the app
  2. Need to be able to install for "all users"

At the moment, the application uses "one .exe to rule them all". Essentially, the "program files" directory after installation has the .exe, a .ico, and a .config file.

I'm trying to follow this advice/tutorial on MSDN so that I can have an update mechanism: http://msdn.microsoft.com/en-us/library/aa367564.aspx

I get the impression that having a single .exe isn't necessarily the best approach. I'm wondering if there's a "rule of thumb" when it comes to creating .dll libraries vs. putting my application classes in .cs files within the project?

Can an update be as easy as replacing some .dll files rather than the .exe?

A: 

In general, the "rule of thumb" I go by is to break Solutions up into projects based on functionality. This helpful for testing among other things.

In terms of updating, it seems from the "Application-Private Assemblies" section of this article on MSDN that yes, you could just drop new dll's for your app into its folder and be all done "updating" it just like that.

+2  A: 

In general, I agree with the answer given by The Great White North, which, to restate, is:

  1. There are good reasons to break up an application of any significant size/functionality into separate projects/components.
  2. .NET applications can be installed/updated simply by copying assemblies into the app's directory (supposing the assemblies are compatible with each other).

My additional strong suggestion to you would be that you do not mix-and-match between Windows Installer setup packages (i.e. what VS Deployment projects produce) and so-called "xcopy deployment" (i.e. copying assemblies where they need to go). If you "xcopy" update a file that was installed by a Windows Installer package, Windows Installer is likely to try to "fix it" for you.

It is said to be possible to create Windows Installer "patches", which only contain/update changed files, but I've never had a good reason to attempt to make that work. In any case, I'm fairly certain that is beyond the capabilities of VS Deployment projects.

Daniel Pratt