Frage

I am considering building an application in Visual Studio 2010. This application will be distributed to dozens of users. As time passes, I will have to update the application. Is there a way that I can push updates to the users without having to rebuild the application, re-distribute the application to the users, have the users uninstall the original application, then install the new version?

I imagine the solution as the user being notified of a new version upon start-up, and the user clicking "OK" (or some equivalent) and then the program will download the new version.

Is there a way to do this in Visual Studio?

Thanks!

War es hilfreich?

Lösung

ClickOnce is an option, but not necessarily the most popular. You can also roll-your-own solution, which really isn't that hard:

  • Create a URL on a web server which returns the latest version (as a JSON object, XML string, plain text, whatever).
  • Have your program query this URL at startup.
  • If the latest version doesn't match the current version, prompt the user and download the latest version from the web server, saving it to a temporary directory.
  • Invoke the downloaded installer. (If it's an msi, there are command line options for "silent install" without a user interface; other installer have similar features.)

This approach has nothing to do with Visual Studio and could be used with any language / IDE.

Andere Tipps

I think you are looking for ClickOnce.

  1. Apps automatically download the latest version of themselves.
  2. ClickOnce takes the advantage of the Background Intelligent Transfer Service (BITS).
  3. Trustworthy deployment model for users to be able to download and execute applications from centrally managed servers without requiring administrator privileges on the client machine.
  4. Updates are transacted in a single transcation. (See this to understand “Single Transaction”)
  5. The application not only can work offline but it has a degree of control over it; APIs exist, so that the application can find out if it’s online or offline; it can also control its own update process;
  6. ClickOnce is integrated with Visual Studio .NET, including the ability to generate the appropriate extra files and tools that help to figure out which security privileges your application need in order to run.
  7. Application files can be downloaded on demand or in batches.
  8. ClickOnce comes with a Win32 “bootstraper” executable that can download necessary components, even the .NET Framework itself.
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top