TagStudio icon indicating copy to clipboard operation
TagStudio copied to clipboard

All-in-one please-download-and-run-thank-you "easy mode" script

Open ShadowJonathan opened this issue 1 year ago • 9 comments

I'm seeing a lot of people in the discord asking for help with installation instructions, I think we should have a simple easy_run.bat script or the likes that would;

  1. Check the installed python version(s), pick a compatible one, or;
  • Install a compatible python version (maybe after "press Y to install python")
  1. Create a venv, and install dependencies inside of it, or just verify its there
  2. Launch the program

This script could be hailed with a CMD ./easy_run.bat, or a double-click.


This script should be entirely temporary to the alpha stage and should be removed once we start doing packaged releases (releases with .exe binaries/installs bundled with them).

ShadowJonathan avatar Apr 23 '24 19:04 ShadowJonathan

ShadowJonathan like the #10 but for windows while we debug? sure.

OleMortensen8 avatar Apr 23 '24 20:04 OleMortensen8

More or less, but one that either prompts to or auto-installs Python (with a Y/N prompt) for the user

It should have a few more guardrails though, like determining the Python version that the user has installed is compatible with tagstudio (we don't want someone's old Python 2.7 install messing it up)

ShadowJonathan avatar Apr 23 '24 20:04 ShadowJonathan

I think this will make sense in particular as soon as we'll have a version that we want more people to test.

LunaLorea avatar Apr 23 '24 20:04 LunaLorea

I looked into it a bit more after our discussion on discord (Hi!, it's sheep 👋 ), and it does appear like winget is the way to go. It's the native package manager for Windows so it should be available on anything with Windows ~~10~~/11, and it'll let us install older versions too (since TagStudio only works on versions earlier than Python 3.10) right now. (Edit: Turns out winget is only available on windows 11 and later versions of windows 10, which I ran into when I was setting up my dev environment. Might end up being a situation where a user might still need to install something manually).

image

In the batch script itself, you'll probably need to get elevated priviledges, then run something along the lines of winget install Python.Python -v 3.10. And then you should be able to run the venv commands (though we'll likely need to account for which python version is called). There might also be issues with needing to restart the shell to get the updated PATH from the new Python version, which was an issue I used to run into (though it might not be an issue here).

Hope that helps with some of the Python installation stuff!

lynphan avatar Apr 23 '24 20:04 lynphan

I looked into it a bit more after our discussion on discord (Hi!, it's sheep 👋 ), and it does appear like winget is the way to go. It's the native package manager for Windows so it should be available on anything with Windows ~10~/11, and it'll let us install older versions too (since TagStudio only works on versions earlier than Python 3.10) right now. (Edit: Turns out winget is only available on windows 11 and later versions of windows 10, which I ran into when I was setting up my dev environment. Might end up being a situation where a user might still need to install something manually).

image

In the batch script itself, you'll probably need to get elevated priviledges, then run something along the lines of winget install Python.Python -v 3.10. And then you should be able to run the venv commands (though we'll likely need to account for which python version is called). There might also be issues with needing to restart the shell to get the updated PATH from the new Python version, which was an issue I used to run into (though it might not be an issue here).

Hope that helps with some of the Python installation stuff!

Can we have a Python check before installing anything? And then check if the user wants to use winget or scoop or choco? Cause I don't use Winget, I use scoop.sh, some use choco. Installing something that is already installed is a bit extra.

nielpattin avatar Apr 24 '24 06:04 nielpattin

Have you looked into PyInstaller?

LunaLorea avatar Apr 24 '24 08:04 LunaLorea

yes, but iirc that one packages an application for distribution, right?

this is for quick-n-dirty "run from source" for anyone who doesn't have previous development experience, we could use pyinstaller in the CI for tagging release builds with it, so people can download those

ShadowJonathan avatar Apr 24 '24 09:04 ShadowJonathan

Hi, I looked into packaging this with pyinstaller(don't know if its to early for it). I got it working as a exe with a console window attached. I used auto-py-to-exe (python package), that is build on pyinstaller and just provides a ui for generating the command to build it. The only concern that i have about building it, is that the outputet exe is unsigned and if someone downloads it they get that popup from windows smart screen(correction: Windows defender didn't complain in my vm but edge complained when i tried to download it). But the following comand worked for me to build it

pyinstaller --noconfirm --onefile --console --add-data "tagstudio/resources;resources/" --paths "tagstudio"  "tagstudio/tagstudio.py"

I build it as a console application because windows defender complains if i build it as a window application. I also think that winget can be run without priviliges but not sure about that right now.

Thesacraft avatar Apr 24 '24 12:04 Thesacraft

Update: As the tagstudio.py got renamed here is an updated command that now also includes the icon to package into the exe: pyinstaller --noconfirm --onefile --console --icon "tagstudio/resources/icon.ico" --add-data "tagstudio/resources;resources/" --paths "tagstudio" "tagstudio/tag_studio.py"

Thesacraft avatar Apr 25 '24 22:04 Thesacraft

Executables have been added to release v9.2.0

Loran425 avatar May 15 '24 16:05 Loran425

@ShadowJonathan offtopic: What the invite for Discord? Thank you

o-data avatar May 19 '24 07:05 o-data

@o-data Discord invite link

CyanVoxel avatar May 19 '24 07:05 CyanVoxel