From 92ca9331c559383479152c74256c0eea6e4b4135 Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 30 Oct 2025 23:24:08 +0300 Subject: [PATCH] update --- README.md | 4 ++++ src/installationthread.py | 36 ++++++++++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6456d38..2365fdd 100644 --- a/README.md +++ b/README.md @@ -37,3 +37,7 @@ cd aegnux ```bash ./run.sh ``` + +## We need help! +You're welcome to contribute to this project. +You can improve translations, AMD GPU support, overall stability, etc. \ No newline at end of file diff --git a/src/installationthread.py b/src/installationthread.py index fdd8c5b..f96f317 100644 --- a/src/installationthread.py +++ b/src/installationthread.py @@ -1,4 +1,5 @@ import os +from pathlib import Path import shutil from src.config import ( AE_DOWNLOAD_URL, AE_FILENAME, @@ -31,6 +32,11 @@ class InstallationThread(ProcessThread): def run(self): try: + try: + shutil.rmtree(get_aegnux_installation_dir(), True) + except: + self.log_signal.emit(f'[WARNING] Can\'t remove existing installation.') + self.progress_signal.emit(10) if self.download_method == DownloadMethod.ONLINE: @@ -40,8 +46,34 @@ class InstallationThread(ProcessThread): self.progress_signal.emit(15) self.log_signal.emit(f'[DEBUG] Unpacking AE from {self.ae_filename}...') - self.unpack_zip(self.ae_filename, get_aegnux_installation_dir().as_posix()) - os.rename(get_aegnux_installation_dir().joinpath('Support Files'), get_ae_install_dir()) + aegnux_install_dir = get_aegnux_installation_dir() + self.unpack_zip(self.ae_filename, aegnux_install_dir.as_posix()) + + root_path = Path(aegnux_install_dir) + target_dir = Path(get_ae_install_dir()) + source_folder_to_delete = None + + self.log_signal.emit('[DEBUG] Searching for AfterFX.exe...') + + for exe_path in root_path.rglob('AfterFX.exe'): + source_dir_to_move = exe_path.parent + self.log_signal.emit(f'[DEBUG] Found installation folder: {source_dir_to_move}') + for item in source_dir_to_move.iterdir(): + shutil.move(item.as_posix(), target_dir.joinpath(item.name).as_posix()) + self.log_signal.emit(f'[DEBUG] All contents moved to {target_dir}') + source_folder_to_delete = source_dir_to_move.parent + break + + if source_folder_to_delete and source_folder_to_delete != root_path: + self.log_signal.emit(f'[DEBUG] Removing temporary folder: {source_folder_to_delete}') + try: + shutil.rmtree(source_folder_to_delete.as_posix()) + self.log_signal.emit('[DEBUG] Temporary folder removed successfully.') + except OSError as e: + self.log_signal.emit(f'[ERROR] Failed to remove temporary folder {source_folder_to_delete}: {e}') + else: + self.log_signal.emit('[WARNING] Installation folder not found or matched root path. No folder was deleted.') + self.progress_signal.emit(20)