summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2021-11-22 09:07:15 +0100
committerJose M. Guisado <jguisado@soleta.eu>2021-11-22 09:07:15 +0100
commitb5d5d29d31b6bc4402a9182aaee7b91365969863 (patch)
treed9b5be8586a08c15346e5d45ded30ca30f86304d
parent2e9e5bcb3d1522a7cd7053db7f7080a9e959e46b (diff)
#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
-rw-r--r--src/windows/ogOperations.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/windows/ogOperations.py b/src/windows/ogOperations.py
index baafbd9..6bc5e93 100644
--- a/src/windows/ogOperations.py
+++ b/src/windows/ogOperations.py
@@ -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()