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

Automatic installation of server binaries #275

Open
7 of 13 tasks
razzmatazz opened this issue Feb 16, 2017 · 14 comments
Open
7 of 13 tasks

Automatic installation of server binaries #275

razzmatazz opened this issue Feb 16, 2017 · 14 comments

Comments

@razzmatazz
Copy link
Contributor

razzmatazz commented Feb 16, 2017

At least VS Code and Atom do this.

The code isn't pretty but its here https://github.com/OmniSharp/omnisharp-node-client/blob/0fa4cfbff6782420057ef731fbf4311fc376061e/lib/helpers/runtime.ts

TODO list:

@razzmatazz razzmatazz changed the title Automatic installation of server Automatic installation of server binaries Feb 16, 2017
@mikavilpas
Copy link
Contributor

Definitely 👍
Installation has always been a pain in the ass.

@mikavilpas
Copy link
Contributor

Just a thought: we basically do some kind of installation already, I mean for our travis build. I wonder if we could port that logic to elisp, and then the travis build could work basically the same way. But then we'd have the benefit of having an automatic installation as well.

And it would continuously get tested too, which is a huge thing!

razzmatazz added a commit to razzmatazz/omnisharp-emacs that referenced this issue Jul 2, 2017
This is an experimental code to ease server installation on macOS and Linux
platforms. Windows will come later (and there shouldn't that many changes to
support Windows).

Related github issue: OmniSharp#275
@razzmatazz
Copy link
Contributor Author

Partially implemented, works on macOS (for me). Should be OK for Linux too. Needs little work on Windows.

Didn't apear to be THAT hard to implement as I feared, actually.

@razzmatazz
Copy link
Contributor Author

razzmatazz commented Jul 2, 2017

And yes, we should do the same thing on travis build. Definitely next on the list (with Windows implementation) @sp3ctum

@razzmatazz
Copy link
Contributor Author

Actually extracting a zip on emacs/windows installation appears to be problematic, unless you expect the user to download and extract unzip.exe to a known location... I'd wish to implement something that would work automatically, w/o any involvement of a user, even on Windows....

@razzmatazz
Copy link
Contributor Author

razzmatazz commented Jul 15, 2017

really don't want to write a pkzip parser in elisp, unless thats the last resort..

@mikavilpas
Copy link
Contributor

mikavilpas commented Jul 15, 2017 via email

@razzmatazz
Copy link
Contributor Author

razzmatazz commented Jul 15, 2017

@sp3ctum yes, I think it would, but I was a little bit worried that:

  • I couldn't find naked unzip.exe on the net over HTTPS (yet);
    • some sites do allow to download unzip.exe, but only inside a .zip, which kind induces a chicken-n-egg problem for us :)
  • downloading an executable over the internet from third party site injects untrusted executable from an untrusted site into user's machine..
    • granted, we download omnisharp.exe inside omnisharp-roslyn-x86.zip but this is the part we can trust somewhat..
  • a binary on a third-party url could go away any time, it is outside our control, thus we'd get broken functionality;
  • licensing could be problem—not sure if we can download and use those .exes w/o breaking any license for them;

In other words, I am slight worried because of security implications..

@razzmatazz
Copy link
Contributor Author

razzmatazz commented Jul 15, 2017

I think we could:

  • find some unzip.exe, maybe from gnu win32 tools page and
  • host it on github releases page on our site..

this would be over https and I think GPL allows for downloading the binaries over the net and using those w/o doing any kind of linking with the app (emacs).. and emacs is in GPL, so .. don't know..

@k-ode
Copy link
Contributor

k-ode commented Jul 16, 2017

Windows has a decent shell in Powershell (which is included by default). If it would be acceptable to only support Powershell version 5 and up, you could simply run powershell -command "Expand-Archive c:\a.zip -DestinationPath c:\a".

The powershell version can be checked by running:

(substring 
    (shell-command-to-string "powershell -command \"(Get-Host).Version.Major\"")
   0 -1)

If the the user has a version below the threshold, simply display a message that they need to extract the zip file themselves.

There are other ways to extract zip files in powershell using .NET, but checking the installed .NET version could be more trouble than it's worth.

@razzmatazz
Copy link
Contributor Author

razzmatazz commented Jul 16, 2017

@kimgronqvist thanks! I think using powershell will be something that will work here; also, I found a way not to require powershell v5, by using powershell script that references system.io.compression.fs directly:

will try to implement this now

@k-ode
Copy link
Contributor

k-ode commented Jul 17, 2017

Nice! I think it would also be worthwhile to run (executable-find "unzip") first, since this will be installed on some Windows systems that use Emacs.

Some users will have unzip in their path when installing Git for Windows (which includes msys2), and some will have installed msys2 manually since many Emacs commands depends on tools like find, grep, and diff.

@razzmatazz
Copy link
Contributor Author

@kimgronqvist another good idea!

@mikavilpas
Copy link
Contributor

mikavilpas commented Jul 18, 2017 via email

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

3 participants