Fix ffmpeg install script not closing window after install done.

This commit is contained in:
csd4ni3l
2025-07-22 19:36:54 +02:00
parent 13742b8a0c
commit 8b687e437a

View File

@@ -14,12 +14,12 @@ class FFmpegMissing(arcade.gui.UIView):
width=self.window.width / 2,
height=self.window.height / 2,
title="Third-party FFmpeg Missing",
message_text="FFmpeg is a third party software that is required for this application to work. It needs to be downloaded with libavcodec (and) shared libraries included. We provide a basic install script for Windows that might or might not work. For other operating systems, install from the package manager to make sure it is in PATH.",
message_text="FFmpeg is a third party software that is required for this application to work. It needs to be downloaded with libavcodec (and) shared libraries included. We provide a basic install script for Windows that might or might not work. If it works, it will close the program so you need to open it again. For other operating systems, install from the package manager to make sure it is in PATH.",
buttons=("Exit", "Install")
)
)
msgbox.on_action = lambda event: self.install_ffmpeg() if event.action == "Install" else sys.exit()
msgbox.on_action = lambda event: self.install_ffmpeg() if event.action == "Install" else lambda event: self.window.close()
def install_ffmpeg(self):
bin_dir = os.path.join(os.getcwd(), "bin")
@@ -29,7 +29,7 @@ class FFmpegMissing(arcade.gui.UIView):
if system == "Linux" or system == "Darwin":
msgbox = self.add_widget(arcade.gui.UIMessageBox(message_text="You are on a Linux or Darwin based OS. You need to install FFmpeg and libavcodec shared libraries from your package manager to make sure it is in PATH.", width=self.window.width / 2, height=self.window.height / 2))
msgbox.on_action = lambda: sys.exit()
msgbox.on_action = lambda event: self.window.close()
return
elif system == "Windows":
@@ -39,7 +39,7 @@ class FFmpegMissing(arcade.gui.UIView):
"--accept-source-agreements", "--accept-package-agreements"
], check=True)
logging.debug("FFmpeg installed via winget.")
sys.exit()
self.window.close()
return
except subprocess.CalledProcessError as e: