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

Spyder 6.0.0rc2 Windows Standalone installer seems to be making changes to the Windows Registry breaking the cmd.exe association with .cmd and .bat files #22389

Open
7 tasks done
JulioCantarero opened this issue Aug 27, 2024 · 13 comments

Comments

@JulioCantarero
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
  • [N/A] Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • [N/A] Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • [N/A] 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

Windows .cmd and .bat files cannot be executed by double-clicking them anymore, because Spyder 6 wrongly claims the association with these 2 types of files.

What steps reproduce the problem?

  1. Install Spyder 6.0.0rc2 > Spyder-Windows-x86_64.exe
  2. There are new entries created in the Windows Registry that mess up with the normal use of .cmd and .bat files. I found:
    • New key spyder-6.AssocFile.cmd in HKEY_CLASSES_ROOT.cmd\OpenWithProgids
    • New folder HKEY_CLASSES_ROOT\spyder-6.AssocFile.cmd
    • New key spyder-6.AssocFile.bat in HKEY_CLASSES_ROOT.bat\OpenWithProgids
    • New folder HKEY_CLASSES_ROOT\spyder-6.AssocFile.bat
    • New .cmd and .bat folders in HKEY_CURRENT_USER\Software\Clases\
    • New .cmd and .bat folders in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\
  3. If you delete all these Windows Registry entries .cmd and .bat files work as before.

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

In Windows, I do not expect Spyder to be associated with files .cmd and .bat.

Paste Traceback/Error Below (if applicable)

Versions

  • Spyder version: Spyder 6.0.0rc2
  • Python version: 3.11
  • Qt version: N/A
  • PyQt version: N/A
  • Operating System name/version: Windows 11 Pro, Version 23H2 22631.4037, Windows Feature Experience Pack 1000.22700.1027.0

Dependencies

N/A

@dalthviz
Copy link
Member

Hi @JulioCantarero thank you for the feedback and giving it a try to the Spyder 6 rc2 release! What do you think @ccordoba12 @mrclary ?

@ccordoba12
Copy link
Member

This should be fixed by conda-forge/spyder-feedstock#183.

@mrclary
Copy link
Contributor

mrclary commented Aug 29, 2024

@JulioCantarero, I am unable to reproduce your issue. The registry items you list are created, as expected, but they do not result in the behavior you describe. I am still able to double-click .bat files and they open in cmd.exe.

bat

@JulioCantarero
Copy link
Author

Hi.
I see. It is strange. My problem started when I uninstalled Spyder 6 rc1 and installed Spyder 6 rc2.
And it was solved by removing the Windows Registry entries I listed. Maybe there was some preliminary condition in my Windows registry that triggered the problem. I don't know.

Another check in case you want to do it. I actually noticed the problem because I have a start-up CMD script, and it stopped running any more. Instead, when I logged into Windows, I got a "Run with" prompt to select the application, where Spyder was shown, but not "cmd.exe". I noticed the second symptom of not running at double-click later, but it was easier to explain.
You can emulate this by creating a symbolic link in "C:\Users\xxxUSERxxx\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup".

In any case, thank you for testing it. Maybe it is not a general problem, I cannot say, I am not an expert in Windows registry.
I will try and repeat the installation tomorrow, see it results in the same problem. But even if it does, it may be a particular problem.
Thanks,

@mrclary
Copy link
Contributor

mrclary commented Aug 30, 2024

@JulioCantarero, thanks for the additional information. I will try to setup a startup script to see if anything happens for me. One thing you may also try to do is search for all occurrences of "spyder" in your registry and remove them. Perhaps something got messed up by installing/uninstalling rc1 and a residual entry is giving the problem.

@JulioCantarero
Copy link
Author

JulioCantarero commented Aug 30, 2024

@mrclary, I just repeated uninstall rc2 + registry review + install rc2.

I searched the Windows registry for entries containing spyder, and I deleted a few things, but I don't think any of them had any meaning, they seem mostly log info. For the record, I deleted:

  • HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts spyder-6.AssocFile.cmd_.cmd
  • HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\DefaultAccount\Current\{2323cd33-63ab-42f8-a2a2-519758d0c27c}$windows.data.apps.appmetadata$appmetadatalist\windows.data.apps.appmetadata$spyder 6
  • HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FeatureUsage\AppSwitched spyder.Spyder
    -HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search\JumplistData spyder.Spyder
  • In HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Compatibility Assistant\Store:
    • C:\Users\julio\AppData\Local\spyder-6\envs\spyder-runtime\pythonw.exe
    • C:\Users\julio\AppData\Local\spyder-6\envs\spyder-runtime\Scripts\spyder.exe
    • C:\Users\julio\AppData\Local\spyder-6\Uninstall-Spyder.exe

