diff --git a/build/windows/2_bundle-gimp-uni_base.sh b/build/windows/2_bundle-gimp-uni_base.sh index 10758b1495..af13e14802 100644 --- a/build/windows/2_bundle-gimp-uni_base.sh +++ b/build/windows/2_bundle-gimp-uni_base.sh @@ -208,7 +208,13 @@ if [ "$CI_JOB_NAME" != 'gimp-win-x64-cross' ]; then #bundle "$MSYS_PREFIX" lib/lua #bundle "$MSYS_PREFIX" share/lua - bundle "$MSYS_PREFIX" bin/python*.exe + if [ "$GIMP_UNSTABLE" ]; then + #python.exe is prefered in unstable versions because of error output + bundle "$MSYS_PREFIX" bin/python.exe + else + #pythonw.exe is prefered in stable releases because it works silently + bundle "$MSYS_PREFIX" bin/pythonw.exe + fi bundle "$MSYS_PREFIX" lib/python* clean "$GIMP_DISTRIB" lib/python*/*.pyc else diff --git a/build/windows/installer/base_gimp3264.iss b/build/windows/installer/base_gimp3264.iss index bf13b35a37..7b6816dbec 100644 --- a/build/windows/installer/base_gimp3264.iss +++ b/build/windows/installer/base_gimp3264.iss @@ -1470,10 +1470,12 @@ begin InterpFile := ExpandConstant('{app}\lib\gimp\{#GIMP_API_VERSION}\interpreters\pygimp.interp'); DebugMsg('PrepareInterp','Writing interpreter file for gimp-python: ' + InterpFile); -#ifdef GIMP_UNSTABLE - #define PYTHON="python.exe" +#if Defined(GIMP_UNSTABLE) && GIMP_UNSTABLE != "" + //python.exe is prefered in unstable versions because of error output + #define PYTHON="python.exe" #else - #define PYTHON="pythonw.exe" + //pythonw.exe is prefered in stable releases because it works silently + #define PYTHON="pythonw.exe" #endif InterpContent := 'python=' + ExpandConstant('{app}\bin\{#PYTHON}') + #10 + diff --git a/plug-ins/python/meson.build b/plug-ins/python/meson.build index d45451c073..748f5f7a35 100644 --- a/plug-ins/python/meson.build +++ b/plug-ins/python/meson.build @@ -37,10 +37,16 @@ foreach plugin : plugins endforeach endforeach -# Fallback fix to the problem of non-configured interpreters +# Fallback fix to the problem of non-configured interpreters (needed by MSIX) if platform_windows and not meson.is_cross_build() and python.found() python_config = configuration_data() - python_config.set('PYTHON_PATH', '') + if not stable + #python.exe is prefered in unstable versions because of error output + python_config.set('PYTHON_EXE', 'python.exe') + else + #pythonw.exe is prefered in stable releases because it works silently + python_config.set('PYTHON_EXE', 'pythonw.exe') + endif configure_file(input : 'pygimp.interp.in', output: 'pygimp.interp', diff --git a/plug-ins/python/pygimp.interp.in b/plug-ins/python/pygimp.interp.in index 28cccf017e..c33abc7415 100644 --- a/plug-ins/python/pygimp.interp.in +++ b/plug-ins/python/pygimp.interp.in @@ -1,5 +1,5 @@ -python=@PYTHON_PATH@python.exe -python3=@PYTHON_PATH@python.exe -/usr/bin/python=@PYTHON_PATH@python.exe -/usr/bin/python3=@PYTHON_PATH@python.exe +python=@PYTHON_EXE@ +python3=@PYTHON_EXE@ +/usr/bin/python=@PYTHON_EXE@ +/usr/bin/python3=@PYTHON_EXE@ :Python:E::py::python3: