Skip to content
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

Keep configurations in separate dedicated dir even for portable install #934

Closed
goyalyashpal opened this issue Mar 22, 2024 · 7 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@goyalyashpal
Copy link

goyalyashpal commented Mar 22, 2024

Is your feature request related to a problem? Please describe.

The configuration files are scattered all around in "portable install", i.e. "Open configuration folder < Help" A- * (h > o) is same as the root of smplayer installation dir.

This makes it difficult to export or make a backup of configurations for these.

Describe the solution you'd like

Similar to how the configuration folder when the program is installed systemwide (non-portable) shows up to be: %USERPROFILE%/.smplayer, for portable install too, it can be a .smplayer dir inside the root of smplayer install.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context

Contents of the config folder from system-wide install:

$ eza -a "$USERPROFILE/.smplayer"
favorites.m3u8  player_info.ini  radio.m3u8    styles.ass
hdpi.ini        playlist.ini     smplayer.ini  tv.m3u8

I have switched to using scoop package manager to install smplayer, and mpv etc. (details in comment below)

Environment & versions:

Version: 23.12.0 (revision 10207) (64-bit)
Portable Edition
Using Qt 5.15.2 (compiled with Qt 5.15.2)
Using MPV 0.36.0

@goyalyashpal goyalyashpal added the enhancement New feature or request label Mar 22, 2024
@goyalyashpal
Copy link
Author

goyalyashpal commented Mar 22, 2024

The scoop package manager's manifest for smplayer:
https://github.com/ScoopInstaller/Extras/blob/f34d6bf791c33007b1a7a5923924dd938c1fa6d0/bucket/smplayer.json#L17-L40

$ # Outputs of these commands shared below:
$ scoop cat smplayer | jq .persist[]
$ scoop cat smplayer | jq -r .pre_install[]      # | bat -pl ps1
$ scoop cat smplayer | jq -r .pre_uninstall[]    # | bat -pl ps1
  • persist specification:
"screenshots"
"hdpi.ini"
"playlist.ini"
"favorites.m3u8"
"radio.m3u8"
"tv.m3u8"
  • pre_install hook script:

    this code loops through the array of file names and silently creates a new file in the $dir directory if it doesn't already exist in the $persist_dir directory.
    this code checks if $persist_dir\smplayer.ini exists and copies it to $dir if it does.

'hdpi.ini', 'playlist.ini', 'favorites.m3u8', 'radio.m3u8', 'tv.m3u8' | ForEach-Object {
    if (!(Test-Path "$persist_dir\$_")) { New-Item "$dir\$_" | Out-Null }
}
if (Test-Path "$persist_dir\smplayer.ini") { Copy-Item "$persist_dir\smplayer.ini" "$dir\smplayer.ini" }
  • pre_uninstall hook script (yes, comment is included in script too):
# The following must be done as SMPlayer deletes the original file which was linked to the persist folder when it saves settings, rather than editing the file.
Copy-Item "$dir\smplayer.ini" "$persist_dir\smplayer.ini"

@smplayer-dev
Copy link
Owner

I think this is fixed in commit cb08e90

@smplayer-dev
Copy link
Owner

Please check if this is fixed in the development version:
https://github.com/smplayer-dev/smplayer/releases/tag/v23.12.0.10266

@goyalyashpal
Copy link
Author

Please check if this is fixed in the development version:

hi! thanks for the updates. i will check them in some days.

as i have already spent way tooo much times managing my app installs in past few days, unfortunately i won't be able to do it soon... but i will try to do it within 15 days.

@goyalyashpal goyalyashpal changed the title Keep configurations in separate dedicated dir even for portable install make portablezip package too (configs dir within install) Apr 16, 2024
@goyalyashpal goyalyashpal changed the title make portablezip package too (configs dir within install) make portable the zip package too (configs dir within install) Apr 16, 2024
@goyalyashpal
Copy link
Author

hi! yes... have tried using this, and am recording my steps below: (latest v*.10266 unless specified)

  • opening smplayer created config/smplayer.ini
  • running a file created config/player_info.ini
  • adding multiple files <Ctrl-l> > + created config/playlist.ini
  • exiting smplayer created the files shown in following code-block
  • restarting and exiting didn't create any new file
  • there's no *.ini file in the root dir of install
config/
├── [favorites|tv|radio].m3u8 
├── hdpi.ini 
└── file_settings/
    └── */
        └── *.ini

so yeah, i'd say it's working now...

@goyalyashpal
Copy link
Author

goyalyashpal commented Apr 22, 2024

basically, what it boils down to, in context of this new behaviour, is the following:

  • similar to how smplayer deleted the original smplayer.ini file prior to this change,

  • ... does smplayer still deletes the config/ directory (in any circumstance)?
    this is crucial as the config dir will be symlinked to the a separate persist directory.

  • should these be persisted too:

    • config/file_settings/ dir
    • styles.ass

Original comment

the way scoop works (as relevant to issue at hand) is as follows:

  • it symlinks the persistent files from the apps install directory to a separate directory
    (i think in a fashion inspired by linux apps)
  • it provides hooks to run some script at some times of the installs, like before/after install or uninstall
  • an update is just:
    • an uninstall (deletion) followed by reinstall (extraction)
    • combined with some standard hard-coded logic for the persistent files (mentioned above)
    • combined with the custom logic (if any) at the install hooks
  • all this info is store in the "manifest" file for the application

the existing manifest file for smplayer had following scripts for pre_install and pre_uninstall hooks in powershell language. can you determine if these will be needed now or not?

@goyalyashpal

This comment was marked as duplicate.

@goyalyashpal goyalyashpal changed the title make portable the zip package too (configs dir within install) Keep configurations in separate dedicated dir even for portable install Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants