feat: add Windows setup script and launcher for running from source

- setup-windows.ps1: downloads libmpv DLL and ffmpeg, installs pip deps
- 8cut.bat: double-click launcher
- main.py: add_dll_directory for libmpv next to script (not just frozen)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-14 23:08:17 +02:00
parent 46bd617f0a
commit 34d8ad1dc7
3 changed files with 68 additions and 7 deletions
+6 -7
View File
@@ -24,13 +24,12 @@ from PyQt6.QtWidgets import (
)
from PyQt6.QtCore import Qt, QObject, QThread, QTimer, QRect, QSize, pyqtSignal, QSettings
from PyQt6.QtGui import QPainter, QColor, QPen, QPixmap, QDragEnterEvent, QDropEvent, QCursor, QFont, QKeySequence, QShortcut
if getattr(sys, "frozen", False):
# In frozen builds, help ctypes find bundled libmpv
_bundle = Path(sys._MEIPASS)
if sys.platform == "win32":
os.add_dll_directory(str(_bundle))
elif sys.platform == "darwin":
os.environ.setdefault("DYLD_LIBRARY_PATH", str(_bundle))
if sys.platform == "win32":
# Help ctypes find libmpv-2.dll next to main.py or in frozen bundle
_dll_dir = Path(sys._MEIPASS) if getattr(sys, "frozen", False) else Path(__file__).parent
os.add_dll_directory(str(_dll_dir))
elif sys.platform == "darwin" and getattr(sys, "frozen", False):
os.environ.setdefault("DYLD_LIBRARY_PATH", str(Path(sys._MEIPASS)))
import mpv