diff --git a/LogosLinuxInstaller.py b/LogosLinuxInstaller.py index 2f5dd1f..eff9245 100755 --- a/LogosLinuxInstaller.py +++ b/LogosLinuxInstaller.py @@ -240,6 +240,7 @@ def parse_args(args, parser): break if config.ACTION is None: config.ACTION = run_control_panel + logging.debug(f"{config.ACTION=}") def run_control_panel(): @@ -317,7 +318,7 @@ def main(): utils.check_for_updates() # Check if app is installed. - install_not_required = ['remove_install_dir', 'check_dependencies', 'update_latest_lli_release', + install_not_required = ['remove_install_dir', 'check_dependencies', 'update_to_latest_lli_release', 'update_to_latest_recommended_appimage', 'set_appimage_symlink'] if config.ACTION == "disabled": msg.logos_error("That option is disabled.", "info") diff --git a/LogosLinuxInstaller.spec b/LogosLinuxInstaller.spec index 99186de..e26942c 100644 --- a/LogosLinuxInstaller.spec +++ b/LogosLinuxInstaller.spec @@ -4,8 +4,9 @@ a = Analysis( ['LogosLinuxInstaller.py'], pathex=[], + #binaries=[('/usr/bin/tclsh8.6', '.')], binaries=[], - datas=[], + datas=[('img/*-128-icon.png', 'img')], hiddenimports=[], hookspath=[], hooksconfig={}, @@ -18,13 +19,16 @@ pyz = PYZ(a.pure) exe = EXE( pyz, a.scripts, + a.binaries, + a.datas, [], - exclude_binaries=True, name='LogosLinuxInstaller', debug=False, bootloader_ignore_signals=False, strip=False, upx=True, + upx_exclude=[], + runtime_tmpdir=None, console=True, disable_windowed_traceback=False, argv_emulation=False, @@ -32,12 +36,3 @@ exe = EXE( codesign_identity=None, entitlements_file=None, ) -coll = COLLECT( - exe, - a.binaries, - a.datas, - strip=False, - upx=True, - upx_exclude=[], - name='LogosLinuxInstaller', -) diff --git a/gui_app.py b/gui_app.py index ef7f316..66dca0c 100644 --- a/gui_app.py +++ b/gui_app.py @@ -5,8 +5,6 @@ import logging import os -import sys -import subprocess import threading from pathlib import Path from queue import Queue @@ -616,7 +614,9 @@ def __init__(self, root, *args, **kwargs): self.gui.deps_button.config(command=self.install_deps) self.gui.backup_button.config(command=self.run_backup) self.gui.restore_button.config(command=self.run_restore) - self.gui.update_lli_button.config(command=self.update_to_latest_lli_release) + self.gui.update_lli_button.config( + command=self.update_to_latest_lli_release + ) self.gui.latest_appimage_button.config( command=self.update_to_latest_appimage ) @@ -756,22 +756,11 @@ def open_file_dialog(self, filetype_name, filetype_extension): def update_to_latest_lli_release(self, evt=None): self.start_indeterminate_progress() - self.gui.messagevar.set("Updating to latest Logos Linux Installer version…") + self.gui.messagevar.set("Updating to latest Logos Linux Installer version…") # noqa: E501 t = Thread( target=utils.update_to_latest_lli_release, - daemon=True, ) t.start() - logging.debug("Finished updating Logos Linux Installer version.") - t.join() - - logging.debug("Restarting Logos Linux Installer.") - if self.root is not None: - self.root.destroy() - - args = [sys.executable] - subprocess.Popen(args) - sys.exit() def update_to_latest_appimage(self, evt=None): config.APPIMAGE_FILE_PATH = config.RECOMMENDED_WINE64_APPIMAGE_FULL_FILENAME # noqa: E501 @@ -850,10 +839,10 @@ def update_latest_lli_release_button(self, evt=None): state = '!disabled' elif status == 1: state = 'disabled' - msg = "This button is disabled. Logos Linux Installer is up-to-date." + msg = "This button is disabled. Logos Linux Installer is up-to-date." # noqa: E501 elif status == 2: state = 'disabled' - msg = "This button is disabled. Logos Linux Installer is newer than the latest release." + msg = "This button is disabled. Logos Linux Installer is newer than the latest release." # noqa: E501 if msg: gui.ToolTip(self.gui.update_lli_button, msg) self.clear_message_text() diff --git a/utils.py b/utils.py index a6f041b..fe0f290 100644 --- a/utils.py +++ b/utils.py @@ -223,11 +223,12 @@ def reboot(): def restart_lli(): - if config.DIALOG != tk: - logging.debug("Restarting Logos Linux Installer.") - args = [sys.executable] - subprocess.Popen(args) - sys.exit() + logging.debug("Restarting Logos Linux Installer.") + pidfile = Path('/tmp/LogosLinuxInstaller.pid') + if pidfile.is_file(): + pidfile.unlink() + os.execv(sys.executable, [sys.executable]) + sys.exit() def set_verbose(): @@ -1164,6 +1165,7 @@ def get_recommended_appimage(): def compare_logos_linux_installer_version(): if config.LLI_CURRENT_VERSION is not None and config.LLI_LATEST_VERSION is not None: + logging.debug(f"{config.LLI_CURRENT_VERSION=}; {config.LLI_LATEST_VERSION=}") if version.parse(config.LLI_CURRENT_VERSION) < version.parse(config.LLI_LATEST_VERSION): # Current release is older than recommended. status = 0 @@ -1235,8 +1237,7 @@ def update_lli_binary(): os.chmod(sys.argv[0], os.stat(sys.argv[0]).st_mode | 0o111) logging.debug("Successfully updated Logos Linux Installer.") - if config.DIALOG == "curses": - restart_lli() + restart_lli() def is_appimage(file_path):