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

PR: Automatically launch Spyder after installation (Installers) #21084

Merged
merged 12 commits into from
Jul 5, 2023

Conversation

mrclary
Copy link
Contributor

@mrclary mrclary commented Jun 29, 2023

Automatically launch Spyder after install

@mrclary mrclary self-assigned this Jun 29, 2023
@mrclary mrclary marked this pull request as draft June 29, 2023 19:09
@mrclary mrclary force-pushed the cbi-updates branch 4 times, most recently from 565cfc1 to a5807c3 Compare June 30, 2023 16:09
@mrclary mrclary changed the title PR: Installer updates PR: Automatically launch Spyder after install (installer) Jun 30, 2023
@mrclary mrclary added this to the v6.0alpha2 milestone Jun 30, 2023
@mrclary mrclary marked this pull request as ready for review June 30, 2023 20:47
@ccordoba12
Copy link
Member

@mrclary, I pushed directly to your branch a commit to improve the message we show on Linux when the installer finishes. This was bothering me a bit the last times I tested the installer and it was not easy to leave a suggestion for it here.

Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrclary, one small comment from me, the rest looks good.

I also forgot to mention that if you have comments or suggestions about the changes I pushed to your branch, please let me know about them.

installers-conda/resources/post-install.sh Outdated Show resolved Hide resolved
Copy link
Member

@dalthviz dalthviz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mrclary ! Checked locally on Windows and Spyder launches automatically! 👍

However, if understand correctly. with this Spyder will always open after installation? There is no possibility to have a user confirmation before launch Spyder, right? Also, seems like the installer window is still present after Spyder opens and you have to click next to see the last installer page and close it:

image

Other than those pointers, which probably are caused do to the way constructor post install script works on Windows so there is not much we can do here about that, this LGTM 👍

@mrclary
Copy link
Contributor Author

mrclary commented Jul 1, 2023

@dalthviz, thanks for reviewing this PR.

However, if understand correctly. with this Spyder will always open after installation? There is no possibility to have a user confirmation before launch Spyder, right?

Correct. I think this could be fixed for Windows if we used an nsis template. I don't think constructor will ever adopt an application launcher mechanism so I don't think this will be a possibility for macOS and Linux, unless we could patch that into constructor ourselves.

Also, seems like the installer window is still present after Spyder opens and you have to click next to see the last installer page and close it

That is correct. I may be able to devise a solution for all platforms to delay launching Spyder until the installer is closed. 👀

@mrclary
Copy link
Contributor Author

mrclary commented Jul 1, 2023

Also, seems like the installer window is still present after Spyder opens and you have to click next to see the last installer page and close it

That is correct. I may be able to devise a solution for all platforms to delay launching Spyder until the installer is closed. 👀

@dalthviz, I just pushed up another commit that may resolve this issue. Another process is started that waits for the graphical installer to exit before starting Spyder.

@ccordoba12
Copy link
Member

ccordoba12 commented Jul 2, 2023

I found a bug while testing this (related to PR #20933) and I solve it on PR #21092.

Besides that, now Spyder launches after installation (which is great!), but the spyder bash alias is broken with this error:

$ spyder
gtk-launch: missing application name
Try "gtk-launch --help" for more information.

I'd prefer to not use gtk-launch to launch Spyder in the command line, especially to pass cli arguments to it. So, I think the previous implementation of that command was fine.

uninstall-spyder is also broken. It simply reports Uninstall aborted at the end.

@mrclary mrclary marked this pull request as draft July 2, 2023 03:16
@mrclary
Copy link
Contributor Author

mrclary commented Jul 2, 2023

I found a bug while testing this (related to PR #20933) and I solve it on PR #21092.

I just noticed that. Strange that it doesn't throw that error when bootstrapping...

Besides that, now Spyder launches after installation (which is great!), but the spyder bash alias is broken with this error:

$ spyder
gtk-launch: missing application name
Try "gtk-launch --help" for more information.

I'd prefer to not use gtk-launch to launch Spyder in the command line, especially to pass cli arguments to it. So, I think the previous implementation of that command was fine.

Ohh, that's right. Will revert.

uninstall-spyder is also broken. It simply reports Uninstall aborted at the end.

I'll look at these errors. Thanks for investigating this @ccordoba12 😄

@ccordoba12
Copy link
Member

I just noticed that. Strange that it doesn't throw that error when bootstrapping...

I think that's because updates are not run on DEV mode.

@mrclary mrclary force-pushed the cbi-updates branch 4 times, most recently from 834368c to f5e34b8 Compare July 3, 2023 18:18
@mrclary mrclary marked this pull request as ready for review July 3, 2023 19:59
@dalthviz
Copy link
Member

dalthviz commented Jul 3, 2023

I just pushed up another commit that may resolve this issue. Another process is started that waits for the graphical installer to exit before starting Spyder.

Awesome! However, checking again, seems like a cmd shows up in the task bar and you can click on it (I guess is related with the waiting process?). Is there something that could be done to prevent that cmd from showing/being shown in the task bar?

install

Anyhow, I think is nice that now Spyder launches after the installer window finishes/is closed 👍

@mrclary
Copy link
Contributor Author

mrclary commented Jul 3, 2023

@ccordoba12 @dalthviz, I think all the issues have been worked out now. Additionally, Spyder should delay starting until the graphical installer exits (macOS and Windows).

@mrclary
Copy link
Contributor Author

mrclary commented Jul 3, 2023

However, checking again, seems like a cmd shows up in the task bar and you can click on it (I guess is related with the waiting process?). Is there something that could be done to prevent that cmd from showing/being shown in the task bar?

That is correct; it is the waiting process. It is not possible to hide the cmd.exe window, only minimize it under these circumstances. However, I could try using a powershell process instead; maybe that will allow the hidden window... 👀

Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last, small suggestion from me, the rest is working as expected. Thanks @mrclary!

installers-conda/resources/post-install.sh Outdated Show resolved Hide resolved
@mrclary
Copy link
Contributor Author

mrclary commented Jul 4, 2023

@dalthviz, so switching to powershell did allow me to eliminate the minimized window. However, there is still a temporary "flash" of the powershell window. This is the same issue @jaimergp and I ran into with the lnk target and menuinst. I think it may be either a bug in powershell or I just don't know the right way to work it 😬. Nevertheless, I think it may be an improvement over a minimized window. What do you think?

@dalthviz
Copy link
Member

dalthviz commented Jul 4, 2023

Nevertheless, I think it may be an improvement over a minimized window. What do you think?

Checked locally and for sure is an improvement! Even if it shows for a moment, I would say is better since users will not be able to interact with a cmd 👍

mrclary and others added 11 commits July 4, 2023 23:54
This prevents Spyder from being killed when/if the terminal shell terminates.
I don't know if /B (don't open cmd window) has an effect in this context, but it doesn't hurt.
* Use SHARED_INSTALLER_TEMP (TMPDIR environment variable is not available to post-install script).
* Correct the conditional with pgrep
Use posix compliant lower case parameter substitution.
Fix logic error
Note that a powershell console still "flashes" briefly before being hidden.
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works like a charm for me now, thanks @mrclary!

@ccordoba12 ccordoba12 changed the title PR: Automatically launch Spyder after install (installer) PR: Automatically launch Spyder after installation (Installers) Jul 5, 2023
@ccordoba12
Copy link
Member

@dalthviz, are you good to merge now?

Copy link
Member

@dalthviz dalthviz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mrclary !

@ccordoba12 ccordoba12 merged commit 23c01b1 into spyder-ide:master Jul 5, 2023
@mrclary mrclary deleted the cbi-updates branch July 5, 2023 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants