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

Build instruction on Windows. #87

Closed
DYefremov opened this issue Apr 1, 2022 · 9 comments
Closed

Build instruction on Windows. #87

DYefremov opened this issue Apr 1, 2022 · 9 comments
Assignees

Comments

@DYefremov
Copy link
Owner

It is necessary to create a separate instruction for launching and building a standalone package in MS Windows.

@DYefremov DYefremov self-assigned this Apr 1, 2022
@mapi68
Copy link
Contributor

mapi68 commented Apr 1, 2022

Can you explain more verbose?
Started from here with .spec file and pyinstaller.....

@DYefremov
Copy link
Owner Author

Launch

The best way to run this program from source is using of MSYS2 platform.

  1. Download and install the platform as described here up to point 4.
  2. Launch mingw64 shell.
    mingw64
  3. Run first pacman -Suy After that, you may need to restart the terminal and re-run the update command.
  4. Install minimal required packages: pacman -S mingw-w64-x86_64-gtk3 mingw-w64-x86_64-python3 mingw-w64-x86_64-python3-gobject mingw-w64-x86_64-python3-pip mingw-w64-x86_64-python3-requests
    Optional: pacman -S mingw-w64-x86_64-python3-pillow
    To support streams playback, install the following packages (the list may not be complete):
    For MPV pacman -S mingw-w64-x86_64-mpv ,
    For GStreamer pacman -S mingw-w64-x86_64-gst-libav mingw-w64-x86_64-gst-plugins-bad mingw-w64-x86_64-gst-plugins-base mingw-w64-x86_64-gst-plugins-good mingw-w64-x86_64-gstreamer
  5. Download and unzip the archive with sources from preferred branch (e.g. master) in to folder where MSYS2 is installed. E.g: c:\msys64\home\username\
  6. Run mingw64 shell. Go to the folder where the program was unpacked. E.g: cd DemonEditor/
    And run: ./start.py

To be continued...

@DYefremov
Copy link
Owner Author

DYefremov commented Apr 3, 2022

Building a package

To build a standalone package, we can use PyInstaller.

  1. Launch mingw64 shell.
  2. Install PyInstaller via pip: pip3 install pyinstaller
  3. Go to the folder where the program was unpacked. E.g: c:\msys64\home\username\DemonEditor\
  4. Сopy and replace the files from the /build/win/ folder to the root .
  5. Go to the folder with the program in the running terminal: cd DemonEditor/
  6. Give the following command: pyinstaller.exe DemonEditor.spec
  7. Wait until the operation end. In the dist folder you will find a ready-made build.

Appearance

To change the look we can use third party Gtk3 themes and Icon sets .
To set the default theme:

  1. Сreate a folder "\etc\gtk-3.0\" in the root of the finished build folder.
  2. Create a settings.ini file in this folder with the following content:
[Settings]
gtk-icon-theme-name = Adwaita
gtk-theme-name = Windows-10

In this case, we are using the default icon theme "Adwaita" and the third party theme "Windows-10".
Themes and icon sets should be located in the share\themes and share\icons folders respectively.
To fine-tune the default theme you use, you can use the win_style.css file in the ui folder.
You can find more info about changing the appearance of Gtk applications on the Web yourself.

Corrections and additions are welcome!

DYefremov added a commit that referenced this issue Apr 4, 2022
@luxorko
Copy link

luxorko commented Apr 6, 2022

get error ..
My@LAPTOP-OM27EOQ1 MINGW64 ~/Demon $ ./start.py Traceback (most recent call last): File "C:\msys64-\home\My\Demon\start.py", line 26, in <module> from app.ui.main import start_app File "C:/msys64-\home\My\Demon/app/ui/main.py", line 38, in <module> from gi.repository import GLib, Gio, GObject ModuleNotFoundError: No module named 'gi'

@DYefremov
Copy link
Owner Author

I think not all dependencies were installed, or not installed correctly. In your case it looks like the package 'mingw-w64-x86_64-python3-gobject' is missing.

@luxorko
Copy link

luxorko commented Apr 6, 2022

after re-install get this:
My@LAPTOP-OM27EOQ1 MINGW64 /home/demon $ ./start.py Traceback (most recent call last): File "C:\msys64\home\demon\start.py", line 28, in <module> update_icon() File "C:\msys64\home\demon\start.py", line 10, in update_icon lines = f.readlines() File "C:/msys64/mingw64/lib/python3.9/encodings/cp1252.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 129: character maps to <undefined>

@DYefremov
Copy link
Owner Author

DYefremov commented Apr 6, 2022

I already answered here. Unfortunately, I can't add anything new. Personally, I can't reproduce it. Perhaps for testing purposes, it makes sense to try changing the locale of the system itself. For example in English. What locale and OS are you using? Try running mingw64 shell and give command: locale

@luxorko
Copy link

luxorko commented Apr 7, 2022

OS Win 10- EN

My@LAPTOP-OM27EOQ1 MINGW64 ~ $ locale LANG= LC_CTYPE="en_US.UTF-8" LC_NUMERIC="C.UTF-8" LC_TIME="C.UTF-8" LC_COLLATE="C.UTF-8" LC_MONETARY="C.UTF-8" LC_MESSAGES="C.UTF-8" LC_ALL=

@DYefremov
Copy link
Owner Author

Yes, I can confirm. Really interesting. Occurs on Win 10 if the system locale is en_US.

In addition, you can try replacing the start.py file in the source folder with this one.

This should help! In addition, I slightly changed the main start script. It should also work, but I still recommend the method above!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants