-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add basic NSIS installer builder for Windows #5378
Conversation
Also building/compressing is slower (~2x?), but I guess that is only a problem for packagers. |
This is great. One related comment. Once we start modifying environoment variables I would strongly encourage using either "large string" NSIS or "unicode" NSIS. The normal NSIS will corrupt e.g. PATH when it is longer than 1024 characters. With large string this limit is pushed to 8096 characters. |
@tknopp thanks, will do. @vtjnash any thoughts? I looked at InnoSetup too, but the command line install seemed to be brittle and I want something that works smoothly in cross-compile for obvious reasons. NSIS seems fine, except for the package size. There are some more options I will play with to see if I can get it closer to what we have right now. FWIW, two people have used a package built with this branch, and said that everything worked fine. |
Hmm, Firefox uses NSIS to create an uncompressed installer, and then compresses it into a 7z sfx. Doesn't seem too hard, so I guess I'll do both and get max compression. |
This will be great for getting the Windows people in my department onto Julia, the current install freaks them out a bit. |
@@ -254,7 +251,7 @@ ifeq ($(OS), WINNT) | |||
mkdir ../$(PREFIX)/Git && \ | |||
7z x PortableGit.7z -o"../$(PREFIX)/Git" ) | |||
cd $(DESTDIR)$(PREFIX)/bin && rm -f llvm* llc.exe lli.exe opt.exe LTO.dll bugpoint.exe macho-dump.exe | |||
./dist-extras/7z a -mx9 -sfx7z.sfx julia-$(JULIA_COMMIT)-$(OS)-$(ARCH).exe julia-$(JULIA_COMMIT) | |||
./dist-extras/nsis/makensis.exe /NOCD /DVersion=$(VERSDIR) /DArch=$(ARCH) /DCommit=$(JULIA_COMMIT) contrib/windows/build-installer.nsi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be written as: $(call spawn,./dist-extras/nsis/makensis.exe)
so that it gets wrapped in a call to wine, if needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks. I wasn't sure about that, but It Worked For Me :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a kernel option. ubuntu turns it on so it just works. others don't
Is it possible to create a hierarchical installer? I'm thinking that we could just bundle the actual msysgit (InnoSetup) installer and offer it as an option during install. (https://code.google.com/p/msysgit/downloads/detail?name=Git-1.8.5.2-preview20131230.exe&can=2&q=) Is it possible to mention somewhere in the installer that the user is practically encouraged to install this anywhere they want, including portable flash drives and home directories without admin privileges? It's probably a good idea to drop in a click-through license too.
this difference is unimportant (I thought the 7z installer was also using a derivative of LZMA). as long as it isn't using zip (which compresses to about 100 MB, IIRC)
It's sad how Window's has taught people that installing software should be complicated, contain dozens of confusing options and break (permanently) if you do anything wrong. Anything less is unprofessional. (Linux isn't always that much better, but at least they seem to be hard at work on it). Please go ahead and merge into master whenever you want. |
Yes, all of those are possible. For now I'll at least add the license click-through so it looks official for Iain. |
Haha, nice. Don't forget to mention the bitcoin miner thread at the bottom of the EULA 👍 |
Why? What are they going to agree to? This seems pointless and annoying. Our installer should have as few steps as possible. |
Another -1 for click-thru license. It would just be a silly extra step. |
👍 less NSIS fussing for me! |
Privileges |
Alternatives: "rights", "You do not need to be an Administrator." (The latter passes the Up-Goer 5 test, except for the jargon word Administrator, which might be good since we're probably not localizing this anytime soon.) |
Why are Administrator privileges not required? If the user has no write access to C:\Program Files\ this will not be true. |
True, that's conditional on selecting an alternate path. |
Not sure how hard this is, but you could make the installer default to |
@simonster well, the related question is whether or not to request elevated privileges at all. By default, it does. That can be disabled - but I don't think it can be made conditional (it's a property of the process). Do we want to allow/encourage system-wide installation? |
If we do want to encourage system wide installation, but allow a fallback if privileges are not available, the message could be something along the lines of "Change the installation location to your home directory if you do not have administrator rights on this machine" |
I think R does something with the installer depending on whether the current user is administrator or not: I don't remember what's the result exactly, but at least it allows installing both to a system directory with admin rights or to the home folder without. |
There is a UAC plugin for NSIS that I think allows privilege elevation on demand. See here for how the Firefox installer uses it. I don't think we should hold up a better installer on this issue, though. The majority of systems only have a single user so I'm not sure the choice is especially important, but for now I'd support installing into |
Thanks for the link. I had looked at that plugin briefly, and it appeared to be difficult to handle both the user- and admin- cases in the same executable. Maybe we can borrow the Firefox code eventually, I certainly don't want to figure all that out from scratch. I was leaning toward the "portable app" style installer for the time being, so I'll merge this soon with a few changes: use Unicode NSIS, and default to |
Please %APPDATA% and %LOCALAPPDATA% are hidden directories. |
There is an option to choose any directory before the installation proceeds. |
Yes, but most people just click yes to what is proposed. |
While it's true that without a Start Menu shortcut it could be difficult to find, |
Well, I don't have a single program installed in %LOCALAPPDATA%, though lots of them leave tons of (hidden) trash there after uninstallling. |
Also vote for standard locations. But I don't see a pressing reason not to install into C:\Program Files. The debs and rpms will also be system wide. Why should this be different here? |
@joa-quim why is the space an issue? |
@tknopp Because if you have address to a full file name that has a space in the name without using quotes you'll get a file or command not found error. |
yes thats an issue. But installing things to C: does not scale well and is non-standard. Lets better put julia into the PATH variable so that it is directly available from the command line. |
This is one of those meaning-of-life questions on Windows. I certainly understand that spaces can be annoying, but we should do the standard thing for the most common use case. People who have a strong opinion about installation location are free to change the directory. Once this is merged then I will probably post a 0.3-pre installer package for people to try out; we can see how that goes, and people can make pull requests for further improvements. |
Applications/libraries that do not support spaces in paths are broken, period. Installing to Program files will be a good thing: it will help detecting and fixing them (if any), instead of bugging people with subtle issues. ;-) |
Are we 32/64 bit aware in our choice of APPDATA directory? |
@vtjnash what is the difference? |
This commit adds NSIS installer support for Julia on Windows. The NSIS installer is built uncompressed, compressed by 7-zip, then combined into a self-extracting archive using the 7zS.sfx module from the 7-zip extras distribution. (Thanks to Firefox for this idea). The default install directory is %LOCALAPPDATA%, but the user is prompted to choose a directory before installation. After installation, the install directory is opened in Windows Explorer.
* use Modern UI option for familiar look, and checkbox options at end * checkbox options (default: checked) - open install folder - create start menu folder w/ shortcut * use icon on the install page Note: the most efficient way to hack on the NSIS file is to make a dummy build folder with a few text files, and run `makensis` directly.
Add basic NSIS installer builder for Windows
I used more NSIS features to make it look nicer, image links below. There is now an option to add Start Menu shortcuts on the final page (default: checked). Hopefully this will sufficiently cover the "can't find my %APPDATA%" use case for the average user who clicks through the defaults. |
A nice little touch would be to customize the SFX to use the nice Julia icon. I have some vague idea how to do this, but haven't tried yet. If somebody knows how or wants to try, please have at it. |
This is such a huge "first date experience" improvement for Windows. Thanks so much for doing it. |
This is interfering with my linux nightly windows builds (ironic that I just managed to get them working a day or two ago!):
It looks to me like NSIS is trying to ask for confirmation for something; can we force it to just go through with the operation? |
Looks like ihnorton fixed that. Although at this point, it seems like the win-extras target (which started as a way for me to document the files I needed to manually download and extract to build binaries) is doing entirely too much as a shell script and not enough as a set of makefile rules. |
The easiest way to add an icon may be to host a private copy of 7zS.sfx with the julia icon already swapped out in any windows resource editor (http://7zsfx.info/en/icon.html) |
@StefanKarpinski the retro terminal is now kind of bemusing. @vtjnash a shell script might be a good idea so that it can be shared with |
This adds a script to build a Windows installer using NSIS, updates Makefile, and removes julia.bat (#4861).
Issues: