popcorn-desktop icon indicating copy to clipboard operation
popcorn-desktop copied to clipboard

Auto-backup user data (database/config/settings)

Open Persei08 opened this issue 3 years ago • 3 comments

Is your feature request related to a problem? Please describe. Users don't always think to backup their profile, resulting in them loosing their bookmarked, watched items and settings when they do a clean re-install (which they sometimes need to do, to fix some bugs).

Describe the idea you'd like I think it could be useful to do automatic backups and maybe keep the latest 5, 10 or 15 ones (something to dig... could be more or less sophisticated).

Eventually we can even later add some related features like asking users if they want to restore a previous backup when they do a clean install.

I suggest the auto-backup feature to require the user to manually enable it in settings and then ask him to choose its destination folder (eventually even ask him to choose how many older backups he want to keep).

Describe alternatives you've considered external script triggered by task manager / crontab.

Additional context _Actually there is also a bug with PCT installer/uninstaller setup. Installing will always delete the installation folder. Uninstalling too, no matter if you choose to keep databases and settings or not.... It's another issue, but even if it could be fixed, keeping older profile backups can always be useful in case profile start to be corrupted. _

Persei08 avatar Oct 01 '20 08:10 Persei08

I took a quick look to why this happens and found this logic. Apparently this first deletes all files in directory and since we have app itself in same directory as user data it deletes that too. Next step is asking if we want to delete user data which is useless since files are already deleted.

installer_makensis.nsi 432-443

Section "uninstall"
    Call un.isRunning
    RMDir /r "$INSTDIR"
    RMDir /r "$SMPROGRAMS\${APP_NAME}"
    Delete "$DESKTOP\${APP_NAME}.lnk"

    MessageBox MB_YESNO|MB_ICONQUESTION "$(removeDataFolder)" IDNO NoUninstallData
        RMDir /r "$LOCALAPPDATA\${DATA_FOLDER}"
    NoUninstallData:
        DeleteRegKey HKCU "${UNINSTALL_KEY}"
        DeleteRegKey HKCU "Software\Classes\Applications\${APP_NAME}" ;file association
SectionEnd

I guess we need something like this click. Does anyone have any experience with nsis and can just implement this instead of just deleting everything? Then part with optional deletion of data dir is ok.

pcenta avatar Oct 03 '20 09:10 pcenta

Reopening. PR 1858 do a different thing.

The point here is to auto-backup profile in a folder (different than install_dir), so users could always look in this folder to restore their previous profile backups if they accidentally re-init PCT or what. ;)

Persei08 avatar Nov 26 '20 18:11 Persei08

No problem :)

we always can eventually, but I suggest to do the backup somewhere on the hard drive to start with, so they can also add this folder to their cloud sync clients.

But your suggestion is interesting and could even lead us in the direction of a sync feature to sync multiple instances of PCT. :D

Persei08 avatar Nov 27 '20 05:11 Persei08