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

menuinst sets shortcut as default application for .cmd and .bat files on Windows 11 #251

Open
2 tasks done
mrclary opened this issue Sep 5, 2024 · 0 comments
Open
2 tasks done
Labels
type::bug describes erroneous operation, use severity::* to classify the type

Comments

@mrclary
Copy link

mrclary commented Sep 5, 2024

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

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.

See spyder-ide/spyder#22389

@jaimergp, this issue was originally posted by @JulioCantarero and confirmed by @jitseniesen.

When setting file type association, it seems that on Windows 11 the registry is set to make Spyder the default application as well, instead of just an allowed/recommended application.

We are using menuinst = 2.1.2 and do not see this issue on Windows 10. Below is our json file.

spyder-menu.json

{
    "$schema": "https://json-schema.org/draft-07/schema",
    "$id": "https://schemas.conda.io/menuinst-1.schema.json",
    "menu_name": "{{ DISTRIBUTION_NAME }} spyder",
    "menu_items": [
        {
            "name": {
                "target_environment_is_base": "Spyder __PKG_MAJOR_VER__ ({{ DISTRIBUTION_NAME }})",
                "target_environment_is_not_base": "Spyder __PKG_MAJOR_VER__ ({{ ENV_NAME }})"
            },
            "description": "Scientific PYthon Development EnviRonment",
            "icon": "{{ MENU_DIR }}/spyder.{{ ICON_EXT }}",
            "activate": false,
            "terminal": false,
            "command": [""],
            "platforms": {
                "win": {
                    "desktop": true,
                    "app_user_model_id": "spyder.Spyder",
                    "command": ["{{ PREFIX }}/Scripts/spyder.exe", "%*"],
                    "file_extensions": [
                        ".bat",
                        ".c",
                        ".cc",
                        ".cfg",
                        ".cl",
                        ".cmd",
                        ".cpp",
                        ".css",
                        ".cxx",
                        ".desktop",
                        ".diff",
                        ".enaml",
                        ".f",
                        ".f03",
                        ".f08",
                        ".f2k",
                        ".f77",
                        ".f90",
                        ".f95",
                        ".for",
                        ".h",
                        ".hh",
                        ".hpp",
                        ".htm",
                        ".html",
                        ".hxx",
                        ".inf",
                        ".ini",
                        ".ipy",
                        ".ipynb",
                        ".jl",
                        ".js",
                        ".json",
                        ".m",
                        ".md",
                        ".nsh",
                        ".nsi",
                        ".patch",
                        ".po",
                        ".pot",
                        ".pro",
                        ".properties",
                        ".pxd",
                        ".pxi",
                        ".py",
                        ".pyw",
                        ".pyx",
                        ".reg",
                        ".rej",
                        ".rst",
                        ".scss",
                        ".session",
                        ".txt",
                        ".xml",
                        ".yaml",
                        ".yml"
                    ]
                },
                "linux": {
                    "Categories": [
                        "Development",
                        "Science"
                    ],
                    "command": ["{{ PREFIX }}/bin/spyder", "%F"],
                    "StartupWMClass": "Spyder",
                    "MimeType": [
                        "text/x-python",
                        "text/plain",
                        "text/html",
                        "text/xml",
                        "text/x-c",
                        "text/x-perl"
                    ]
                },
                "osx": {
                    "precommand": "pushd \"$(dirname \"$0\")\" &>/dev/null",
                    "command": ["./python", "{{ PREFIX }}/bin/spyder", "$@"],
                    "link_in_bundle": {
                        "{{ PREFIX }}/bin/python": "{{ MENU_ITEM_LOCATION }}/Contents/MacOS/python"
                    },
                    "CFBundleName": "Spyder __PKG_MAJOR_VER__",
                    "CFBundleIdentifier": "org.spyder-ide.Spyder",
                    "CFBundleVersion": "__PKG_VERSION__",
                    "CFBundleDocumentTypes": [
                        {
                            "CFBundleTypeName": "text document",
                            "CFBundleTypeRole": "Editor",
                            "LSHandlerRank": "Default",
                            "CFBundleTypeIconFile": "spyder.icns",
                            "LSItemContentTypes": [
                                "com.apple.applescript.text",
                                "com.apple.ascii-property-list",
                                "com.apple.audio-unit-preset",
                                "com.apple.binary-property-list",
                                "com.apple.configprofile",
                                "com.apple.crashreport",
                                "com.apple.dashcode.css",
                                "com.apple.dashcode.javascript",
                                "com.apple.dashcode.json",
                                "com.apple.dashcode.manifest",
                                "com.apple.dt.document.ascii-property-list",
                                "com.apple.dt.document.script-suite-property-list",
                                "com.apple.dt.document.script-terminology-property-list",
                                "com.apple.property-list",
                                "com.apple.rez-source",
                                "com.apple.scripting-definition",
                                "com.apple.structured-text",
                                "com.apple.traditional-mac-plain-text",
                                "com.apple.xcode.ada-source",
                                "com.apple.xcode.apinotes",
                                "com.apple.xcode.bash-script",
                                "com.apple.xcode.configsettings",
                                "com.apple.xcode.csh-script",
                                "com.apple.xcode.entitlements-property-list",
                                "com.apple.xcode.fortran-source",
                                "com.apple.xcode.glsl-source",
                                "com.apple.xcode.ksh-script",
                                "com.apple.xcode.lex-source",
                                "com.apple.xcode.make-script",
                                "com.apple.xcode.mig-source",
                                "com.apple.xcode.pascal-source",
                                "com.apple.xcode.strings-text",
                                "com.apple.xcode.tcsh-script",
                                "com.apple.xcode.yacc-source",
                                "com.apple.xcode.zsh-script",
                                "com.apple.xml-property-list",
                                "com.netscape.javascript-source",
                                "com.scenarist.closed-caption",
                                "com.sun.java-source",
                                "com.sun.java-web-start",
                                "net.daringfireball.markdown",
                                "org.khronos.glsl-source",
                                "org.oasis-open.xliff",
                                "public.ada-source",
                                "public.assembly-source",
                                "public.bash-script",
                                "public.c-header",
                                "public.c-plus-plus-header",
                                "public.c-plus-plus-source",
                                "public.c-source",
                                "public.case-insensitive-text",
                                "public.comma-separated-values-text",
                                "public.csh-script",
                                "public.css",
                                "public.delimited-values-text",
                                "public.dylan-source",
                                "public.filename-extension",
                                "public.fortran-77-source",
                                "public.fortran-90-source",
                                "public.fortran-95-source",
                                "public.fortran-source",
                                "public.html",
                                "public.json",
                                "public.ksh-script",
                                "public.lex-source",
                                "public.log",
                                "public.m3u-playlist",
                                "public.make-source",
                                "public.mig-source",
                                "public.mime-type",
                                "public.module-map",
                                "public.nasm-assembly-source",
                                "public.objective-c-plus-plus-source",
                                "public.objective-c-source",
                                "public.opencl-source",
                                "public.pascal-source",
                                "public.patch-file",
                                "public.perl-script",
                                "public.php-script",
                                "public.plain-text",
                                "public.python-script",
                                "public.rss",
                                "public.ruby-script",
                                "public.script",
                                "public.shell-script",
                                "public.source-code",
                                "public.tcsh-script",
                                "public.text",
                                "public.utf16-external-plain-text",
                                "public.utf16-plain-text",
                                "public.utf8-plain-text",
                                "public.utf8-tab-separated-values-text",
                                "public.xhtml",
                                "public.xml",
                                "public.yacc-source",
                                "public.yaml",
                                "public.zsh-script"
                            ]
                        }
                    ]
                }
            }
        }
    ]
}

Conda Info

No response

Conda Config

No response

Conda list

No response

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::bug describes erroneous operation, use severity::* to classify the type
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant