menuinst icon indicating copy to clipboard operation
menuinst copied to clipboard

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

Open mrclary opened this issue 5 months ago • 0 comments

Checklist

  • [X] I added a descriptive title
  • [X] 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

mrclary avatar Sep 05 '24 14:09 mrclary