Anyhow, I ended up having the same problem:

  • .cmd start-up script not starting anymore.
  • Double click for .cmd not working either
    (I assume same problem for .bat files too, but I did not check).

This time, I only had to remove the following Windows registry entries to fix the problem:

  • Equipo\HKEY_CLASSES_ROOT.bat\OpenWithProgids\spyder-6.AssocFile.bat
  • Equipo\HKEY_CLASSES_ROOT.cmd\OpenWithProgids\spyder-6.AssocFile.cmd
  • Equipo\HKEY_CLASSES_ROOT\spyder-6.AssocFile.cmd
  • Equipo\HKEY_CLASSES_ROOT\spyder-6.AssocFile.bat

Other entries I mentioned in the issue description were probably caused my interactions with the "Run with" pop-up window.
I took some screenshots in case they help. Sorry, Windows language is Spanish.

When I log in, I get this pop-up window instead of the .cmd startup script running.
2024-08-30_Windows Start-up

When I double-click a .cmd file, I get the same "Run with" pop-up
2024-08-30_Double-click

And I cannot even associate with Windows/System32/cmd.exe manually, because Windows does not allow me to:
2024-08-30 Select System32 cmd exe Msg cmd exe cannot be associated with this type of file

I guess this does not clarify the source of the problem.
Thank you,

@mrclary
Copy link
Contributor

mrclary commented Aug 30, 2024

Thanks @JulioCantarero. We have decided to remove .bat and .cmd extensions from our file type association for now, so hopefully upon 6.0 release this will not be a problem. We will have to investigate this issue to identify the root cause. Unfortunately, I do not have access to Windows 11, so it could be a difference between Windows 10 and 11. In any case, this will likely be an issue with the menuinst package (pinging @jaimergp).

@JulioCantarero, can you test if Spyder is the default application for other file extensions as well, e.g. .txt, or .md (or any listed in the registry)?

@ccordoba12 ccordoba12 modified the milestones: v6.0.0, v6.0.1 Aug 30, 2024
@JulioCantarero
Copy link
Author

JulioCantarero commented Aug 30, 2024

@mrclary I checked the list of default applications associated with file types in the Windows Settings menu, and Spyder 6 appears as the default application for these extensions: .c, .cc, .cl, .cfg, .cxx, .desktop, .diff, .enaml, .f, .f03, .f08, .f2k, .f77, .f90, .f95, .for, .h, .hh, .hpp, .hxx, .ipy, .ipynb, .jl, .m, .nsh, .nsi, .patch, .po, .pro, .properties, .pxd, .pxi, .py, .puw, .pyx, .rst, .scss, .session.
A Spyder icon is shown for these file types in the Windwos File Explorer.

Captura de pantalla 2024-08-30 230405

When I click on a file with most of these extensions (e.g. .py) spyder 6 is launched.
For soe of the extensions above (e.g. hxx), I get the "Open with" pop-up window where Spyder is listed along with other possible applications.
As you can see, neither .md nor .txt is listed above. I guess that Spyder 6 is also associated as default application, but along with others. No icon is shown, and when I double-click a "Open With" screen is opened.
Overall, I think the behaviour with the other file types is as expected.

@mrclary
Copy link
Contributor

mrclary commented Aug 31, 2024

As you can see, neither .md nor .txt is listed above.

That's interesting because both .md and .txt are in the list of file extensions used for file association for menuinst. Nevertheless, we've removed all file extensions except for Python related files in the PR linked above by @ccordoba12. So this shouldn't be a problem for 6.0.0.

@jaimergp
Copy link

@mrclary can you post this to the menuinst repo so I can take a look? Otherwise this will get lost in the oceans of notifications 😬 Thanks! 🙏

@jitseniesen
Copy link
Member

I just installed 6.0.0rc2 in Windows 11 Home and I am seeing the same issue, so it is not an isolated problem. I hardly know Windows so I can't debug by myself, but I am happy to try out things.

@ccordoba12
Copy link
Member

@jitseniesen, this should be fixed in Spyder 6.0 final because we only left Python extensions associated to Spyder.

@mrclary
Copy link
Contributor

mrclary commented Sep 5, 2024

@JulioCantarero @jaimergp, I've opened this issue in the menuinst repo: conda/menuinst#251. We can take further discussion there but I'll close this issue after conda/menuinst#251 is resolved.

@ccordoba12 ccordoba12 removed this from the v6.0.1 milestone Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants
@ccordoba12 @jaimergp @jitseniesen @mrclary @JulioCantarero @dalthviz and others