-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add new setting for storing user data inside app folder for windows #7513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Add new setting for storing user data inside app folder for windows #7513
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This setting is available in all Windows builds, not just the zip and 7zip ones, which is highly problematic for the following reasons:
- It is not uncommon for people using installers to place the install in an admin protected folder such as Program Files, so if someone tried to turn on this setting which such an install it wouldn't work, thankfully it would just error with permission errors but not lose any data.
- The installer overwrites everything in the install folder when it runs, as it doesn't keep track of which files were installed by the previous installer run and makes the decent assumption that nobody would place anything else in that folder. Previously that wasn't a big deal as only a few users made the mistake of selecting the user data folder as the install location, so we could just tell them to not do that. However by adding this setting and allowing people to use it with the installer builds, we are adding support for people to lose their data when updating FreeTube and it will be our fault when the data is deleted and no it being in the experimental settings with a "use at your own risk" message is not enough, the setting has to hidden and inactive in installer builds.
I rarely do a blocking review on a pull request but this really should not be merged until that major issue is fixed, we should not be making losing your data when updating FreeTube thanks to a FreeTube setting a supported use case.
Ya also this doesn't work with portable version |
Updated for portable version and NSIS installer version, custom build updated |
Not sure patching the installer is the right approach. I think if we add this, it should only be available in the portable version/zip files, as it doesn't make much sense to show and allow it with the installer version, as the installer is inherently not portable and the entire point of this is to make FreeTube more portable. |
Updated installer version (by detecting the existence of uninstaller executable) to have new setting hidden and disabled (even with flag file created) |
Pull Request Type
Related issue
#746
Description
It's common for a portable app to store user data (settings and other data files)
https://portableapps.com/about/what_is_a_portable_app#definition
Screenshots
Testing
** Backup data before testing **
Suggest to test with non dev version to be accurate (I have never tested this with dev on windows)
Custom build: https://github.com/PikachuEXE/FreeTube/actions/runs/15481269896
A1. Windows - 7z/zip version
Replace HTTP Cache
(for later special setting sync test)userData
under the app folder (if you want to test auto folder creation you can do that later)e.g. if executable is at
C:\FreeTube\Freetube.exe
, createC:\FreeTube\userData
experiment-replace-http-cache
inside that folder (which should be absent whenReplace HTTP Cache
disabled)Replace HTTP Cache
still OFF (and empty fileexperiment-replace-http-cache
is gone)*.db
) now present in newuserData
folder in app folderReplace HTTP Cache
experiment-replace-http-cache
present in default user data folderReplace HTTP Cache
still ONuserData
folder (%APPDATA%\FreeTube
, see https://www.electronjs.org/docs/latest/api/app#appgetpathname)A2. Windows - portable version (single executable)
Similar to A1 but
userData
folder and new flag file are both in the same folder as the portable executable fileA3. Windows - NSIS installer version
B. Non windows (macOS/Linux)
Desktop
Additional context