SpikeHD / Dorion

Tiny alternative Discord client with a smaller footprint, snappier startup, themes, plugins and more!
https://spikehd.github.io/projects/dorion/
GNU General Public License v3.0
627 stars 20 forks source link

[Feature Request] don't include empty config.json in portable update package. #232

Closed cozykitten closed 6 months ago

cozykitten commented 6 months ago

Is your feature request related to a problem? Please describe. When updating portable Dorion, it automatically downloads the new version archive which is nice, however this archive contains an empty config.json file, which would overwrite the current settings if extracted into the Dorion installation folder. All the other files (Dorion.exe, Updater.exe, etc) need to be overwritten but I have to remember to not overwrite config.json (or delete it from the archive before extracting). I'm trying to say it's easy to forget that step some day.

Describe the solution you'd like Instead of including empty config.json which would then be written with default values on start I imagine, just don't include it, and when default values are written the file is simply created.

SpikeHD commented 6 months ago

I can understand this frustration. I will see about maybe including an extra empty file called ".portable" or whatever to tell Dorion its portable instead, or something

cozykitten commented 6 months ago

Idk what you mean with "telling Dorion it's portable" or why that would be necessary. Afaik, the "update" button just downloads the archive containing the new version yes? And I think it's perfectly fine like that. It's just that the archive contains an empty "config.json" which would potentially overwrite the existing config.json when extracting into Dorion's working directory. Simply removing that from the archive would solve the issue.

SpikeHD commented 6 months ago

When Dorion is portable, all folders are contained within whatever folder the exe is. When Dorion is installed through an installer, Dorion will store it's files (config, plugins, themes, cache, etc.) to standard folder elsewhere on the system (think %appdata%/dorion for example). Because of this, Dorion needs to know somehow whether it's portable or not (because portable users don't want files strewn everywhere on their system) without something like a feature flag, so the method has been:

is_portable = config_is_next_to_dorion_exe

Ofc, that means portable installs need to have a config.json next to them, so portable builds come with one. I just need to change the portable check to be

is_portable = has_portable_signifier_file

as well as include that file in portable installs, and that should be it!

cozykitten commented 6 months ago

ahh, you used the config as signifier file, so u had to have an empty one in the package.. gotcha I appreciate the "fix", thank you.

SpikeHD commented 6 months ago

This is fixed in a987b35 and will be available in the next release 👍