Skip to content

Commit

Permalink
Win installer: Small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
brad-anderson committed Mar 14, 2014
1 parent e7c709a commit 2e9c21d
Showing 1 changed file with 40 additions and 14 deletions.
54 changes: 40 additions & 14 deletions windows/dinstaller.nsi
Expand Up @@ -9,6 +9,14 @@
; Defines
;--------------------------------------------------------

; Installer Type
; --------------

; Download zip from website. Comment out to embed zip instead (be sure to set
; paths below).
!define Download


; Versions
; --------

Expand All @@ -24,40 +32,46 @@
!define Version2ReleaseYear "2014" ; S3 file hosting includes the year in the URL so update this as needed


; D1
!define Version1 "1.076"
!define Version1ReleaseYear "2013" ; S3 file hosting includes the year in the URL so update this as needed


; DMC
!define VersionDMC "857"

!define VersionCurl "7.34.0"

; Extras
!define VersionCurl "7.34.0"
!define VersionVisualD "0.3.37"



; URLS
; ----

!define BaseURL "http://downloads.dlang.org"
!define BaseURLAlt "http://ftp.digitalmars.com"
!define VisualDBaseURL "https://github.com/D-Programming-Language/visuald/releases/download"



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

; If Download, the urls of the dmd.zip and dmc.zip
; The URLs to the release zips (used when Download is defined)
!define DownloadDmd1ZipUrl "${BaseURL}/releases/${Version1ReleaseYear}/dmd.${Version1}.zip"
!define DownloadDmd2ZipUrl "${BaseURL}/releases/${Version2ReleaseYear}/dmd.${Version2}.zip"
!define DownloadDmd2ZipUrlAlt "${BaseURLAlt}/dmd.${Version2}.zip"
!define DownloadDmcZipUrl "${BaseURL}/other/dm${VersionDMC}c.zip"
!define DownloadCurlZipUrl "${BaseURL}/other/libcurl-${VersionCurl}-WinSSL-zlib-x86-x64.zip"
!define DownloadVisualDUrl "${VisualDBaseURL}/v${VersionVisualD}/VisualD-v${VersionVisualD}.exe"

; If not Download, the paths of dmd.zip and dmc.zip
; The paths to the release zips (used when Download isn't defined)
!define DmdZipPath1 "dmd.${Version1}.zip"
!define DmdZipPath2 "dmd.${Version2}.zip"
!define DmcZipPath "dm${VersionDMC}c.zip"
!define CurlZipPath "libcurl-${VersionCurl}-WinSSL-zlib-x86-x64.zip"
!define VisualDPath "VisualD-v${VersionVisualD}.exe"



;--------------------------------------------------------
; Includes
;--------------------------------------------------------
Expand All @@ -66,6 +80,7 @@
!include "EnvVarUpdate.nsh"
!include "ReplaceInFile.nsh"


;--------------------------------------------------------
; General definitions
;--------------------------------------------------------
Expand All @@ -85,6 +100,7 @@ InstallDirRegKey HKCU "Software\D" ""
; This is so no one can corrupt the installer
CRCCheck force


;--------------------------------------------------------
; Interface settings
;--------------------------------------------------------
Expand All @@ -95,15 +111,17 @@ CRCCheck force
!define MUI_ICON "installer-icon.ico"
!define MUI_UNICON "uninstaller-icon.ico"


;--------------------------------------------------------
; Langauge selection dialog settings
; Language selection dialog settings
;--------------------------------------------------------

; Remember the installation language
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!define MUI_LANGDLL_REGISTRY_KEY "Software\D"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"


;--------------------------------------------------------
; Installer pages
;--------------------------------------------------------
Expand All @@ -120,25 +138,23 @@ CRCCheck force
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH


;--------------------------------------------------------
; The languages
;--------------------------------------------------------

!insertmacro MUI_LANGUAGE "English"
;!insertmacro MUI_LANGUAGE "Spanish"

;--------------------------------------------------------
; Reserve files needed by the installation
;--------------------------------------------------------

; Reserve files needed by the installation
!insertmacro MUI_RESERVEFILE_LANGDLL


;--------------------------------------------------------
; Required section: main program files,
; registry entries, etc.
; Sections
;--------------------------------------------------------
;

SectionGroup /e "D2"

Section "-D2" Dmd2Files
Expand Down Expand Up @@ -202,6 +218,7 @@ Section "-D2" Dmd2Files

SectionEnd


Section "cURL support" cURLFiles

; This section is mandatory
Expand All @@ -228,6 +245,7 @@ Section "cURL support" cURLFiles

SectionEnd


Section "Detect MSVC" DetectMSVC
ClearErrors

Expand Down Expand Up @@ -287,6 +305,7 @@ Section "Detect MSVC" DetectMSVC

SectionEnd


Section "Add to PATH" AddD2ToPath

; Add dmd 2 directories to path (for all users)
Expand Down Expand Up @@ -345,6 +364,7 @@ Section /o "-D1" Dmd1Files

SectionEnd


Section /o "Add to PATH" AddD1ToPath

; Add dmd 1 directories to path (for all users)
Expand All @@ -357,6 +377,7 @@ SectionEnd

SectionGroupEnd


SectionGroup "dmc"

Section "-dmc" DmcFiles
Expand Down Expand Up @@ -402,6 +423,7 @@ Section "-dmc" DmcFiles

SectionEnd


Section "Add to PATH" AddDmcToPath

; Add dmc directories to path (for all users)
Expand All @@ -414,6 +436,7 @@ SectionEnd

SectionGroupEnd


Section "Start Menu Shortcuts" StartMenuShortcuts
CreateDirectory "$SMPROGRAMS\D"

Expand Down Expand Up @@ -464,6 +487,7 @@ Section "Visual D" VisualD

SectionEnd


;--------------------------------------------------------
; Installer functions
;--------------------------------------------------------
Expand All @@ -478,6 +502,7 @@ FunctionEnd
; Contains descriptions of components and other stuff
!include dinstaller_descriptions.nsh


;--------------------------------------------------------
; Uninstaller
;--------------------------------------------------------
Expand Down Expand Up @@ -524,6 +549,7 @@ Section "Uninstall"

SectionEnd


;--------------------------------------------------------
; Uninstaller functions
;--------------------------------------------------------
Expand Down

0 comments on commit 2e9c21d

Please sign in to comment.