#1065 Support pyinstaller for Windows

Add required function call before running any process with
multiprocessing. This is required for windows executables to
work properly when using pyinstaller.

See:
https://github.com/pyinstaller/pyinstaller/wiki/Recipe-Multiprocessing
more_events
Jose M. Guisado 2021-11-22 09:07:15 +01:00
parent 2e9e5bcb3d
commit b5d5d29d31
1 changed files with 2 additions and 1 deletions

View File

@ -11,7 +11,7 @@ import ctypes
import subprocess
from subprocess import CalledProcessError
import multiprocessing as mp
from multiprocessing import Process
from multiprocessing import Process, freeze_support
from PIL import Image, ImageDraw
from pystray import Icon, Menu, MenuItem
@ -67,6 +67,7 @@ systray_p = Process(target=create_systray)
class OgWindowsOperations:
def __init__(self):
freeze_support()
mp.set_start_method('spawn')
systray_p.start()