Skip to content

Commit

Permalink
Set conda-based-app in pre-install script instead of post-install scr…
Browse files Browse the repository at this point in the history
…ipt so that spyder post-link script can see it.
  • Loading branch information
mrclary committed Jan 25, 2024
1 parent 79609ab commit b26aa69
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
3 changes: 3 additions & 0 deletions installers-conda/build_installers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
}
)
Expand All @@ -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": "",
Expand Down Expand Up @@ -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"),
}
)
Expand Down
3 changes: 0 additions & 3 deletions installers-conda/resources/post-install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions installers-conda/resources/post-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF
Expand Down
4 changes: 4 additions & 0 deletions installers-conda/resources/pre-install.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
:: Mark as conda-based-app
set menudir=%PREFIX%\envs\spyder-runtime\Menu
if not exist "%menudir%" mkdir "%menudir%"
echo. > "%menudir%\conda-based-app"
10 changes: 10 additions & 0 deletions installers-conda/resources/pre-install.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit b26aa69

Please sign in to comment.