Automatic update in a corporate environment (C #)

I have a three-tier application that installs in corporate environments. Each time the server version is updated, all clients must also be updated. I currently provide an MSI package that is automatically deployed through Active Directory, however my clients (mostly with 20-300 users each) seem to hate the MSI solution because it

  • Difficult to run it (little knowledge of Active Directory);
  • The update process cannot be initiated by the server when a new version is detected;
  • Clients cannot install several versions of the client at the same time (for example, 2.3 and 2.4) in order to talk on different servers;
  • The update process itself does not always work properly (sometimes very strange behavior, healing itself in a few hours).

Now I have done some experiments with ClickOnce, but for this it has become inflexible for me and it is too difficult to integrate into my automatic assembly process. In addition, it creates cryptic error messages that will undoubtedly confuse my clients.

I would not have problems recording the update logic itself, but the problem is that users running self-updating applications have too limited privileges to perform the update. I found that they can write local applications to their directory, but I don't think this would be a typical place to install application files.

Do you know an update method that "just works"?

+4
source share
4 answers

You can do a bit of what ClickOnce does, just adjust it to your needs.

  • Create a lightweight executable that checks the network / network location for updates.
  • If there are updates, it copies them locally and replaces the "real" application files.
  • It launches a "real" application.

The location of application files must be determined by permissions and the operating system. If users only have permission to write to a limited set of folders, then you have no choice, but use one of these folders. Another option is the initial installation package, which installs a lightweight executable and provides r / w permission for a specific folder, for example, "C: \ Program Files \ MyApp". This approach usually requires a buy-in from IT.

Hope this helps.

+4
source

It is very difficult to provide you with accurate answers, because critical client-side installation information is not explicit. Do you install client-side files in Program Files? Then you may run into problems when users are limited.

You do not think that local application data is the folder for deploying the application, but Google does. The Chrome browser is installed this way on Windows, and its automatic update process is even invisible (which may seem awful). So, why not deploy your application in this folder for limited users? Learn more about the Chrome installer here.

http://robmensching.com/blog/archive/2008/09/04/Dissecting-the-Google-Chrome-setup.aspx

+2
source

Here is an open source solution that I wrote to meet the specific needs that we had for WinForms and WPF applications. The general idea is to have maximum flexibility with the lowest possible overhead. It should provide you with all the flexibility you need for everything you describe.

So, the integration is very simple, and the library does almost everything for you, including synchronization operations. It is also very flexible and allows you to determine what tasks to perform and on what conditions - you create rules (or use some of them already). Last, but not least, support for any source of updates (web, BitTorrent, etc.) And any feed format - everything that is not implemented, you can just write for yourself.

Cold updates (requiring a reboot of the application) are also supported and performed automatically if a hot swap is not set for the task.

This will combine up to one DLL that is less than 70 KB in size.

More details at http://www.code972.com/blog/2010/08/nappupdate-application-auto-update-framework-for-dotnet/

The code is located at http://github.com/synhershko/NAppUpdate (licensed under the Apache 2.0 license)

I plan to expand it when I get some more time, but to be honest, you should be able to quickly improve it, no matter what it currently doesn't support.

+2
source

If you do not want to give your users too many rights, you can write a Windows service that will run on each computer under an account with the appropriate rights and which can update your application when a new version is available.

0
source

Source: https://habr.com/ru/post/1276707/


All Articles