qrrk / Catapult

A cross-platform launcher for Cataclysm: DDA and BN
MIT License
392 stars 63 forks source link

[Suggestion] Check for updates when opening the launcher. #30

Open c0bnut opened 2 years ago

c0bnut commented 2 years ago

Before fetching releases for Cataclysm DDA, the launcher could check the Catapult Github page for any new updates and automatically update after asking the user. There could also be a switch in Settings to enable/disable this feature.

RabblerouserGT commented 2 years ago

I always found it funny how the launcher could update CDDA/CBN but not self-update.

qrrk commented 2 years ago

Honestly, I don't even know how to approach self-updating. Catapult is one self-contained executable, how would it replace itself and then restart itself?

How would you approach this?

c0bnut commented 2 years ago

My first thought would be to spawn an updater child process to a temporary directory. From there you would terminate the parent process, download the zip, extract and overwrite in the existing directory. Run the catapult launcher again and terminate the child process.