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

Add section to download cURL in Windows installer #7

Merged
merged 2 commits into from Mar 30, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 30 additions & 1 deletion windows/dinstaller.nsi
Expand Up @@ -5,19 +5,22 @@
; Version ; Version
;!define Version1 "1.046" ;!define Version1 "1.046"
;!define Version2 "2.031" ;!define Version2 "2.031"
!define VersionCurl "7.24.0"


; Download zip from website, or include the compressed zip? ; Download zip from website, or include the compressed zip?
!define Download !define Download


; If Download, the urls of the dmd.zip and dmc.zip ; If Download, the urls of the dmd.zip and dmc.zip
!define DownloadDmd1ZipUrl "http://ftp.digitalmars.com/dmd.${Version1}.zip" !define DownloadDmd1ZipUrl "http://ftp.digitalmars.com/dmd.${Version1}.zip"
!define DownloadDmd2ZipUrl "http://ftp.digitalmars.com/dmd.${Version2}.zip" !define DownloadDmd2ZipUrl "https://github.com/downloads/D-Programming-Language/dmd/dmd.${Version2}.zip"
!define DownloadDmcZipUrl "http://ftp.digitalmars.com/dmc.zip" !define DownloadDmcZipUrl "http://ftp.digitalmars.com/dmc.zip"
!define DownloadCurlZipUrl "https://github.com/downloads/D-Programming-Language/dmd/curl-${VersionCurl}-dmd-win32.zip" ;"http://ftp.digitalmars.com/dmc.zip"


; If not Download, the paths of dmd.zip and dmc.zip ; If not Download, the paths of dmd.zip and dmc.zip
!define DmdZipPath1 "dmd.${Version1}.zip" !define DmdZipPath1 "dmd.${Version1}.zip"
!define DmdZipPath2 "dmd.${Version2}.zip" !define DmdZipPath2 "dmd.${Version2}.zip"
!define DmcZipPath "dmc.zip" !define DmcZipPath "dmc.zip"
!define CurlZipPath "curl-${VersionCurl}-dmd-win32.zip"


;-------------------------------------------------------- ;--------------------------------------------------------
; Includes ; Includes
Expand Down Expand Up @@ -178,6 +181,32 @@ Section "D 2" Dmd2Files


SectionEnd SectionEnd


Section "cURL support for D 2" cURLFiles

; This section is mandatory
;SectionIn RO

SetOutPath $INSTDIR

; Create installation directory
CreateDirectory "$INSTDIR"

!ifdef Download
; Download the zip files
inetc::get /caption "Downloading ${CurlZipPath}..." /popup "" "${DownloadCurlZipUrl}" "$INSTDIR\curl.zip" /end
Pop $0 # return value = exit code, "OK" means OK
!else
FILE "/oname=$INSTDIR\curl.zip" "${CurlZipPath}"
!endif

; Unzip them right there
nsisunz::Unzip "$INSTDIR\curl.zip" "$INSTDIR"

; Delete the zip files
Delete "$INSTDIR\curl.zip"

SectionEnd

Section "dmc" DmcFiles Section "dmc" DmcFiles


; This section is mandatory ; This section is mandatory
Expand Down