NickeManarin / ScreenToGif

🎬 ScreenToGif allows you to record a selected area of your screen, edit and save it as a gif or video.
http://www.screentogif.com
Microsoft Public License
23.52k stars 2.17k forks source link

add scoop as installation method #741

Open shafschwd opened 3 years ago

shafschwd commented 3 years ago

add scoop as installation method on website and on readme.md https://github.com/lukesampson/scoop-extras/blob/master/bucket/screentogif.json

Scoop is a command-line installer for Windows

Polisson commented 2 years ago

+1 to idea, but... besides placing website/readme.md, this method needs more testing because there is a little issue with installing of (and I'll describe it here as the title best fit): ScreenToGif doesn't seem to save user configuration between its launching. Scoop makes two things:

  1. symlinks ~\scoop\apps\screentogif\current to actual app version folder (as of writing 2.36), that's OK;
  2. particular file ~\scoop\apps\screentogif\current\Settings.xaml is hardlinked to ~\scoop\persist\screentogif\Settings.xaml that is a culprit! As a workaround to restore saving of settings: break this hardlink (specifically: replace with symlink to persistent dir).

I am writing a parallel issue on extras bucket github repo issues. Here for anybody wanting to instant solution.

rashil2000 commented 2 years ago

I'm not able to reproduce the above issue. My settings are saved as they should. Also, in both the the cases, the link is a hardlink. Scoop does not create symlinks.

Polisson commented 2 years ago

OK. In my case, two discrete machines have the same behavior. I've just made another test and have a suspicion: After standard installation by scoop, the file Settings.xaml has 0 bytes (empty, of course). But when this file is not existing, ScreenToGif creates one on first launch with such content: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"></ResourceDictionary> So existing an empty file (with no structure) prevents from making new default file.

rashil2000 commented 2 years ago

Is the default settings file available somewhere in this repo? We can use it instead of creating a new (blank) settings file.

Polisson commented 2 years ago

Nope, installation scoop just downloads portable edition of app, then extracts it and creates it's file structure (links files and folders in few places). I'm a newbie in scoop configs, but maybe there is possibility to fill up file with correct/required content, right after creation.

rashil2000 commented 2 years ago

maybe there is possibility to fill up file with correct/required content, right after creation.

Yep, that's what I'm saying

Polisson commented 2 years ago

You asked if there is a file, but I'm saying there is no such file. So I came up with ScreenToGif ability to fill an empty file with correct structure:

rashil2000 commented 2 years ago

I'm not sure I follow, how will you ask Screentogif to create the file while it's installing?

Polisson commented 2 years ago

OK, so the simplest way of my understanding... Two alternative solutions I'm imaging:

  1. scoop installs S2G by placing correctly .exe file and making an empty .xaml file and hardlinking. When done, scoop injects to file such string <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"></ResourceDictionary>. Here installation is finished
  2. scoop installs S2G by placing correctly .exe file, next launches S2G, kills it, then .xaml hardlinking to persistent dir. Here installation is finished
rashil2000 commented 2 years ago

The first method sounds elegant. Can you make a PR for it?