-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Can't use scoop apps as a replacement for system apps because of app path #1179
Comments
Only for a subset of apps such as Shims are like symbolic links, but do not require administrator privileges to create. If you're using absolute paths to an app in your work, use the shimmed file, not the path to the app version directory. |
@deevus, shims are good but they may not work well in all possible scenarios.
In other words, I would be interested in some options to deal with such pain points. |
I ran into the issue trying to use bash from Git mingw folder (ConEmu users use this bash version for Git Bash and Docker). |
@nightroman Do you know if using symbolic links to 7zFM.exe or procexp.exe stores the path of the symlink instead of the actual program? If symlinks work, we could look at optionally using those instead of shims (with a config setting) given that Windows seems to be moving towards better symlink support. |
I played a little bit with symbolic links to files instead of shims. I think Another way with directory junctions looks more promising to me.
Then I started both from junctions and did the following:
Then I investigated the stored settings: 7zip command
It looks like success, the junction path is stored. procexp The key
has value Debugger
It looks like success, too, the junction path is stored. Then I tried to rename scoop\apps\7zip\16.04 (junction got broken) and Thus, I would propose to think of a configurable option like this. Related options like adding to path or environment variables in this case should |
Great work! Can we create junctions without elevated prompt?
…On Sat, Dec 31, 2016 at 5:57 PM Roman Kuzmin ***@***.***> wrote:
I played a little bit with symbolic links to files instead of shims. I
think
this may work for some standalone tools (procexp). But it does not work for
others (7zFM) that expect their satellite files in the same locations
(DLLs,
resources, etc). Both procexp and 7zFM started fine from links but 7zFM
failed
to open an archive later.
Another way with directory junctions looks more promising to me.
I created a directory scoop\links and there created two junctions
- 7zip pointing to
C:\Users\rkuzmin\AppData\Local\scoop\apps\7zip\16.04 (note fixed version
name, standard scoop approach)
- SysinternalsSuite pointing to
C:\Users\rkuzmin\AppData\Local\scoop\apps\SysinternalsSuite\current (note
*current*, my trick)
Then I started both from junctions and did the following:
- associated 7zip with archives
- told to use procexp as task manager
Then I investigated the stored settings:
*7zip*
command ftype 7-zip.7z shows
7-zip.7z="C:\Users\rkuzmin\AppData\Local\scoop\links\7zip\7zFM.exe" "%1"
It looks like success, the junction path is stored.
*procexp*
The key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\taskmgr.exe
has value *Debugger*
"C:\USERS\RKUZMIN\APPDATA\LOCAL\SCOOP\LINKS\SYSINTERNALSSUITE\PROCEXP.EXE"
It looks like success, too, the junction path is stored.
Then I tried to rename *scoop\apps\7zip\16.04* (junction got broken) and
recreate the junction with the old name pointing to the new folder.
Archive associations worked just fine after this.
Thus, I would propose to think of a configurable option like this.
For example, as I did, we have a directory *scoop\links* and create there
junctions pointing to the latest installed (as usual) directories of apps.
Related options like adding to path or environment variables in this case
should
point to the junction, indeed. And a user is supposed to start the apps
from
justions, as if they are installed there.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1179 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA0Qgiwmy2bRLxfljCQ7hQywHXKBL01Aks5rNfzQgaJpZM4LYM6o>
.
|
Some quick search tells me that mklink needs elevation. Perhaps this is an inevitable limitation. But the target audience mostly can run scoop elevated, I believe. And scoop may check this on certain operations and fail gracefully. |
Thanks @nightroman. When I tested just now, it seems junctions can be created without admin privileges (using mkdir orig # create the directory to be linked to
echo "testing" > orig/test.txt # write a test file in original directory
cmd /c mklink /j junction orig # create the junction (no powershell equivalent)
type junction/test.txt # outputs contents of the file in original directory
cmd /c rmdir junction # remove the junction, without affecting original directory (no powershell equivalent)
cmd /c rmdir orig # clean up after this test
Also, I like the idea of having a |
This is a good news.
Yes, I also like this. |
Okay, I'm going to try implementing this now. |
…o that path is maintained across app updates (see #1179)
I think it should work now, but it'd be great if anyone interested can try it out and provide feedback. To enable junctions you need to first run: scoop config USE_JUNCTIONS 1 If it doesn't work and you want to disable this, run When a new version of an app is installed, the All paths, shims and environment variables should point to the You should see a message when the junctions are created and removed, e.g.
and
|
It seems to be working fine. That was quick! It's a very nice new year present, thank you very much! |
Great! Thanks for investigating and finding the solution. Happy New Year! |
Works great :) 👍 |
Thanks for your very quick response ;) ! Happy New Year ! |
…y junction to link to the currently installed version (see #1179)
I've made this the default behavior, so there's no need to set |
It would be useful to document this somehow. People not familiar with junctions may be confused. E.g. their apps directories will look twice as big as they are in fact. |
Good point. I've added this page to the wiki. Please let me know if the tone is wrong. And please go ahead and make corrections if it's confusing or missing info. |
Your paths are version dependent, which means every update of the app will break the pathnames.
Solution : have symlinks pointing to latest versions.
The text was updated successfully, but these errors were encountered: