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

Backport 32054 #32819

Merged
merged 4 commits into from
Aug 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,10 @@ ifeq ($(OS), WINNT)
cd $(BUILDROOT)/julia-$(JULIA_COMMIT) && find * | sed -e 's/\//\\/g' -e 's/$$/\r/g' > etc/uninstall.log

# build nsis package
cd $(BUILDROOT) && $(call spawn,$(JULIAHOME)/dist-extras/nsis/makensis.exe) -NOCD -DVersion=$(JULIA_VERSION) -DArch=$(ARCH) -DCommit=$(JULIA_COMMIT) -DMUI_ICON="$(call cygpath_w,$(JULIAHOME)/contrib/windows/julia.ico)" $(call cygpath_w,$(JULIAHOME)/contrib/windows/build-installer.nsi) | iconv -f latin1
cd $(BUILDROOT) && $(call spawn,$(JULIAHOME)/dist-extras/nsis/makensis.exe) -NOCD -DVersion=$(JULIA_VERSION) -DArch=$(ARCH) -DCommit=$(JULIA_COMMIT) -DJULIAHOME="$(call cygpath_w,$(JULIAHOME))" $(call cygpath_w,$(JULIAHOME)/contrib/windows/build-installer.nsi) | iconv -f latin1

# compress nsis installer and combine with 7zip self-extracting header
cd $(BUILDROOT) && $(JULIAHOME)/dist-extras/7z a -mx9 "julia-install-$(JULIA_COMMIT)-$(ARCH).7z" julia-installer.exe
cd $(BUILDROOT) && $(JULIAHOME)/dist-extras/7z a -mx=9 "julia-install-$(JULIA_COMMIT)-$(ARCH).7z" julia-installer.exe
cd $(BUILDROOT) && cat $(JULIAHOME)/contrib/windows/7zS.sfx $(JULIAHOME)/contrib/windows/7zSFX-config.txt "julia-install-$(JULIA_COMMIT)-$(ARCH).7z" > "$(JULIA_BINARYDIST_FILENAME).exe"
chmod a+x "$(BUILDROOT)/$(JULIA_BINARYDIST_FILENAME).exe"
-rm -f $(BUILDROOT)/julia-install-$(JULIA_COMMIT)-$(ARCH).7z
Expand Down Expand Up @@ -580,11 +580,11 @@ else
$(error no win-extras target for ARCH=$(ARCH))
endif
cd $(JULIAHOME)/dist-extras && \
$(JLDOWNLOAD) http://downloads.sourceforge.net/sevenzip/7z1805-extra.7z && \
$(JLDOWNLOAD) https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/unsis/nsis-2.46.5-Unicode-setup.exe && \
$(JLDOWNLOAD) https://sourceforge.net/projects/nsis/files/NSIS%203/3.04/nsis-3.04-setup.exe && \
$(JLCHECKSUM) nsis-3.04-setup.exe && \
chmod a+x 7z.exe && \
chmod a+x 7z.dll && \
$(call spawn,./7z.exe) x -y -onsis nsis-2.46.5-Unicode-setup.exe && \
$(call spawn,./7z.exe) x -y -onsis nsis-3.04-setup.exe && \
chmod a+x ./nsis/makensis.exe

# various statistics about the build that may interest the user
Expand Down
Binary file modified contrib/windows/7zS.sfx
Binary file not shown.
2 changes: 1 addition & 1 deletion contrib/windows/7zSFX-config.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
;!@Install@!UTF-8!
Title="The Julia Language"
Title="Julia"
RunProgram="julia-installer.exe"
;!@InstallEnd@!
75 changes: 57 additions & 18 deletions contrib/windows/build-installer.nsi
Original file line number Diff line number Diff line change
@@ -1,15 +1,38 @@
Unicode true

!include "MUI2.nsh"
!include "nsDialogs.nsh"
!include "winmessages.nsh"

Name "The Julia Language"
OutFile "julia-installer.exe"
SetCompress off
CRCCheck on
CRCCheck off
SetDataBlockOptimize on
ShowInstDetails show
ShowInstDetails nevershow
ShowUninstDetails nevershow
RequestExecutionLevel user
BrandingText "Julia ${Version}"
BrandingText " "

