Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silent install automatically starts the application in Spyder 6 #22730

Closed
10 tasks
valkenaer opened this issue Oct 25, 2024 · 8 comments · Fixed by #22876
Closed
10 tasks

Silent install automatically starts the application in Spyder 6 #22730

valkenaer opened this issue Oct 25, 2024 · 8 comments · Fixed by #22876

Comments

@valkenaer
Copy link

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

Spyder-Windows-x86_64.exe /S /InstallationType=AllUsers neatly installs everything into ProgramData but ALSO starts the application when the silent install is done (version 6.0.1)

How can I make sure the application DOESNT start? This messes up my deployments

What steps reproduce the problem?

What is the expected output? What do you see instead?

Paste Traceback/Error Below (if applicable)

PASTE TRACEBACK HERE

Versions

  • Spyder version:
  • Python version:
  • Qt version:
  • PyQt version:
  • Operating System name/version:

Dependencies

PASTE DEPENDENCIES HERE
@ccordoba12
Copy link
Member

Hey @valkenaer, thanks for reporting. I think this is a sensible request and we'll try to address it in 6.0.3 or 6.0.4, both to be released before the end of the year.

@mrclary, could you take a look at this one?

@ccordoba12 ccordoba12 added this to the v6.0.3 milestone Oct 25, 2024
@ccordoba12 ccordoba12 changed the title Silent install automaticall starts application Silent install automatically starts the application in Spyder 6 Oct 25, 2024
@mrclary
Copy link
Contributor

mrclary commented Oct 25, 2024

@ccordoba12, I agree that this is a sensible request. However, I don't know if we can achieve it with the current constructor limitations. As far as I know, there is no way to pass on to our post-install script whether or not the installer is running in silent mode (/S or "headless") or not. I think our only option right now is to not launch Spyder for any install mode.

@ccordoba12
Copy link
Member

However, I don't know if we can achieve it with the current constructor limitations. As far as I know, there is no way to pass on to our post-install script whether or not the installer is running in silent mode (/S or "headless") or not.

Ok, I was afraid you were going to say that.

I think our only option right now is to not launch Spyder for any install mode.

What if we create a new Windows installer that doesn't launch Spyder at the end? That one could be used by IT staff to install Spyder in batch mode, while still maintaining the current experience for the user-facing installer (which I think is really good).

@mrclary
Copy link
Contributor

mrclary commented Oct 27, 2024

What if we create a new Windows installer that doesn't launch Spyder at the end? That one could be used by IT staff to install Spyder in batch mode, while still maintaining the current experience for the user-facing installer (which I think is really good).

We can certainly do that. Would we be interested in doing the same for macOS and Linux? For all three platforms, it only requires removing the launch command at the end of the post-install script. For macOS, I would just make this a .sh installer also, like linux.

@ccordoba12
Copy link
Member

Would we be interested in doing the same for macOS and Linux?

Sure, I think that's ok in case someone needs them. And we should also add a new entry in the FAQ section of our docs to mention the existence of these installers so they can be easily found by other people.

@mrclary
Copy link
Contributor

mrclary commented Oct 28, 2024

Would we be interested in doing the same for macOS and Linux?

Sure, I think that's ok in case someone needs them. And we should also add a new entry in the FAQ section of our docs to mention the existence of these installers so they can be easily found by other people.

I'll await the resolution to conda/constructor#882 before moving forward.

@mrclary
Copy link
Contributor

mrclary commented Oct 30, 2024

So conda/constructor#882 appears that it will be included in the next constructor version. This will require an update to Spyder's installer base environment, so cannot be included until the next Spyder minor release (6.1.0). If the update to constructor occurs before then, the new feature will be included in Spyder 6.1.0, i.e. batch (-b) or silent (/S) installs will not launch Spyder upon completion.

@valkenaer, in the mean time, as a work-around, I recommend closing Spyder from the command-line immediately following completion of the install using the following bash code. Adapt as needed.

while [[ ! $(pgrep spyder 2>/dev/null) ]]; do
    echo "Waiting for Spyder to start..."
    sleep 1
done
echo "Quitting Spyder..."
pkill spyder 2>/dev/null
sleep 1
while [[ $(pgrep spyder 2>/dev/null) ]]; do
    echo "Waiting for Spyder to quit..."
    sleep 1
done

@mrclary
Copy link
Contributor

mrclary commented Oct 31, 2024

@valkenaer, sorry I forgot that you are running the installer on Windows. To close Spyder immediately after install, use the following batch script code.

:loop1
tasklist /v /fi "ImageName eq pythonw.exe" /fi "WindowTitle eq Spyder*" | find "Spyder" > nul
IF "%ERRORLEVEL%"=="1" (
    echo Waiting for Spyder to start...
    timeout /t 1 /nobreak > nul
    goto loop1
)
echo Spyder has started.

echo Quiting Spyder...
:loop2
tasklist /v /fi "ImageName eq pythonw.exe" /fi "WindowTitle eq Spyder*" | find "Spyder" > nul
IF "%ERRORLEVEL%"=="0" (
    taskkill /IM pythonw.exe /fi "WindowTitle eq Spyder*" > nul
    echo Waiting for Spyder to quit...
    timeout /t 1 /nobreak > nul
    goto loop2
)
echo Spyder is quit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants