diff --git a/scripts/windows/build-conda-installer.sh b/scripts/windows/build-conda-installer.sh index bdabffde11b..213bfebc7d8 100755 --- a/scripts/windows/build-conda-installer.sh +++ b/scripts/windows/build-conda-installer.sh @@ -373,4 +373,5 @@ cp "${CACHEDIR:?}/miniconda/Miniconda3-${MINICONDA_VERSION}-Windows-${CONDAPLATT mkdir -p "${BASEDIR:?}/icons" cp scripts/windows/{Orange.ico,OrangeOWS.ico} "${BASEDIR:?}/icons" +cp "$(dirname "$0")"/sitecustomize.py "${BASEDIR:?}"/conda-pkgs make-installer diff --git a/scripts/windows/condainstall.bat b/scripts/windows/condainstall.bat index 71ebaa46fd1..b3c6ecfcaea 100644 --- a/scripts/windows/condainstall.bat +++ b/scripts/windows/condainstall.bat @@ -59,3 +59,6 @@ if not exist "%ACTIVATE_BAT%" ( echo @echo off > "%ACTIVATE_BAT%" echo call "%CONDA_BASE_PREFIX%\Scripts\activate.bat" "%PREFIX%" >> "%ACTIVATE_BAT%" ) + +rem # install custom sitecustomize module +copy sitecustomize.py "%PREFIX%\Lib\ diff --git a/scripts/windows/sitecustomize.py b/scripts/windows/sitecustomize.py new file mode 100644 index 00000000000..6ad85a1433f --- /dev/null +++ b/scripts/windows/sitecustomize.py @@ -0,0 +1,27 @@ +# +# sitecustomize added by orange3 installer. +# +# (Ana)conda python distribution expects it is 'activated', it does not really +# support unactivated invocations (although a similar facility to this was +# included in anaconda python 3.6 and earlier). + +import sys +import os + + +def normalize(path): + return os.path.normcase(os.path.normpath(path)) + + +extra_paths = [ + r"Library\bin", +] + +paths = os.environ.get("PATH", "").split(os.path.pathsep) +paths = [normalize(path) for path in paths] + +for path in extra_paths: + path = os.path.join(sys.prefix, path) + + if os.path.isdir(path) and normalize(path) not in paths: + os.environ["PATH"] = os.pathsep.join((path, os.environ.get("PATH", "")))