!define /date YEAR "%Y"

Name "Julia"
VIProductVersion "10.20.0.0" # arbitrary value since it doesn't mater, but is required; format must be X.X.X.X
VIAddVersionKey "ProductName" "Julia"
VIAddVersionKey "CompanyName " "Julia Language"
VIAddVersionKey "ProductVersion" "${Version}"
VIAddVersionKey "FileDescription" "Julia Language Installer"
VIAddVersionKey "Comments" "https://julialang.org/"
VIAddVersionKey "LegalCopyright" "Copyright (c) 2009-${YEAR} Julia Language"
VIAddVersionKey "FileVersion" ""

Caption "Julia Installer" # title bar

!define MUI_ICON "${JULIAHOME}\contrib\windows\julia.ico"
!define MUI_UNICON "${JULIAHOME}\contrib\windows\julia.ico"
!define MUI_WELCOMEFINISHPAGE_BITMAP "${JULIAHOME}\contrib\windows\julia-banner.bmp"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "${JULIAHOME}\contrib\windows\julia-header.bmp"
!define MUI_HEADERIMAGE_RIGHT

# Uninstall settings
!define UninstLog "uninstall.log"
Expand All @@ -29,7 +52,7 @@ FunctionEnd
Function createDesktopLink
${NSD_GetState} $Checkbox $0
${If} $0 <> 0
CreateShortCut "$DESKTOP\julia.lnk" "$INSTDIR\bin\julia.exe"
CreateShortCut "$DESKTOP\julia.lnk" "$INSTDIR\bin\julia.exe" "" "$INSTDIR\bin\julia.exe" 0
${EndIf}
FunctionEnd

Expand All @@ -38,25 +61,43 @@ InstallDir "$LOCALAPPDATA\Julia-${Version}"
!define JuliaStartMenuFolder "Julia ${Version}"

# Page settings
# Note that we repurpose the checkboxes on the FinishPage
# in order to keep it simple.
!define MUI_DIRECTORYPAGE_TEXT_TOP "Julia may be installed in any accessible directory, including a home folder or portable device. Please run as Administrator to install for system-wide use."
# Note that we repurpose the checkboxes on the FinishPage in order to keep it simple.
!define MUI_DIRECTORYPAGE_TEXT_TOP "Julia may be installed in any accessible directory.$\r$\n$\r$\nPlease run installer as Administrator to install Julia system-wide."
!define MUI_FINISHPAGE_SHOWREADME
!define MUI_FINISHPAGE_SHOWREADME_TEXT "Create Start Menu folder and shortcut"
!define MUI_FINISHPAGE_SHOWREADME_FUNCTION AddToStartMenu

!define MUI_WELCOMEPAGE_TITLE "Welcome to Julia ${Version}"
!define MUI_WELCOMEPAGE_TEXT "Setup will guide you through installation.$\r$\n$\r$\nClick Next to continue."
!define MUI_FINISHPAGE_TITLE "Julia installation complete"
!define MUI_FINISHPAGE_TEXT "Julia has been successfully installed.$\r$\n$\r$\nClick Finish to close the installer."

!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_TEXT "Open Julia install folder"
!define MUI_FINISHPAGE_RUN_TEXT "Open the Julia install folder"
!define MUI_FINISHPAGE_RUN_FUNCTION ShowInstallFolder

# Pages to show
!define MUI_UNCONFIRMPAGE_TEXT_TOP "Julia will be uninstalled from the following folder."
!define MUI_UNCONFIRMPAGE_TEXT_LOCATION "Uninstalling from"

# Pages to show
!define MUI_PAGE_HEADER_TEXT "Choose Installation Directory"
!define MUI_PAGE_HEADER_SUBTEXT ""
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
Section
!insertmacro MUI_HEADER_TEXT "Installing" ""
SectionEnd

!define MUI_PAGE_CUSTOMFUNCTION_SHOW desktopCheckbox
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE createDesktopLink
!insertmacro MUI_PAGE_FINISH

!define MUI_PAGE_HEADER_TEXT "Uninstall Julia"
!define MUI_PAGE_HEADER_SUBTEXT ""
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES

!insertmacro MUI_LANGUAGE "English"

