-
Notifications
You must be signed in to change notification settings - Fork 3
Windows Configurations
Inside the project directory, create a virtual environment (venv)
At the cmd, at the project's root directory, type:
python -m venv .\venvAfter that you should see a venv directory.
To use the virtual environment, run:
.\venv\Scripts\activateThe terminal will show you that you are inside the virtual environment somehow, usually with a flag (venv) above the insert line.
To build the project, PyInstaller will be required. You can use it directly from the virtual environment.
pyinstaller --icon .\resources\icons\hexagon.ico --add-data ".\resources\fonts;resources\fonts" --add-data ".\resources\gifs;resources\gifs" --add-data ".\resources\icons;resources\icons" --add-data ".\resources\images;resources\images" --add-data ".\resources\logos;resources\logos" --clean --noconfirm --collect-data pulp --onefile --noconsole --name GraphFilter-x.x.x-win app.pyCreate a spec file it's useful because it's easier to change some configuration in the file instead of the command line, since it has too many options.
Alternatively, it is possible to create the spec file, which is just replace pyinstaller for pyi-makespec, removing the --clean and --noconfirm options.
pyi-makespec --icon .\resources\icons\hexagon.ico --add-data ".\resources\fonts;resources\fonts" --add-data ".\resources\gifs;resources\gifs" --add-data ".\resources\icons;resources\icons" --add-data ".\resources\images;resources\images" --add-data ".\resources\logos;resources\logos" --collect-data pulp --onefile --noconsole --name GraphFilter-x.x.x-win app.pyThis will create an GraphFilter-x.x.x-win.spec file.
Replace x.x.x for the version number of the release
After creating the spec file, run the following command:
pyinstaller GraphFilter-x.x.x-win.specAfter the previous steps, you will see that two folders were created inside the project structure: build and dist.
Inside dist will be an executable file that runs the program.
To run the program you just need to double click the executable.