forked from winpython/winpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstaller.nsi
More file actions
112 lines (95 loc) · 4.04 KB
/
installer.nsi
File metadata and controls
112 lines (95 loc) · 4.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*
WinPython installer script
Copyright © 2012 Pierre Raybaut, 2016+ WinPython team
Licensed under the terms of the MIT License
(see winpython/__init__.py for details)
*/
;================================================================
; These lines are automatically replaced when creating installer:
; (see winpython/make.py)
!define DISTDIR "D:\Pierre\maketest\winpython-2.7.3.amd64"
!define ARCH "64"
!define VERSION "2.7.3.0"
; 2018-04-04 need to minimize path length of installation further: remove flavor in install path
!define VERSION_INSTALL "2.7.3.0"
!define RELEASELEVEL "beta2" ; empty means final release
;================================================================
!define ID "WinPython"
; 2018-04-20 need to minimize path length of installation:
;!define ID_INSTALL "WinPython"
!define ID_INSTALL "WPy"
!define FILE_DESCRIPTION "${ID} Installer"
!define COMPANY "${ID}"
!define BRANDING "${ID}, the portable Python Distribution for Scientists"
SetCompressor /SOLID LZMA
SetCompressorDictSize 16 ; MB
; Includes
;------------------------------------------------------------------------------
!include "MUI2.nsh"
!include "Sections.nsh"
!include "FileFunc.nsh"
; General
;------------------------------------------------------------------------------
Name "${ID} ${ARCH} ${VERSION}${RELEASELEVEL}"
OutFile "${DISTDIR}\..\${ID}${ARCH}-${VERSION}${RELEASELEVEL}.exe"
; 2018-03-31 need to minimize path length of installation:
;InstallDir "$EXEDIR\${ID}${ARCH}-${VERSION}${RELEASELEVEL}"
; 2018-04-04 need to minimize path length of installation further: remove arch + flavor
;InstallDir "$EXEDIR\${ID_INSTALL}${ARCH}-${VERSION}${RELEASELEVEL}"
;InstallDir "$EXEDIR\${ID_INSTALL}-${VERSION_INSTALL}${RELEASELEVEL}"
; 2018-04-20 need to minimize path length of installation:
;InstallDir "$EXEDIR\${ID_INSTALL}"
; 2018-12-10 keep 64 for 7zip similarity
InstallDir "$EXEDIR\${ID_INSTALL}${ARCH}-${VERSION_INSTALL}${RELEASELEVEL}"
BrandingText "${BRANDING}"
XPStyle on
RequestExecutionLevel user
; Interface Configuration
;------------------------------------------------------------------------------
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "images\banner.bmp"
!define MUI_HEADERIMAGE_UNBITMAP "images\banner.bmp"
!define MUI_ABORTWARNING
!define MUI_ICON "icons\install.ico"
; Pages
;------------------------------------------------------------------------------
!define MUI_WELCOMEFINISHPAGE_BITMAP "images\win.bmp"
!insertmacro MUI_PAGE_LICENSE "license.txt"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_FINISHPAGE_REBOOTLATER_DEFAULT
#!define MUI_FINISHPAGE_RUN "$INSTDIR\${ID}.exe"
!define MUI_FINISHPAGE_LINK "Visit ${ID} official website"
!define MUI_FINISHPAGE_LINK_LOCATION "http://winpython.github.io/"
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
; Installer Sections
;------------------------------------------------------------------------------
Section "" SecWinPython
SectionIn RO
SetOutPath "$INSTDIR"
File /r "${DISTDIR}\*.*"
SectionEnd
; Functions
;------------------------------------------------------------------------------
Function .onInit
; Check if an instance of this installer is already running
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${ID}") i .r1 ?e'
Pop $R0
StrCmp $R0 0 +3
MessageBox MB_OK|MB_ICONEXCLAMATION "Installer is already running."
Abort
InitPluginsDir
File /oname=$PLUGINSDIR\splash.bmp "images\splash.bmp"
advsplash::show 1000 600 400 -1 $PLUGINSDIR\splash
Delete $PLUGINSDIR\splash.bmp
FunctionEnd
; Descriptions
;------------------------------------------------------------------------------
VIAddVersionKey "ProductName" "${ID}"
VIAddVersionKey "CompanyName" "${COMPANY}"
VIAddVersionKey "LegalCopyright" "Copyright © 2012 Pierre RAYBAUT"
VIAddVersionKey "FileDescription" "${FILE_DESCRIPTION}"
VIAddVersionKey "FileVersion" "${VERSION}"
VIProductVersion "${VERSION}"