TheSwamp

Code Red => .NET => Topic started by: ChrisCarlson on March 24, 2017, 07:58:50 AM

Title: Updating Program Version
Post by: ChrisCarlson 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.
Title: Re: Updating Program Version
Post by: It's Alive! 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! 


 
Title: Re: Updating Program Version
Post by: dgorsman 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.
Title: Re: Updating Program Version
Post by: Atook 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  (http://adndevblog.typepad.com/autocad/2012/04/load-additional-dlls.html)to load the second DLL?
Title: Re: Updating Program Version
Post by: dgorsman 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.
Title: Re: Updating Program Version
Post by: Jeff H 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  (http://adndevblog.typepad.com/autocad/2012/04/load-additional-dlls.html)to load the second DLL?
This project here  (https://www.theswamp.org/index.php?topic=52883.new#new) uses System.Reflection.Assembly.LoadFrom()