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

How to update mintty/wsltty? #20

Closed
gaia opened this issue Jan 9, 2017 · 25 comments
Closed

How to update mintty/wsltty? #20

gaia opened this issue Jan 9, 2017 · 25 comments

Comments

@gaia
Copy link

gaia commented Jan 9, 2017

How do I update mintty, and how do I update wsltty?

If possible, How do I schedule an update check for the two?

@mintty
Copy link
Owner

mintty commented Jan 9, 2017

There is no update check available.
Mintty updates are integrated in wsltty updates, there would be no separate update anyway.

You could build wsltty yourself and update the mintty version in the makefile. Build environment is cygwin (32 bit).

I could perhaps build an "update available" check into the About popup of mintty, if that's desired.

@gaia
Copy link
Author

gaia commented Jan 9, 2017

That would be desirable. For now I have to manually track whether it is updated and re-install the new version, correct?

@mintty
Copy link
Owner

mintty commented Jan 10, 2017

I could check the version against a file from the mintty repository or home page.
But I'd need to retrieve a URL with Windows functions (to avoid proxy configuation if using cygwin functions). It would help if someone provides suitable code using a function like URLOpenStream or HttpOpenRequest.

@mintty
Copy link
Owner

mintty commented Jan 14, 2017

"thumbs up" means you're going to provide such a code sniplet?

@gaia
Copy link
Author

gaia commented Jan 14, 2017

I would if I could - I don't develop for windows. Sorry.

@mintty
Copy link
Owner

mintty commented Jan 24, 2017

Just had the bold idea that somebody could make a Debian package to deploy wsltty. Whether it's possible by the respective package policy to deploy software that is not compiled under Debian, I don't know. Also "somebody" would not be me in this case.

@tkelman
Copy link

tkelman commented Jan 29, 2017

Does Debian have cygwin cross-compilers available? That could conceivably work too, maybe? I've heard that Fedora does or did have cygwin cross-compilers, but haven't tried using them myself. And Fedora doesn't help too much for users of WSL. Someone could make a PPA perhaps, where the policies are a bit less stringent.

@PurplProto
Copy link

PurplProto commented Feb 10, 2017

@mintty Just a thought, if you included a version file, or specified the version in a file with the releases of this, you could then maybe add a shell script to the user's home directory which would simply wget or curl the makefile hosted here and then cat it, grep and regex it, or just regex it for the version number, compare with the current and echo (No) New updates. The user can just run it when they want to check.

Not anything spectacular, but it does the job.

@PurplProto
Copy link

PurplProto commented Feb 10, 2017

Another alternative is to provide another .bat that’s added to the start menu and maybe use something like this to obtain the makefile, then you could use the findstr command (accepts regex too) and use that for comparison?

I wouldn't mind giving your initial idea a go (seems like a simple task), but I only see .bat files here. Was you suggesting to commit it into the wslbridge repository? Though it's not really related to this project, so I don't see how that works... If you mean add the source code here to be made into a binary and deployed with the rest of the project, I could give that ago as well.

Basically, I know what you want to do, but I don't understand how you want to go about doing this. 😄

@mintty
Copy link
Owner

mintty commented Feb 10, 2017

I had thought about bundling wget or curl with wsltty as you suggest, for an instant...
That would be an easy solution if it worked. However, bare the question of library dependencies pulled in, they would not consider the proxy as configured for Windows, and I don't wish to have additional proxy configuration in mintty just for this purpose.

That's why using a Windows API function is a more feasible approach. That won't be really hard, just a little bit tricky because of the quirks of Windows callback APIs, and I didn't feel like doing it myself. Oh, and the call should probably be threaded, not to block mintty.

Something like retrieve_text_from_url(url), returning immediately and when a bit of text (e.g. a line) has been downloaded, send it to wnd via a message (like SendMessage(wnd, WM_SYSCOMMAND, IDM_DOWNLOAD, text)).

@tkelman
Copy link

tkelman commented Feb 11, 2017

writing something in powershell would be simpler

@mintty
Copy link
Owner

mintty commented Feb 11, 2017

Is Powershell always installed by default now?
If it is, and you provide a script, I will integrate it.

@tkelman
Copy link

tkelman commented Feb 11, 2017

since vista, yeah

@mintty
Copy link
Owner

