Add an auto-update feature
ericoporto opened this issue · comments
It should be possible to update AGS Toolbox from itself, at least on Windows. The mechanism to enable must be something like
- Remove any
agstoolbox-new.exe
if they exist - Download as
agstoolbox-new.exe
- Check it's correct (how?)
- Remove any
agstoolbox-old.bkp
if they exist - rename running
agstoolbox.exe
asagstoolbox-old.bkp
- rename
agstoolbox-new.exe
asagstoolbox.exe
If we also want to make it automatically restart - do we want that? Should we ask?
- close everything (shared memory, sockets, any open files, ...)
- restart the application
We probably need to also sync atbx and agstoolbox version here, so maybe a setting for a default location to fetch atbx and then we can upgrade both together.
We also need to make this update process only a thing on Windows and only a thing when using the prebuilt binaries.
We have a detection that we are in pyinstaller in the implementation that gets resources from the data directory, so we could move that detection to somewhere and then use it together with the os check.
reminder that if we use a subprocess for restarting it needs to pay attention to #31