Skip to content
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

[Windows] Investigate creating a lightweight symlink replacement #579

Open
charlespierce opened this issue Oct 19, 2019 · 8 comments
Open

Comments

@charlespierce
Copy link
Contributor

Symlinks in Windows come with a bunch of restrictions and edge-cases that make it hard for Volta to correctly determine the name of the tool that was called. A few of these include:

  • Requiring Developer Mode - Creating symlinks requires elevated permissions if Developer Mode isn't enabled, which is a bad idea in general)
  • Git Bash Oddities - Git Bash on Windows will fully resolve symlinks before calling the executable, so shims don't work because the information about what tool was actually called is lost.

We could possibly solve these problems by creating a small executable that we could actually copy with a new name when creating a shim. This executable would be responsible for determining the command (possible because it's actually an on-disk executable) and then passing control to the full Volta shim while passing information about the tool (possibly using an Environment Variable).

@charlespierce
Copy link
Contributor Author

Alternatively, possibly look into creating the shims with hard links instead of symlinks, which in some quick testing appears to work. This will also probably require setting the Permission setting "WriteAttributes" on the installed shim.exe in the WiX configuration.

@gerred
Copy link

gerred commented Jul 29, 2020

I think I might be seeing this issue when using https://github.com/nushell/nushell on anything going through volta-shim.exe as well, FWIW.

@felipecrs
Copy link
Contributor

For reference, Chocolatey have a shim generator called shimgen, https://github.com/chocolatey/shimgen. It works well for me under any scenario: Git Bash, Powershell, cmd, UNCs.

@chawyehsu
Copy link
Contributor

For reference, Chocolatey have a shim generator called shimgen, https://github.com/chocolatey/shimgen. It works well for me under any scenario: Git Bash, Powershell, cmd, UNCs.

that shimgen is pretty slow and so many choco users complain about it, moreover, it's a closed source software.

@felipecrs
Copy link
Contributor

There is also Scoop's Shim, https://github.com/ScoopInstaller/Shim. Very simple to use.

@felipecrs
Copy link
Contributor

that shimgen is pretty slow and so many choco users complain about it, moreover, it's a closed source software.

Still about shimgen, there is https://github.com/turboBasic/shimPsy.

@chawyehsu
Copy link
Contributor

There is also Scoop's Shim, https://github.com/ScoopInstaller/Shim. Very simple to use.

Well, I'm one of the maintainers of Scoop and I know that. the initial version of Scoop's shim isn't robust. FYI, there are variants available, such as https://github.com/71/scoop-better-shimexe and https://github.com/kiennq/scoop-better-shimexe.

And I always want to see a modern, independent, well-designed implementation of Windows shimming tool.

@eugenesvk
Copy link

There is also a Rust version (from Scoop) https://github.com/zoritle/rshim, which Rust Volta might like better :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants