tauri-apps/tauri

[bug][File Association] "Open with" displays the app description instead of the app name on Windows

Closed this issue · 3 comments

Describe the bug

On Windows, when setting up File Association (NSIS + .msi), the description is used in the "Open With" dialog instead of the product/app name. (should be "Museeks", not "A clean, simple and cross-platform music player" ).

unnamed

(sorry, not possible to take screenshot of context menus in Windows 11, weirdly)

On macOS, works as expected:

unnamed

Reproduction

Not a minimal reproduction, sorry:

git clone https://github.com/martpie/museeks.git
cd museeks
git checkout file-associations-tauri
bun install
bun tauri install
# then install the app from `src-tauri\target\release\bundle`

Expected behavior

It should be using the app name, and not the app description.

Full tauri info output

$ tauri info

[✔] Environment
    - OS: Windows 10.0.22631 x86_64 (X64)
    ✔ WebView2: 128.0.2739.67
    ✔ MSVC:
        - Visual Studio Build Tools 2019
        - Visual Studio Build Tools 2022
    ✔ rustc: 1.81.0 (eeb90cda1 2024-09-04)
    ✔ cargo: 1.81.0 (2dbb1af80 2024-08-20)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 22.8.0
    - pnpm: 9.8.0
    - yarn: 1.22.22
    - npm: 10.8.1
    - bun: 1.1.26

[-] Packages
    - tauri 🦀: 2.0.0-rc.10
    - tauri-build 🦀: 2.0.0-rc.9
    - wry 🦀: 0.43.1
    - tao 🦀: 0.30.0
    - @tauri-apps/api : 2.0.0-rc.4
    - @tauri-apps/cli : 2.0.0-rc.12

[-] Plugins
    - tauri-plugin-single-instance 🦀: 2.0.0-rc.1
    - @tauri-apps/plugin-single-instance : not installed!
    - tauri-plugin-window-state 🦀: 2.0.0-rc.3
    - @tauri-apps/plugin-window-state : not installed!
    - tauri-plugin-fs 🦀: 2.0.0-rc.3
    - @tauri-apps/plugin-fs : not installed!
    - tauri-plugin-os 🦀: 2.0.0-rc.1
    - @tauri-apps/plugin-os : 2.0.0-rc.1
    - tauri-plugin-notification 🦀: 2.0.0-rc.3
    - @tauri-apps/plugin-notification : 2.0.0-rc.1
    - tauri-plugin-shell 🦀: 2.0.0-rc.3
    - @tauri-apps/plugin-shell : 2.0.0-rc.1
    - tauri-plugin-dialog 🦀: 2.0.0-rc.5
    - @tauri-apps/plugin-dialog : 2.0.0-rc.1
    - tauri-plugin-log 🦀: 2.0.0-rc.2
    - @tauri-apps/plugin-log : 2.0.0-rc.1

[-] App
    - build-type: bundle
    - CSP: default-src 'none'; img-src 'self' data:; media-src 'self' asset: https://asset.localhost http://asset.localhost; child-src 'self'; object-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; connect-src ipc: http://ipc.localhost 'self' https://api.github.com; font-src 'self' data:
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - framework: React
    - bundler: Vite


### Stack trace

_No response_

### Additional context

_No response_

Looks like Windows uses the FileDescription exe property for this which we set to shortDescription. Setting it to shortDescription sounds right to me the first thing may be a bit weird but explains why all apps use their app name as a description.

There's also a way to set a FriendlyAppName which i think makes sense to use here (though at least on my system only very few apps use this). I guess this should be the ProductName? Or considering that this is only relevant for this feature (at least we only set the reg entries if file assocs are set) we should probably expose a config for this (like the assoc description) and let it fall back to ProductName.

Do you think this is reasonable (if you understood wtf i was talking about lol)?
cc @amrbashir - same question to you (just want your opinion, not asking you to work on this :P )

I think we should change FileDescription to use productName see related bug #10890.

As for FriendlyAppName, I am fine with a config option for it, and falling back to productName

Ah right, forgot about that one. Good call! I'll open PRs for both of that later today.

Edit: I'd rather wait for the friendly app name until requested. Don't think friendly name != product name is a common use case.