-
Notifications
You must be signed in to change notification settings - Fork 822
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
Obscure launching method #2348
Comments
The target for the icon on my Start Menu shows |
@mintty - I believe he's talking about the tiles that get installed when you install a WSL distro from the store. |
Actually I did not even know where bash.exe was situated - now I know thanks to fjsuarez. :) I think that mintty has one additional point; when not only ubuntu is available but, say, opensuse, and perhaps even more, then people may be a bit confused as to what is installed where. E .g. what is linked at /mnt/c - and what about other distributions, what do they install and so forth. Good documentation would be very helpful here but I am sure that once features/functionality work as designed, documentation will also be provided. |
|
Actually, the installed distros are listed per user in the registry under |
Can't you just use |
I read somewhere, probably a comment on the blog post announcing the new store versions that bash.exe will continue to work launching any of the store distros. Also the long cryptic paths are a result of the store. |
Maybe. But if there are (in future) multiple distros installed, how would I tell bash.exe which to use? |
Use the new wslconfig command. Scott Hanselman has a blog post about it all. https://www.hanselman.com/blog/UbuntuNowInTheWindowsStoreUpdatesToLinuxOnWindows10AndImportantTips.aspx |
@mintty Here:
It appears to be a symlink or junction to the actual executable. It's not showing up as a link for some reason, but that's how the magic happens. The actual kind of link they're using here is a complete mystery to me haha. It has size 0 but isn't showing up as junction or symlink. |
@leojbgiusti / |
@fpqc: |
@benhillis Do you have any idea what kind of mysterious symlink (or something else) that is in the |
@fpqc - it's an execution alias: https://docs.microsoft.com/en-us/windows/uwp/porting/desktop-to-uwp-extensions |
Ah thanks! Is the file itself just an empty ordinary file? |
@fpqc - they are implemented as custom reparse points. https://msdn.microsoft.com/en-us/library/windows/desktop/aa365503(v=vs.85).aspx |
Super cool! Are there any plans to extend dir and mklink to be able to use them, because right now they display no information with the usual tools. |
@fpqc - I'm not sure about future plans, since that's not an area my team owns. |
@mintty Yes it does. That directory |
@benhillis Alright maybe I'll ask Rich on Twitter and he'll ping in the right person. |
@fpqc - Yeah Rich (@bitcrazed) would definitely know the right people to get in touch with about execution aliases. The design is pretty new and I'm not sure if it's fully realized yet. |
Yeah, it's newer than I expected, like brand new 16226. Here's their blogpost https://blogs.windows.com/buildingapps/2017/07/05/command-line-activation-universal-windows-apps/ |
I'll just hop on before Rich comes down to my office and pings me manually. Yes, Yes, the distros are registered under the Lxss key. Beware that changing any of these values could corrupt that app's install, but you may want to look at the PackageFamilyName key. |
Thanks, with wslconfig or the Lxss key there are two fairly easy ways. But I'd appreciate if you can tell us how to find the proper icon for each respective distro. |
@zadjii-msft No worries, I think @mintty is trying to have the wsltty installer pick up the distros and launchy mintty and wslbridge for each distro (which is why he cares about the icons). |
@mintty I'm afraid I don't know how to find the icons. There was a console PR a while back that mentioned "Make the console host try using the window title as a search path for the icon." but I don't know how that works exactly, or if it's relevant in this case. I'd look at Sorry I can't be more help. |
https://stackoverflow.com/questions/37417757/extract-icon-from-uwp-application |
Thanks, that sounds like a theoretical solution; however, I don't feel like writing an application and spending hours or days on reverse engineering its problems for such a simple requirement. There should be an MS command-line tool (or maybe 3rd party tool) to simply extract the icon from the exe. |
|
@therealkenc - Even if the applications are moved folders in the app install directory are replaced by reparse points, so in theory the "old" paths will still work. |
@benhillis, is there an option, like in the Legacy distro, to start the WSL shell in a specific directory rather than the WSL home directory? |
@mintty - That would be up to each individual distribution. They are in control of their launcher executable and what arguments it supports. Once you have a distribution installed you can still use bash.exe / wsl.exe to launch it which support the ~ operator. You simply have to set it to your user's default using the wslconfig.exe command line too. Afterwards when you launch bash.exe or wsl.exe it will use whichever distro you specified. |
@mintty by default you should be able to, yes. For example, |
I would certainly prefer a solution without having to tamper with the default setting.
If you mean "I should be", I agree. But it doesn't work. @benhillis, there should be a common approach to this issue. A well-defined interface to run a distribution (and not necessarily the default one) and start in either a selected (or current) or the home directory. |
|
@zadjii-msft - I agree that there should be some common way of dealing with this and hopefully not a very distro specific thing. Also, is there any way we can improve the usage text, specifically |
@zadjii-msft, thanks for the info but it doesn't really help with the use case; who guarantees that each distro will have a |
Both |
@mintty - it looks like the CLI parameters to
So, best I can tell, |
@therealkenc - I'll defer to @zadjii-msft since he owns the distribution launcher code. |
@therealkenc they most certainly are different exe's. I don't know how exactly they differ from one another, but they do set up their initial user differently, so that's something. @mintty There is no guarantee that every distro will have such a param, as the launcher is ultimately under their control. I'd agree that
|
FWIW, it'd be nice if we had a precise description of how the command-line from Here's what I think is going on (as of 10.0.16232.1000):
The
Is the Currently, wslbridge invokes |
@shevegen
😃What makes you so sure of that? Documentation is a completely different animal than designing features. (And docs are typically much easier to write well along the way, rather than waiting until massive changes to a code base are complete.) Features can only work as designed. The tricky part is actually designing them as intended. 😃😃😃 |
@skylize things are likely already partially documented in private docs (that's how ubuntu and suse released as apps on the windows store). The documentation, however, is for a non-public API. Documentation will become available if/when the API becomes public, I assume. I'm not sure that this particular API will be made public. On the other hand, SuSe accidentally released without stripping debug symbols, so a lot of the API has already been reverse-engineered by @RoliSoft Check this post: RoliSoft/WSL-Distribution-Switcher#50 (comment) |
Thanks; actually the registry is a more reliable source (as referring to the actual system deployment). |
I have an idea about how we can make this MUCH easier. Bear with ;) |
I wonder if I could (ab)use that same reparse point for adding aliases for traditional third-party apps? Currently the reparse point seems to contain the package family name and application id, but is there any way around to that? For example I'd like to alias I tried to dig this, but didn't get really far. It seems EDIT: Obviously I tried to just change the exe path stored in the metadata, but that didn't work. |
@ljani You can add |
@Biswa96 If you mean writing a separate wrapper program, then yes, that's what I'm doing now, but it's not perfect (for example, obscure bug with the standard streams and |
Discussion has run its course. Also in recent insider builds a "-d, --distribution" flag was added to wsl.exe to specify a specific distribution to launch. |
Users need to know how WSL is actually invoked, but this is artificially obscured (no target info for Start Menu icons, weird installation redirection).
There needs to be transparent information about the WSL installation that exist on the system (or for the user), and how to invoke each of them, and which icon to use for it.
The text was updated successfully, but these errors were encountered: