winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

Support portable packages in user mode without Developer Mode enabled

Open denelon opened this issue 3 years ago • 3 comments

Description of the new feature / enhancement

During testing for installing portable packages in user mode with Developer Mode disabled, we identified an error:

  • #2364

Users will be prompted for administrator mode to install portable packages if Developer Mode is disabled.

Reference: https://docs.microsoft.com/windows/win32/api/winbase/nf-winbase-createsymboliclinkw

Proposed technical implementation details

A solution for installing portable packages in user mode without requiring Developer Mode to be enabled.

denelon avatar Jul 25 '22 22:07 denelon

Hardlinks and NTFS Junctions (for folders) don't require administrator rights (at least, they don't seem to based on my reading of the docs for mklink): https://docs.microsoft.com/en-us/windows/win32/fileio/hard-links-and-junctions

It probably changes a lot of the portable app implementation, but wouldn't that be better to do now before people have a bunch of apps installed with symlinks that winget would have to migrate? The only functional difference I note is that hardlinks can't link to a different partition, but are we planning to support that for portable apps anyway?

jedieaston avatar Jul 27 '22 13:07 jedieaston

I could see that potentially being a problem when we support installing to different locations.

denelon avatar Jul 28 '22 23:07 denelon

It probably changes a lot of the portable app implementation, but wouldn't that be better to do now before people have a bunch of apps installed with symlinks that winget would have to migrate? The only functional difference I note is that hardlinks can't link to a different partition, but are we planning to support that for portable apps anyway?

We already support that; one can provide the install location for portables.

Hard links also won't work for archive portables that potentially need to be colocated with their satellite files, the hard link would execute at the "links" directory, not the package one.

I'm not sure that there is enough value to having a 3rd strategy that supports only standalone portables on the same volume.

JohnMcPMS avatar Jul 28 '22 23:07 JohnMcPMS

Despite the PR supposedly fixing it, this issue still exists. Trying to install a portable package without admin or developer mode yields this error image That is despite the fact that according to the merged PR, it should have been fixed to not create a symlink - what's going on with this?

ToothyDev avatar Dec 11 '22 01:12 ToothyDev

In case others don't know, the PR says

This fix first appears in v1.4.3132-preview

aaronliu0130 avatar Jan 03 '23 20:01 aaronliu0130