Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto-updating in Corporate Environments (C#)

I have a three-tier application which is installed in corporate environments. With every server version update, all clients have to be updated, too. Currently, I provide an MSI package which is automatically deployed via Active Directory, however my customers (mostly with 20-300 users each) seem to hate the MSI solution because it is

  • Complicated to get it running (little Active Directory knowledge);
  • The update process can't be triggered by the server, when a new version is detected;
  • Customers can't install multiple versions of the client (e.g. 2.3 and 2.4) at the same time to speak to different servers;
  • The update process itself doesn't always work as expected (sometimes very strange behaviour healing itself after a few hours)

I've now made a few experiments with ClickOnce, but that way to unflexible for me and too hard to integrate in my automated build process. Also, it produces cryptic error messages which would surely confuse my customers.

I would have no problems to write the update logic myself, but there the problem is that the users running to self-updating applications have too restricted rights to perform an update. I've found that they are able to write to their Local Application Data directory, but I don't think this would be the typical place to install application files into.

Do you know a way to an update that "just works"?

like image 943
Stefan Schultze Avatar asked Mar 01 '23 08:03

Stefan Schultze


1 Answers

You can somewhat replicate what ClickOnce does, just adjust it for your needs.

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

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

I hope this helps.

like image 131
Rami Avatar answered Mar 11 '23 14:03

Rami