-
-
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
Support shims to both console and GUI apps #1606
Comments
would it be possible to add a flag in the json (then in the .shim) indicating that shim.exe should not wait indefinitely? Something like bool fork = bool.Parse(Get("fork", config) ?? "false");
if(fork) {
return 0;
}
else {
WaitForSingleObject(pi.hProcess, INFINITE);
uint exit_code = 0;
GetExitCodeProcess(pi.hProcess, out exit_code);
// Close process and thread handles.
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
return (int)exit_code;
} I'm not sure how one might specify this in the |
A symbolic link would suffice. BTW, why do we need a |
A symbolic link doesn't work, as the exe that is the symlink's target cannot find its related .dlls, as the "exe's directory" is the directory the symlink is in, not where the target lives. |
Windows isn't very friendly about symbolic links, but hard links are more accessible for those who do not have admin rights. However, I think that @rasa is correct about @Congee, I'm not sure I understand the question:
I think the intent of |
Additionally, if you create file assocations or any other reference for an application that is installed via scoop, they would not work anymore if the application gets updated (since the folder name would change within Btw. it appears that icons from the "shim"ed (?) executable also do not work: https://stackoverflow.com/questions/53430845/scoop-installed-git-bash-open-git-bash-here-context-menu |
Ah yes, thank you, just noticed your answer on stackoverflow too :) |
Totally agree. Even more, it is easy to check if the application is console or not even without a flag. |
@excitoon how would this console/GUI check look like? Is that possible? |
@r15ch13 I just made a PR for that. |
As for second part, icon for shim, there are two ways doing it:
|
Can it add a parameter? ex |
Hi |
@yelkarama shimgen of chocolatey is a closed source proprietary software, though they say it's an open source feature in their docs title, kinda funny. You know that Scoop is a personal project of luke, while Chocolatey is a commercial software, though it has community version. The distribution or use of shimgen outside of Chocolatey without permission is prohibited. The shimming system is a critical piece of Scoop/Chocolatey, obviously. Scoop community developers will always be interested in improve the project, but as you know it's still a community maintained project, thus it can take more time. :) |
@yelkarama Link you posted is only a readme and issue list. |
shimgen is closed source proprietary software, while generated shim is under MS-RSL... |
This issue should be fixed in #3998, which was merged into master. To use, type:
or
Eventually, one of those shims (probably kiennq) will be made the default. If this issue is still a problem after trying both solutions above, please reopen this issue. Thanks! |
@spider2048 your changes in #5559 and #5684 don't seem to work on my computer. I switched to the develop branch and tested with both neovide and nvim-qt, both stay attached to the terminal. (I do get the message that a GUI application was detected when installing) |
@SpacewaIker I was able to reproduce your problem only in |
It seems that you're right, it works as expected in powershell and CMD. However it worked fine with nushell and previous versions of neovide... So now I don't know if the issue is with neovide or nushell, since it doesn't seem to come from scoop. |
@SpacewaIker I think the issue is with |
It seems that shims for GUI applications build with go/fyne-framework also open a terminal which needs to stay open. Is this also adressed with this issue? {
"version": "0.2.0",
"url": "https://github.com/Roemer/disk-tree/releases/download/v0.2.0/disk-tree-0.2.0.exe",
"bin": "disk-tree-0.2.0.exe"
} and then |
@Roemer Yes, it is also addressed with this issue. In the current |
Any idea when this might find its way into a release? Been a while since the last release. |
i wonder how the wonderful pipx uses symlinks then? following is a screenshot for the directory used by pipx to store the symlinks of the executables ![]() |
The executables in pipx don't locate any of their resources or DLLs using paths relative to the executable, so the problem referred to doesn't arise. |
Exactly. As another example, gsudo (and possible any .net app) when built for .net framework 4.x fails to load it's .dlls if invoked from a symlink. A special workaround in code fixed that. When I later rebuilt it with .net 7 NativeAOT, the workaround was no longer needed. |
so, can this be considered as lack of convention in windows applications to resolve the paths to destination (assuming that it is possible to resolve in the first place). as from my surfacial knowledge, in linux the executables are moved to the |
Not really. My understanding is that in Linux, shared libraries and resources are typically located in fixed absolute locations. So executables can be run from anywhere, but shared libraries and resources can't be safely moved. Conversely, in Windows the common practice is to store all application DLLs and resources in the application directory. This means you can move the application as a whole, but can't move components relative to each other. The semantics of a symlink make it equivalent to moving the executable to another place. As the above demonstrates, this works for typical Linux applications, but doesn't work for typical Windows applications. Applications can be written in such a way that this isn't an issue in practice (pipx shims hard-code the absolute path to the Python interpreter that gets run, but everything else in the app is relative to that, so you can move or symlink the shim, but not any other part of the app). But in general symlinking an application exe is less likely to work on Windows than Linux, because of the different conventions. |
This comment was marked as resolved.
This comment was marked as resolved.
For anyone playing at home who can't wait for a new release, you can access the new shim from https://github.com/ScoopInstaller/Scoop/tree/develop/supporting/shims/kiennq |
5153d73 seems to break this for me ❯ streamlink
❯ & (scoop which streamlink)
usage: streamlink [OPTIONS] <URL> [STREAM]
Use -h/--help to see the available options or read the manual at https://streamlink.github.io manifests reproduced/tested on |
I was able to run scoop config shim scoopcs
scoop reset streamlink and $ streamlink
usage: streamlink [OPTIONS] <URL> [STREAM]
Use -h/--help to see the available options or read the manual at https://streamlink.github.io And now that #5721 is merged, we can use the Ideally, we can make a switch from Edit: It seems that |
I understand that the old shimgen can be used, but that's not really a solution, isn't the old shimgen slower anyway, the C(++) one should just be fixed. |
How slow is the old shim? I don't really see much differences in their launch times. It's not part of my hot path, anyway. |
When using any tools, like
sysinternals
for example, an empty command window (the shim) is open, and has to be manually closed.The ideal way would be that the shim itself be a "win32" app. Currently all shims are console programs. i.e, not linked as "win32" apps for gui mode.
EDIT:
Suggestion, allow for properties in the manifest to configure which binaries are gui shims, and which should be commandline shims, and use shims accordingly.
The text was updated successfully, but these errors were encountered: