Author Topic: Updating Program Version  (Read 244 times)

0 Members and 1 Guest are viewing this topic.

Master_Shake

  • Swamp Rat
  • Posts: 1148
Updating Program Version
« on: March 24, 2017, 07:58:50 am »
How do you guys handle program updates? I'm wrapping up a program which will be sent out to about 100 different users but it needs to be updated occasionally. I'm learning towards the approach that Spotify uses; ping a remote server, compare versions, download the update, and automatically apply the update in the background.

Are there better ways or any cons to the "Spotify" approach that I'm not accounting for?

//edit
The program is a self-contained executable if that changes anything.
« Last Edit: March 24, 2017, 08:05:32 am by Master_Shake »

nullptr

  • BricsCAD
  • Needs a day job
  • Posts: 6715
  • AKA Daniel
Re: Updating Program Version
« Reply #1 on: March 24, 2017, 09:54:33 am »
For CAD?
Maybe a menu with a check for updates option, otherwise your program might need special permissions.
I turn off auto-updates whereever I can.

cheers! 


 

dgorsman

  • Water Moccasin
  • Posts: 2171
Re: Updating Program Version
« Reply #2 on: March 24, 2017, 11:00:40 am »
I have something that's in a couple of modules.

The "core" is a stand-alone command-line EXE which is passed the filename of an XML file, which contains filenames to be updated and how ("just do it", "version check only", source and destination folder, etc.).  Since I also use it to automate demand loading of DLLs it also handles merging REG files into the registry.  The EXE has a process monitor to wait until all AutoCAD sessions are closed to avoid "last one out wins" problems.

From the various branches of my program it gets called a couple of different ways.  If particular routines throw an error I know there's a specific DLL out of date; the code calls the appropriate XML file for updating that DLL and alerts the user to close AutoCAD.  There's also an "Update all" button in the Ribbon when it's time to hit the thing with a sledgehammer.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

Atook

  • Swamp Rat
  • Posts: 794
Re: Updating Program Version
« Reply #3 on: March 24, 2017, 03:42:02 pm »
I'm looking in to the same thing. Seems like the plan is to update the main DLL before loading it via a primary 'loader DLL', I don't think a DLL can update it's self.


DGorsman, are you using the System.Reflection.Assembly.LoadFrom() method mentioned here to load the second DLL?

dgorsman

  • Water Moccasin
  • Posts: 2171
Re: Updating Program Version
« Reply #4 on: March 27, 2017, 10:22:27 am »
Nope.  My updater is entirely external (except for the set-up - most of that's done with LISP).  Part of that is the "DLL can't update itself" but also the problem of users running multiple sessions of AutoCAD.  If a DLL is loaded in an active session it can't be updated, so I need to ensure everything is closed prior to doing any updates.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

Jeff H

  • Needs a day job
  • Posts: 5740
Re: Updating Program Version
« Reply #5 on: March 31, 2017, 01:42:40 am »
I'm looking in to the same thing. Seems like the plan is to update the main DLL before loading it via a primary 'loader DLL', I don't think a DLL can update it's self.


DGorsman, are you using the System.Reflection.Assembly.LoadFrom() method mentioned here to load the second DLL?
This project here uses System.Reflection.Assembly.LoadFrom()