Add new setting for storing user data inside app folder for windows
Pull Request Type
- [ ] Bugfix
- [x] Feature Implementation
- [ ] Documentation
- [ ] Other
Related issue
https://github.com/FreeTubeApp/FreeTube/issues/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
A portable app is a computer program that doesn't need to be installed into Windows like traditional apps so you can carry it with you on a portable device or synced cloud folder and use on any Windows computer. When your USB flash drive, portable hard drive, or other portable device is plugged in or your cloud drive is synced, you have access to your software and personal data just as you would on your own PC. And when you unplug the device, none of your personal data is left behind.
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
- Open app
- Ensure all data like subscribed channels/profiles, sub cache, playlist, settings, etc. are still present
- Ensure new setting DOES appear and disabled
- Turn OFF
Replace HTTP Cache(for later special setting sync test) - Close app
- Create folder
userDataunder the app folder (if you want to test auto folder creation you can do that later) e.g. if executable is atC:\FreeTube\Freetube.exe, createC:\FreeTube\userData - Create empty file
experiment-replace-http-cacheinside that folder (which should be absent whenReplace HTTP Cachedisabled) - Open app, turn ON new setting
- Ensure all data like subscribed channels/profiles, sub cache, playlist, settings, etc. are still present
- Ensure
Replace HTTP Cachestill OFF (and empty fileexperiment-replace-http-cacheis gone) - Ensure data files (
*.db) now present in newuserDatafolder in app folder - Turn ON
Replace HTTP Cache - Ensure no empty file
experiment-replace-http-cachepresent in default user data folder - Optionally do some updates and ensure only files in app folder updated not those in default folder
- DELETE data files in default user data folder
- Turn OFF new setting
- Ensure all data like subscribed channels/profiles, sub cache, playlist, settings, etc. are still present
- Ensure
Replace HTTP Cachestill ON - Ensure data files now present in default
userDatafolder (%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 file
A3. Windows - NSIS installer version
- Install to a new folder
- Ensure all data like subscribed channels/profiles, sub cache, playlist, settings, etc. are still present
- Ensure new setting does NOT appear
B. Non windows (macOS/Linux)
- Open app
- Ensure all data like subscribed channels/profiles, sub cache, playlist, settings, etc. are still present
- Ensure new setting does NOT appear
Desktop
- OS:
- OS Version:
- FreeTube version:
Additional context
Ya also this doesn't work with portable version I admit I have never thought about those 2 versions coz I have never used/tried them (as a user) Marking as WIP
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)
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.