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

Portable installers are not renamed in non-symlinked installations #3437

Open
mdanish-kh opened this issue Jul 14, 2023 · 5 comments
Open

Portable installers are not renamed in non-symlinked installations #3437

mdanish-kh opened this issue Jul 14, 2023 · 5 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Issue-Feature This is a feature request for the Windows Package Manager client. Portable Issue related to portable package

Comments

@mdanish-kh
Copy link
Contributor

mdanish-kh commented Jul 14, 2023

Brief description of your issue

In a non-symlinked installation i.e. installation from a user shell in non-developer mode, WinGet does not rename the portable file to PortableCommandAlias / Commands value from the manifest.

Steps to reproduce

a. #3436 (winget install FiloSottile.mkcert)

b. microsoft/winget-pkgs#111454 (winget install Microsoft.Sysinternals.ProcessExplorer)

c. winget install Microsoft.Sysinternals.TCPView on an x64 machine since the x64 executable is named TCPView64.exe

Expected behavior

The portable file to be renamed allowing user to invoke the application through the specified command in the manifest.

Actual behavior

Portable file isn't renamed and users have to type the full exe name in order to invoke the app.

Environment

Windows Package Manager (Preview) v1.6.1573-preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22621.1992
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.21.1573.0
@mdanish-kh
Copy link
Contributor Author

An edge case may be Microsoft.Sysinternals.ZoomIt which is a ZIP package that contains portables for all 3 arches named as:

ZoomIt.zip/
├─ ZoomIt64.exe
├─ ZoomIt.exe
├─ ZoomIt64a.exe/

In x64 systems, you'd want to use ZoomIt64.exe and rename it to ZoomIt.exe in the Packages Directory, but this rename would cause conflict with the existing portable (supported for a different arch) in the directory. Maybe delete the existing one and force rename changes in this case?

@stephengillie stephengillie added Issue-Bug It either shouldn't be doing this or needs an investigation. Issue-Feature This is a feature request for the Windows Package Manager client. and removed Needs-Triage Issue need to be triaged labels Jul 17, 2023
@Trenly
Copy link
Contributor

Trenly commented Oct 11, 2023

This has been partially addressed with #3439 , which covers when it is a single portable file, or when it the NestedInstallerPath points to a portable at the root of a Zip file. If the portable is inside of a folder in a Zip file, it will not be renamed. More work needs to be done here, but at least some of the cases have been covered

@o-l-a-v
Copy link

o-l-a-v commented Sep 6, 2024

Is my PR hit by this issue, or am I doing something wrong? 🤔

Relevant part of manifest:

  - Architecture: x64
    InstallerUrl: https://github.com/Azure/bicep/releases/download/v0.29.47/bicep-win-x64.exe
    InstallerSha256: 69305478E4CBBB9C9C5D74F146D2877A7211A3512F2F08AF0B172A035443F9E9
    InstallerType: portable
    NestedInstallerFiles:
      - RelativeFilePath: bicep-win-x64.exe
        PortableCommandAlias: bicep

Testing manifest locally works, but the command added to PATH is "bicep-win-x64", not "bicep".

PS > Get-Command bicep | fl

Get-Command: The term 'bicep' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

PS > Get-Command bicep-win-x64 | fl

Name            : bicep-win-x64.exe
CommandType     : Application
Definition      : C:\Users\olav.birkeland\AppData\Local\Microsoft\WinGet\Links\bicep-win-x64.exe
Extension       : .exe
Path            : C:\Users\olav.birkeland\AppData\Local\Microsoft\WinGet\Links\bicep-win-x64.exe
FileVersionInfo : File:             C:\Users\olav.birkeland\AppData\Local\Microsoft\WinGet\Links\bicep-win-x64.exe
                  InternalName:     bicep.dll
                  OriginalFilename: bicep.dll
                  FileVersion:      0.29.47.4906
                  FileDescription:  bicep
                  Product:          bicep
                  ProductVersion:   0.29.47+132ade51bc
                  Debug:            False
                  Patched:          False
                  PreRelease:       False
                  PrivateBuild:     False
                  SpecialBuild:     False
                  Language:         Language Neutral

PS >

WinGet version 1.8.1911.

@Trenly
Copy link
Contributor

Trenly commented Sep 6, 2024

Is my PR hit by this issue, or am I doing something wrong? 🤔

It looks like you’re trying to use NestedInstallerFiles which is only valid on InstallerType: zip. You should remove that section and instead use

Commands:
- bicep

@o-l-a-v
Copy link

o-l-a-v commented Sep 6, 2024

It looks like you’re trying to use NestedInstallerFiles which is only valid on InstallerType: zip. You should remove that section and instead use

Commands:
- bicep

Aha! Sweet, thanks @Trenly, that worked. 🙂

o-l-a-v added a commit to o-l-a-v/microsoft--winget-pkgs that referenced this issue Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Issue-Feature This is a feature request for the Windows Package Manager client. Portable Issue related to portable package
Projects
None yet
Development

No branches or pull requests

4 participants