mirror of
https://github.com/relativemodder/aegnux.git
synced 2025-12-10 13:39:43 +05:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4285914512 | ||
|
|
aed41431f2 | ||
|
|
e05e9e576b |
15
src/app.py
15
src/app.py
@@ -11,7 +11,18 @@ def main():
|
||||
app.setDesktopFileName(DESKTOP_FILE_NAME)
|
||||
app.setWindowIcon(QIcon(AE_ICON_PATH))
|
||||
|
||||
mainWindow = MainWindow()
|
||||
mainWindow.show()
|
||||
show_window = True
|
||||
quit_after_handling_args = False
|
||||
|
||||
for arg in sys.argv:
|
||||
if 'misterhorsepm://' in arg or '.aep' in arg:
|
||||
show_window = False
|
||||
quit_after_handling_args = True
|
||||
break
|
||||
|
||||
mainWindow = MainWindow(quit_after_handling_args)
|
||||
|
||||
if show_window:
|
||||
mainWindow.show()
|
||||
|
||||
return app.exec()
|
||||
@@ -111,6 +111,8 @@ class InstallationThread(ProcessThread):
|
||||
self.log_signal.emit(f"[INFO] Created CEP directory in {get_cep_dir()}")
|
||||
except:
|
||||
pass
|
||||
|
||||
self.symlink_support_files()
|
||||
|
||||
self.progress_signal.emit(99)
|
||||
|
||||
@@ -126,6 +128,19 @@ class InstallationThread(ProcessThread):
|
||||
self.log_signal.emit(f'[ERROR] {e}')
|
||||
self.finished_signal.emit(False)
|
||||
|
||||
def symlink_support_files(self):
|
||||
ae_dir = get_ae_install_dir()
|
||||
ae_pf_dir = get_wineprefix_dir().joinpath('drive_c/Program Files/Adobe/Adobe After Effects 2024')
|
||||
support_files_dir = ae_pf_dir.joinpath('Support Files')
|
||||
|
||||
if not ae_pf_dir.exists():
|
||||
os.makedirs(ae_pf_dir)
|
||||
|
||||
if not support_files_dir.exists():
|
||||
os.symlink(ae_dir, support_files_dir)
|
||||
|
||||
self.log_signal.emit(f'[DEBUG] Created symlink from {ae_dir} to {support_files_dir}')
|
||||
|
||||
def try_cleanup_installation(self):
|
||||
try:
|
||||
shutil.rmtree(get_aegnux_installation_dir(), True)
|
||||
|
||||
@@ -21,11 +21,12 @@ from src.types import DownloadMethod
|
||||
|
||||
|
||||
class MainWindow(MainWindowUI):
|
||||
def __init__(self):
|
||||
def __init__(self, quit_after_handling_args: bool = False):
|
||||
super().__init__()
|
||||
|
||||
self.ran_from_aep_file = False
|
||||
self.ran_from_mhtb_link = False
|
||||
self.quit_after_handling_args = quit_after_handling_args
|
||||
|
||||
self.setWindowTitle(gls('welcome_win_title'))
|
||||
self.install_button.clicked.connect(self.install_button_clicked)
|
||||
@@ -99,14 +100,13 @@ class MainWindow(MainWindowUI):
|
||||
gls('mhtb_not_found_title'),
|
||||
gls('mhtb_not_found_text')
|
||||
)
|
||||
return
|
||||
exit(0)
|
||||
|
||||
self.run_mhtb_thread = RunExeThread([f'{mhtb_dir.as_posix()}/ProductManager.exe', mhtb_link])
|
||||
self.run_mhtb_thread.log_signal.connect(self._log)
|
||||
self.run_mhtb_thread.finished_signal.connect(self._finished)
|
||||
|
||||
self.run_mhtb_thread.start()
|
||||
exit(0)
|
||||
|
||||
def try_autoopen_aep(self):
|
||||
self.run_ae_thread.clear_aep_file_arg()
|
||||
@@ -127,7 +127,6 @@ class MainWindow(MainWindowUI):
|
||||
|
||||
self.run_ae_thread.add_aep_file_arg(aep_file)
|
||||
self.run_ae_button_clicked()
|
||||
exit(0)
|
||||
|
||||
def init_installation(self):
|
||||
if check_aegnux_installed():
|
||||
@@ -189,6 +188,9 @@ class MainWindow(MainWindowUI):
|
||||
|
||||
@Slot(bool)
|
||||
def _finished(self, success: bool):
|
||||
if self.quit_after_handling_args:
|
||||
exit(0)
|
||||
|
||||
self.lock_ui(False)
|
||||
self.progress_bar.hide()
|
||||
self.init_installation()
|
||||
|
||||
Reference in New Issue
Block a user