mintty commented Feb 11, 2017

(googled) It seems to be basically simple, even though the simple form (using HtmlWebResponseObject) seems to work only for newer versions of Powershell. Is it possible to make this HtmlWebResponseObject send a message to a window? Anyway, stuffing a file would also work. Yet the thing needs to be invoked, asynchronously, and preferably not popup on the screen. Since I'm not into Powershell, I would appreciate if someone demonstrates that for me.

@tkelman
Copy link

tkelman commented Feb 11, 2017

wsl is a win10 feature, so I think you can rely on fairly recent powershell

not sure about the exact implementation details here myself. whatever invokes powershell to run the script could probably background that task?

@mintty
Copy link
Owner

mintty commented Feb 13, 2017

This one-liner works:
(new-object System.Net.WebClient).DownloadFileAsync("url", "file")
and doesn't need Powershell 3; it seems to need .net, don't know what happens if that's not installed.

The description of the WebClient class suggests it should also be possible to invoke that without starting a Powershell externally, which might save some delay. I would appreciate to use either function DownloadStringAsync(Uri) or DownloadStringAsync(Uri, Object) of that class, but I don't know how to create, initialize and invoke such a class from a C program; also result of the asynchronous call is delivered with some message which would need to be captured, to store the result in some string.

If someone provides a sample implementation along this approach, that would be great.

@PurplProto
Copy link

Sorry I dropped my comms, been busy with my server over the weekend.

I've done a couple of things in C, I'm no genie but I could try an knock something up for you? No guarantee though. I was thinking, if it's going to be done in a language (i.e. C) and built into the application itself, there should be no need for the use of Powershell either as it would be faster to do it natively in the application itself.

I'm a little busy at work right now, but I'll try and get back to you with an example later.

mintty added a commit to mintty/mintty that referenced this issue Feb 20, 2017
mintty added a commit to mintty/mintty that referenced this issue Feb 24, 2017
@mintty
Copy link
Owner

mintty commented Feb 24, 2017

I've implemented an update checker. With some setup tricks, you could try it: compile the current mintty repository version in a Cygwin 32-bit environment, then replace the binaries (possibly also an updated cygwin1.dll) in the wsltty hierarchy.
The update checks every time the Options menu is opened. That may be too often, which could still be tuned. Also I guess I should make the whole procedure optional as some people may not favour unsolicited Internet contact.
Comments welcome.

mintty added a commit to mintty/mintty that referenced this issue Mar 3, 2017
xinhaoyuan pushed a commit to xinhaoyuan/mintty that referenced this issue Mar 6, 2017
xinhaoyuan pushed a commit to xinhaoyuan/mintty that referenced this issue Mar 6, 2017
xinhaoyuan pushed a commit to xinhaoyuan/mintty that referenced this issue Mar 6, 2017
@mintty
Copy link
Owner

mintty commented Mar 11, 2017

Released with 0.7.5 (referring to mintty version, now 2.7.5).

silverwind pushed a commit to silverwind/mintty that referenced this issue Jun 23, 2017
silverwind pushed a commit to silverwind/mintty that referenced this issue Jun 23, 2017
silverwind pushed a commit to silverwind/mintty that referenced this issue Jun 23, 2017
@ADTC
Copy link

ADTC commented Sep 27, 2017

I'm seeing the update notification in the title bar. How do I update though? There is no binary installer to download.

mintty-update

I'm on 2.7.7

@mintty
Copy link
Owner

mintty commented Sep 27, 2017

You would download the latest release installer of wsltty and simply install it over your current version.

@mintty
Copy link
Owner

mintty commented Oct 10, 2017

The next release shall refer to the wsltty version rather than the mintty version.

@mintty
Copy link
Owner

mintty commented Oct 23, 2017

Released 1.8.0.

@mintty mintty closed this as completed Oct 23, 2017
@tweakimp
Copy link

tweakimp commented Jul 6, 2018

Can you make the update notification clickable so that it leads you to the download site? :)

@mintty
Copy link
Owner

mintty commented Jul 6, 2018

It's not easy to capture such a click. Maybe the WM_NCHITTEST message in windialog.c would work. But it's not possible to limit handling to exact position of the hint text, so any click on the top border would trigger the link opening.

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

No branches or pull requests

6 participants