# Add/Remove Programs entry
Expand All @@ -65,14 +106,14 @@ InstallDir "$LOCALAPPDATA\Julia-${Version}"
Section "Dummy Section" SecDummy
SetOutPath $INSTDIR
File /a /r "julia-${Commit}\*"
WriteUninstaller "$INSTDIR\Uninstall.exe"
CreateShortcut "$INSTDIR\julia.lnk" "$INSTDIR\bin\julia.exe"
WriteUninstaller "$INSTDIR\uninstall.exe"
CreateShortcut "$INSTDIR\julia.lnk" "$INSTDIR\bin\julia.exe" "" "$INSTDIR\bin\julia.exe" 0

# ARP entries
WriteRegStr HKCU "${ARP}" \
"DisplayName" "Julia Language ${Version}"
"DisplayName" "Julia ${Version}"
WriteRegStr HKCU "${ARP}" \
"Publisher" "The Julia Project"
"Publisher" "Julia Language"
WriteRegStr HKCU "${ARP}" \
"DisplayIcon" "$INSTDIR\bin\julia.exe"
WriteRegStr HKCU "${ARP}" \
Expand Down Expand Up @@ -145,13 +186,11 @@ SectionEnd
# Helper function to create Start Menu folder and shortcuts
Function AddToStartMenu
CreateDirectory "$SMPROGRAMS\${JuliaStartMenuFolder}"
CreateShortcut "$SMPROGRAMS\${JuliaStartMenuFolder}\julia-${Version}.lnk" "$INSTDIR\julia.lnk" "" "" "" "" "" "The Julia Language"
CreateShortcut "$SMPROGRAMS\${JuliaStartMenuFolder}\Uninstall-Julia-${Version}.lnk" "$instdir\Uninstall.exe"
CreateShortcut "$SMPROGRAMS\${JuliaStartMenuFolder}\julia-${Version}.lnk" "$INSTDIR\julia.lnk" "" "" "" "" "" "Julia"
CreateShortcut "$SMPROGRAMS\${JuliaStartMenuFolder}\Uninstall-Julia-${Version}.lnk" "$instdir\uninstall.exe"
FunctionEnd

# Opens the installation folder
Function ShowInstallFolder
ExecShell "open" $INSTDIR
FunctionEnd


23 changes: 23 additions & 0 deletions contrib/windows/icon-readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

Generate the logo
```julia
using Luxor
Drawing(325, 325, joinpath(pwd(), "julia-dots.svg"))
origin()
translate(0, 25)
juliacircles(100)
finish()
```

Create the ico file
```sh
#!/bin/bash

for size in 16 20 24 32 40 48 64 128 256; do
rsvg-convert -w $size -h $size julia-dots.svg -o $size.png
done

convert 256.png 128.png 64.png 48.png 40.png 32.png 24.png 20.png 16.png julia.ico

rm 256.png 128.png 64.png 48.png 40.png 32.png 24.png 20.png 16.png
```
Binary file added contrib/windows/julia-banner.bmp
Binary file not shown.
Binary file added contrib/windows/julia-header.bmp
Binary file not shown.
Binary file modified contrib/windows/julia.ico
100644 → 100755
Binary file not shown.
2 changes: 1 addition & 1 deletion contrib/windows/julia.rc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ BEGIN
VALUE "FileDescription", "Julia Programming Language"
VALUE "FileVersion", JLVER_STR
VALUE "InternalName", "julia"
VALUE "LegalCopyright", "MIT Licensed"
VALUE "LegalCopyright", "(c) 2009-2019 Julia Language"
VALUE "OriginalFilename", "julia.exe"
VALUE "ProductName", "Julia"
VALUE "ProductVersion", JLVER_STR
Expand Down
1 change: 1 addition & 0 deletions deps/checksums/nsis-3.04-setup.exe/md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3c93427c56714478bb5a7a4bbaab934f
1 change: 1 addition & 0 deletions deps/checksums/nsis-3.04-setup.exe/sha512
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
55142f5eeada65f18f6de950ead5342d78e1a4a01b7620d02dae2fbd3f0d963db482f5a63939131e81a78b458c5306f600578ab96891b0661cb0b74be1f7636d