Support portable packages in user mode without Developer Mode enabled
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.
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?
I could see that potentially being a problem when we support installing to different locations.
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.
Despite the PR supposedly fixing it, this issue still exists. Trying to install a portable package without admin or developer mode yields this error
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?
In case others don't know, the PR says
This fix first appears in v1.4.3132-preview