Portable install deletes the executable when PortableCommandAlias differs from the file name only by case
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 79/100
Línea de trabajo
Lee src/AppInstallerCLICore/Workflows/PortableFlow.cpp en las dos comprobaciones de hardlinks y src/AppInstallerCLICore/PortableInstaller.cpp en SetExpectedState. Compara cómo se manejan el nombre del alias y el del ejecutable cuando solo se diferencian por mayúsculas y minúsculas; después, ejecuta las pruebas pertinentes de instalación portable. El trabajo se considera terminado cuando la instalación de un paquete portable con un alias que solo se diferencia por mayúsculas y minúsculas se realiza correctamente y el alias inicia el ejecutable.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Relevant area(s)
WinGet CLI
Relevant command(s)
winget install
Brief description of your issue
Since hardlink aliases arrived in #6308, a zip portable fails to install when PortableCommandAlias matches the nested executable's name except for case. Blinue.Magpie 0.13.0 has RelativeFilePath: Magpie.exe and PortableCommandAlias: magpie (microsoft/winget-pkgs#490991).
PortableFlow.cpp creates a hardlink when commandAlias != originalFilename (line 255, and the same check on line 298 for single-file portables). std::filesystem::path compares case-sensitively, so magpie.exe and Magpie.exe count as different names. On NTFS they are the same file. The install removes the "existing hardlink" magpie.exe, which deletes Magpie.exe, and then create_hard_link and the copy fallback both fail. PortableInstaller::SetExpectedState makes the same comparison (line 595).
The failed install also leaves the package folder behind with only the portable index .db in it.
Steps to reproduce
winget install --source winget --id Blinue.Magpie --exact --scope user
Expected behavior
Magpie installs and magpie starts it.
Actual behavior
copy_file: The system cannot find the file specified.: "...\Blinue.Magpie_Microsoft.Winget.Source_8wekyb3d8bbwe\Magpie.exe", "...\magpie.exe"
Portable install failed; Cleaning up...
From the log:
[CORE] Removing existing portable hardlink at: ...\magpie.exe
[CORE] Creating hardlink at: ...\magpie.exe pointing to: ...\Magpie.exe
[CORE] Hardlink not supported or creation failed: create_hard_link: The system cannot find the file specified.
[CORE] Hardlink creation failed, falling back to copy: ...\magpie.exe
[CLI ] Caught std::exception: copy_file: The system cannot find the file specified.
[CLI ] Terminating context: 0x8a150057 at ...\PortableFlow.cpp:165
The same manifest without the alias installs and runs fine (tested with winget install --manifest), so I sent that as a workaround in microsoft/winget-pkgs#491068. A fix here would be to compare the alias and the file name case-insensitively at all three spots, so a case-only difference skips the hardlink.
Environment
Windows Package Manager v1.30.310
Windows 11 Pro 25H2 (10.0.26200), x64
- Lenguaje dominante
- C++
- Estrellas
- 26.6k
- Forks
- 1.8k
- Merge medio
- 2 d 18 h
- PR fusionados (30 d)
- 42
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/winget-cli
-
Issue-Docs Needs-Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
microsoft/winget-cli#6692 ·
Los mantenedores suelen responder en 2 días
-
Issue-Docs Possible-Duplicate
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
microsoft/winget-cli#6493 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
WinGetSourceCreator: PackWithMappingFile should verify makeappx.exe exists before invoking itAbiertoIssue-Feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
microsoft/winget-cli#6427 ·
Los mantenedores suelen responder en 2 días
-
Issue-Docs msstore
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
microsoft/winget-cli#6331 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Command-Source Issue-Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
microsoft/winget-cli#6148 ·
Los mantenedores suelen responder en 2 días
Todos los issues de microsoft/winget-cli
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
telefonicaid/fiware-orion#4836 ·
Los mantenedores suelen responder en 1 día
-
refactor topic-ui topic-weather
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
leanprover/lean4#16810 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100