-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Symlinks are not created for portable installations #3498
Comments
Symlinks are only created when the command is run from an admin shell or when developer mode is enabled in Windows.
This is a known bug that's being tracked in #3437 The workaround to your issue is to uninstall the current installation and install from an admin shell / turn developer mode on in Windows that'll create a symlink with the correct alias. |
Sorry, I closed this one to early. My expectation would be that the link directory is added to path and a link to the extracted file is created rather than the extracted file to be renamed. Or do I misunderstand something? |
That's exactly what happens in symlinked installations (i.e., admin shell / developer mode). The extracted file isn't renamed but the symlink created in the Links directory is renamed to match whatever is written in the |
Ok, I understand, but then my question is, why the actual install location is added to the path. Wouldn't it be better to reduce the additions to path to the necessary minimum? |
Creating symlink requires admin privileges and if the installation is from a user shell (unelevated, non-admin), then WinGet has no other choice but to resort to installing a package in the Packages directory and putting the entire location in the PATH variable for the command to be accessible in the shell. There may be other solutions to this but WinGet's current implementation of installing portables is roughly:
|
Excuse my ignorance, I'm just more used to linux with links being no big deal. Thank you for explaining it to me and thanks for your very fast response! Just a suggestion. In the absence of an actual fix, it would be quite helpful, if the output was a bit more verbose. E.g. by saying that it failed to create the symlink rather than suggesting that everything went fine and that you can use the command |
Looking at #2368 where this feature of supporting installing portables in user shells was added (previously one could only install in admin shell), I don't see any discussions around the point you mentioned. I am not sure if you can classify this as "absence of an actual fix" or the "intended behavior" when you installing from user shells (non-developer mode). Might be a good idea to raise a new issue for this request. Coming back to the original issue you had, I guess we can safely mark this as duplicate of #3437 if you don't have any reservations? |
Brief description of your issue
When installing a portable app, the executable is correctly extracted and stored into the correct location, but the symlink referenced in the respective sqlite DB is not created.
IMPORTANT: the chosen example is restic, but it is not limited to this tool. A different example would be VirusTotal.YARA
Steps to reproduce
Using the example of restic:
winget install restic
Expected behavior
C:\Users\<USER>\AppData\Local\Microsoft\WinGet\Links\restic.exe
is created pointing to the installed file is createdC:\Users\<USER>\AppData\Local\Microsoft\WinGet\Links\
is added to the usersPATH
It is possible to start the tool using
restic
Actual behavior
<portablePackageUserRoot>\restic.restic_Microsoft.Winget.Source_8wekyb3d8bbwe
is added to the usersPATH
This makes the tool not available under the alias
restic
, but onlyrestic_0.15.2_windows_amd64
which is the executable stored to diskEnvironment
The text was updated successfully, but these errors were encountered: