diff --git a/.github/workflows/installers-conda.yml b/.github/workflows/installers-conda.yml index 0d3f7285804..36dfa3e6a56 100644 --- a/.github/workflows/installers-conda.yml +++ b/.github/workflows/installers-conda.yml @@ -7,6 +7,7 @@ on: paths: - 'installers-conda/**' - '.github/workflows/installers-conda.yml' + - '.github/scripts/installer_test.sh' - 'requirements/*.yml' - 'MANIFEST.in' diff --git a/.github/workflows/test-files.yml b/.github/workflows/test-files.yml index 5e3bb9ce692..78a679138c9 100644 --- a/.github/workflows/test-files.yml +++ b/.github/workflows/test-files.yml @@ -18,6 +18,7 @@ on: - '!.github/workflows/installers-conda.yml' - '!.github/workflows/build-subrepos.yml' - '!.github/workflows/purge-cache.yml' + - '!.github/scripts/installer_test.sh' pull_request: branches: @@ -36,6 +37,7 @@ on: - '!.github/workflows/installers-conda.yml' - '!.github/workflows/build-subrepos.yml' - '!.github/workflows/purge-cache.yml' + - '!.github/scripts/installer_test.sh' workflow_call: diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 165d19f24ed..14e257c6e8b 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -18,6 +18,7 @@ on: - '!.github/workflows/installers-conda.yml' - '!.github/workflows/build-subrepos.yml' - '!.github/workflows/purge-cache.yml' + - '!.github/scripts/installer_test.sh' pull_request: branches: @@ -36,6 +37,7 @@ on: - '!.github/workflows/installers-conda.yml' - '!.github/workflows/build-subrepos.yml' - '!.github/workflows/purge-cache.yml' + - '!.github/scripts/installer_test.sh' workflow_call: diff --git a/.github/workflows/test-mac.yml b/.github/workflows/test-mac.yml index ef830498bcc..7ab9d5fa3a6 100644 --- a/.github/workflows/test-mac.yml +++ b/.github/workflows/test-mac.yml @@ -18,6 +18,7 @@ on: - '!.github/workflows/installers-conda.yml' - '!.github/workflows/build-subrepos.yml' - '!.github/workflows/purge-cache.yml' + - '!.github/scripts/installer_test.sh' pull_request: branches: @@ -36,6 +37,7 @@ on: - '!.github/workflows/installers-conda.yml' - '!.github/workflows/build-subrepos.yml' - '!.github/workflows/purge-cache.yml' + - '!.github/scripts/installer_test.sh' workflow_call: diff --git a/.github/workflows/test-remoteclient.yml b/.github/workflows/test-remoteclient.yml index e88989fe9d8..bf1ea453791 100644 --- a/.github/workflows/test-remoteclient.yml +++ b/.github/workflows/test-remoteclient.yml @@ -16,6 +16,7 @@ on: - '!.github/workflows/installers-conda.yml' - '!.github/workflows/build-subrepos.yml' - '!.github/workflows/purge-cache.yml' + - '!.github/scripts/installer_test.sh' pull_request: branches: @@ -32,6 +33,7 @@ on: - '!.github/workflows/installers-conda.yml' - '!.github/workflows/build-subrepos.yml' - '!.github/workflows/purge-cache.yml' + - '!.github/scripts/installer_test.sh' workflow_call: diff --git a/.github/workflows/test-win.yml b/.github/workflows/test-win.yml index 8a1f8fdd7a4..6ce2d71f1a9 100644 --- a/.github/workflows/test-win.yml +++ b/.github/workflows/test-win.yml @@ -18,6 +18,7 @@ on: - '!.github/workflows/installers-conda.yml' - '!.github/workflows/build-subrepos.yml' - '!.github/workflows/purge-cache.yml' + - '!.github/scripts/installer_test.sh' pull_request: branches: @@ -36,6 +37,7 @@ on: - '!.github/workflows/installers-conda.yml' - '!.github/workflows/build-subrepos.yml' - '!.github/workflows/purge-cache.yml' + - '!.github/scripts/installer_test.sh' workflow_call: diff --git a/installers-conda/resources/post-install.bat b/installers-conda/resources/post-install.bat index fd48e6c6e53..e3703b76d38 100644 --- a/installers-conda/resources/post-install.bat +++ b/installers-conda/resources/post-install.bat @@ -1,17 +1,36 @@ -rem This script launches Spyder after install +@rem This script launches Spyder after install @echo off +call :redirect 2>&1 >> %PREFIX%\install.log + +:redirect +@echo Environment Variables: +set + +if defined CI set no_launch_spyder=true +if "%INSTALLER_UNATTENDED%"=="1" set no_launch_spyder=true +@echo CI = %CI% +@echo INSTALLER_UNATTENDED = %INSTALLER_UNATTENDED% +@echo no_launch_spyder = %no_launch_spyder% +if defined no_launch_spyder ( + @echo Installing in silent mode, do not launch Spyder + exit /b %errorlevel% +) else ( + @echo Launching Spyder after install completed. +) + set mode=system if exist "%PREFIX%\.nonadmin" set mode=user -rem Get shortcut path +@rem Get shortcut path for /F "tokens=*" %%i in ( '%PREFIX%\python %PREFIX%\Scripts\menuinst_cli.py shortcut --mode=%mode%' ) do ( set shortcut=%%~fi ) +@echo shortcut = %shortcut% -rem Launch Spyder +@rem Launch Spyder set tmpdir=%TMP%\spyder set launch_script=%tmpdir%\launch_script.bat @@ -21,6 +40,7 @@ echo @echo off echo :loop echo tasklist /fi "ImageName eq Spyder-*" /fo csv 2^>NUL ^| findstr /r "Spyder-.*Windows-x86_64.exe"^>NUL echo if "%%errorlevel%%"=="0" ^( +echo @rem Installer is still running echo timeout /t 1 /nobreak ^> nul echo goto loop echo ^) else ^( diff --git a/installers-conda/resources/post-install.sh b/installers-conda/resources/post-install.sh index ee56875b5b3..357a5faaa9e 100755 --- a/installers-conda/resources/post-install.sh +++ b/installers-conda/resources/post-install.sh @@ -186,7 +186,10 @@ fi echo "*** Post install script for ${INSTALLER_NAME} complete" # ---- Launch Spyder -[[ -n "$CI" ]] && exit 0 # Running in CI, don't launch Spyder +if [[ -n "$CI" || "$INSTALLER_UNATTENDED" == "1" || "$COMMAND_LINE_INSTALL" == "1" ]]; then + echo Installing in batch mode, do not launch Spyder + exit 0 +fi echo "Launching Spyder now..." if [[ "$OSTYPE" == "darwin"* ]]; then diff --git a/installers-conda/resources/pre-install.bat b/installers-conda/resources/pre-install.bat index 83cf5084652..ad3941c2b68 100644 --- a/installers-conda/resources/pre-install.bat +++ b/installers-conda/resources/pre-install.bat @@ -1,4 +1,4 @@ -rem Mark as conda-based-app +@rem Mark as conda-based-app set menudir=%PREFIX%\envs\spyder-runtime\Menu if not exist "%menudir%" mkdir "%menudir%" echo. > "%menudir%\conda-based-app"