From b26aa69f0a56b5681c8ae396b784e9f4ad374f42 Mon Sep 17 00:00:00 2001 From: Ryan Clary <9618975+mrclary@users.noreply.github.com> Date: Mon, 8 Jan 2024 21:26:31 -0800 Subject: [PATCH] Set conda-based-app in pre-install script instead of post-install script so that spyder post-link script can see it. --- installers-conda/build_installers.py | 3 +++ installers-conda/resources/post-install.bat | 3 --- installers-conda/resources/post-install.sh | 4 ---- installers-conda/resources/pre-install.bat | 4 ++++ installers-conda/resources/pre-install.sh | 10 ++++++++++ 5 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 installers-conda/resources/pre-install.bat create mode 100644 installers-conda/resources/pre-install.sh diff --git a/installers-conda/build_installers.py b/installers-conda/build_installers.py index c3e33ab4e9b..9b0839ec44d 100644 --- a/installers-conda/build_installers.py +++ b/installers-conda/build_installers.py @@ -265,6 +265,7 @@ def _definitions(): "default_prefix": os.path.join( "$HOME", ".local", INSTALLER_DEFAULT_PATH_STEM ), + "pre_install": str(RESOURCES / "pre-install.sh"), "post_install": str(RESOURCES / "post-install.sh"), } ) @@ -279,6 +280,7 @@ def _definitions(): definitions.update( { "progress_notifications": True, + "pre_install": str(RESOURCES / "pre-install.sh"), "post_install": str(RESOURCES / "post-install.sh"), "conclusion_text": "", "readme_text": "", @@ -315,6 +317,7 @@ def _definitions(): "%ALLUSERSPROFILE%", INSTALLER_DEFAULT_PATH_STEM ), "check_path_length": False, + "pre_install": str(RESOURCES / "pre-install.bat"), "post_install": str(RESOURCES / "post-install.bat"), } ) diff --git a/installers-conda/resources/post-install.bat b/installers-conda/resources/post-install.bat index e6e4c34a57f..d33e3c33459 100644 --- a/installers-conda/resources/post-install.bat +++ b/installers-conda/resources/post-install.bat @@ -13,9 +13,6 @@ for /F "tokens=*" %%i in ( set shortcut=%%~fi ) -:: Mark as conda-based-app -echo. > "%spy_rt%\Menu\conda-based-app" - :: Launch Spyder set tmpdir=%TMP%\spyder set launch_script=%tmpdir%\launch_script.bat diff --git a/installers-conda/resources/post-install.sh b/installers-conda/resources/post-install.sh index c4eb807c8a5..6b808c70c4e 100755 --- a/installers-conda/resources/post-install.sh +++ b/installers-conda/resources/post-install.sh @@ -143,10 +143,6 @@ echo "Spyder successfully uninstalled." END chmod u+x ${u_spy_exe} -# ---- -echo "Marking as conda-based-app..." -touch ${PREFIX}/envs/spyder-runtime/Menu/conda-based-app - # ---- if [[ "$OSTYPE" = "linux"* ]]; then cat < "%menudir%\conda-based-app" diff --git a/installers-conda/resources/pre-install.sh b/installers-conda/resources/pre-install.sh new file mode 100644 index 00000000000..ae5b6737bb1 --- /dev/null +++ b/installers-conda/resources/pre-install.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -e +echo "*** Running pre install script for ${INSTALLER_NAME} ..." + +echo "Marking as conda-based-app..." +menudir="${PREFIX}/envs/spyder-runtime/Menu" +mkdir -p "$menudir" +touch "${menudir}/conda-based-app" + +echo "*** Pre install script for ${INSTALLER_NAME} complete"