karayaman / Play-online-chess-with-real-chess-board

Program that enables you to play online chess using real chess boards.
GNU General Public License v3.0
331 stars 24 forks source link

Windows installer bundle #37

Open ddugovic opened 14 hours ago

ddugovic commented 14 hours ago

I'd be glad to help you get CI building a Windows installer for this project.

karayaman commented 5 hours ago

Hi, thank you for the help. I will try to explain how I build a windows installer for this project so that you can check if it is possible.

Install Python and Libraries

  1. Install Python 3.12.
  2. Install the libraries listed in the requirements.txt file.
  3. Install pyinstaller and auto-py-to-exe.
  4. Run auto-py-to-exe.

Creating the Executable for Board Calibration

  1. Select the script location as board_calibration.py.
  2. Click Convert.

Creating the Executable for Diagnostic

  1. Select the script location as diagnostic.py.
  2. Click Convert.

Creating the Executable for Main

  1. Select the script location as main.py.
  2. Add the parameter berserk to --copy-metadata.
  3. Add the following parameters to --hidden-import:
    • pyttsx3.drivers
    • pyttsx3.drivers.dummy
    • pyttsx3.drivers.espeak
    • pyttsx3.drivers.nsss
    • pyttsx3.drivers.sapi5
  4. Click Convert.

Creating the Executable for GUI

  1. Select the script location as gui.py.
  2. Choose Window Based (hide the console).
  3. Keep the same hidden imports as those used for creating the executable for the main script.
  4. Modify gui.py to run Windows executables when the user clicks Start Game, Board Calibration, or Diagnostic. Below is the explanation for Diagnostic (the others are similar):
    • Comment lines 63, 73, and 74.
    • Uncomment lines 64, 75, 76, 77, and 78.
  5. Click Convert.

Creating the windows.zip File

  1. Create a folder named windows.
  2. Copy and paste the content generated in the previous sections into this folder. If prompted about duplicates, choose Replace.
  3. Copy and paste the license and machine learning models into the folder.
  4. Compress the folder into a .zip file.