Skip to content

Winget (and MSI) installer updates PATH but does not tell user to restart their shell #2208

Open
@phil-blain

Description

@phil-blain

Summary of the new feature / enhancement

As a user, I like that winget install Microsoft.OpenSSH.Beta updates PATH to include the just-installed binaries (which is done since PowerShell/openssh-portable#622), but it would be even better if the installation procedure showed a message saying one must restart their shell/terminal for the new binaries to be available.

Right now this is the output I get (pardon my French):

PS C:\Users\me\Downloads> winget install Microsoft.OpenSSH.Beta
Trouvé OpenSSH Beta [Microsoft.OpenSSH.Beta] Version 9.5.0.0
La licence dutilisation de cette application vous est octroyée par son propriétaire.
Microsoft nest pas responsable des paquets tiers et naccorde pas de licences à ceux-ci.
Téléchargement en cours https://github.com/PowerShell/Win32-OpenSSH/releases/download/v9.5.0.0p1-Beta/OpenSSH-Win64-v9.5.0.0.msi
  ██████████████████████████████  5.47 MB / 5.47 MB
Le code de hachage de linstallation a été vérifié avec succès
Démarrage du package dinstallation... Merci de patienter.
Installé correctement
PS C:\Users\me\Downloads> gcm -all ssh | format-table -autosize

CommandType Name    Version Source
----------- ----    ------- ------
Application ssh.exe 8.9.1.0 C:\Users\me\AppData\Local\Programs\OpenSSH-Win64\ssh.exe
Application ssh.exe 8.1.0.1 C:\Windows\System32\OpenSSH\ssh.exe

i.e. PATH is not updated in the current shell so it only finds my previous (user-level) install and the system one, not the newly installed 9.5 version. It showed up correctly once I opened a new tab in Windows Terminal.

Proposed technical implementation details (optional)

The MSI installer should, in my opinion:

  1. Tell the user where it installed the binaries
  2. Tell the user to restart their shell / terminal program for the PATH modification to take effect
  3. The winget install should pass through those messages.

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions