-
Notifications
You must be signed in to change notification settings - Fork 108
/
Copy pathmingw-ncurses.nsi
190 lines (137 loc) · 5.4 KB
/
mingw-ncurses.nsi
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
; $Id: mingw-ncurses.nsi,v 1.569 2023/03/05 18:16:04 tom Exp $
; TODO add examples
; TODO bump ABI to 6
; Define the application name
!define APPNAME "ncurses"
!define EXENAME "ncurses.exe"
!define VERSION_MAJOR "6"
!define VERSION_MINOR "4"
!define VERSION_YYYY "2023"
!define VERSION_MMDD "0311"
!define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}
!define MY_ABI "5"
!define MY_MODEL "w"
!define SUBKEY "ncurses"
!define INSTALL "${APPNAME} (Console)"
!define VERSION ${VERSION_MAJOR}.${VERSION_MINOR}
!define VERSION_FULL ${VERSION}-${VERSION_PATCH}
; Main Install settings
Name "${INSTALL}"
InstallDir "c:\mingw"
InstallDirRegKey HKLM "Software\${SUBKEY}" "$INSTDIR\bin"
OutFile "NSIS-Output\${APPNAME}-${VERSION_FULL}-setup.exe"
CRCCheck on
SetCompressor /SOLID lzma
VIAddVersionKey ProductName "${SUBKEY}"
VIAddVersionKey CompanyName "https://invisible-island.net"
VIAddVersionKey FileDescription "NCurses Installer (MinGW)"
VIAddVersionKey FileVersion ${VERSION_FULL}
VIAddVersionKey ProductVersion ${VERSION_FULL}
VIAddVersionKey Comments "This installer was built with NSIS and cross-compiling to MinGW."
VIAddVersionKey InternalName "${APPNAME}-${VERSION_FULL}-setup.exe"
; This is a dotted set of numbers limited to 16-bits each
VIProductVersion "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_YYYY}.${VERSION_MMDD}"
; Modern interface settings
!include "MUI.nsh"
!define MUI_ABORTWARNING
;!define MUI_FINISHPAGE_RUN
;"$INSTDIR\bin\${EXENAME}"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "..\COPYING"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
; Set languages (first is default language)
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_RESERVEFILE_LANGDLL
InstType "Full" ; SectionIn 1
InstType "Typical" ; SectionIn 2
InstType "Minimal" ; SectionIn 3
Section "${APPNAME}" Section1
SectionIn 1 2 3
; Set Section properties
SetOverwrite on
; Set Section Files and Shortcuts
SetOutPath "$INSTDIR\bin"
File ".\bin\*.dll"
SetOutPath "$INSTDIR\share\${APPNAME}"
File /oname=README.txt "..\README"
File /oname=README-mingw.txt "..\README.mingw"
CreateDirectory "$SMPROGRAMS\${INSTALL}"
CreateShortCut "$SMPROGRAMS\${INSTALL}\${APPNAME}.lnk" "$INSTDIR\bin\${EXENAME}"
CreateShortCut "$SMPROGRAMS\${INSTALL}\Uninstall.lnk" "$INSTDIR\uninstall.exe"
SectionEnd
Section "development" Section2
SectionIn 1 2
; Set Section properties
SetOverwrite on
; Set Section Files and Shortcuts
SetOutPath "$INSTDIR\share\${APPNAME}"
SetOutPath "$INSTDIR\include\${APPNAME}${MY_MODEL}"
File ".\include\${APPNAME}${MY_MODEL}\*.h"
SetOutPath "$INSTDIR\lib"
File ".\lib\*.a"
SectionEnd
Section "examples" Section3
SectionIn 1
; Set Section properties
SetOverwrite on
; Set Section Files and Shortcuts
SetOutPath "$INSTDIR\lib\${APPNAME}"
SectionEnd
Section -FinishSection
WriteRegStr HKLM "Software\${SUBKEY}" "" "$INSTDIR"
WriteRegStr HKLM "Software\${SUBKEY}" "Environment" ""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${INSTALL}" "DisplayName" "${APPNAME} ${VERSION_FULL} (Console)"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${INSTALL}" "UninstallString" "$INSTDIR\uninstall.exe"
WriteUninstaller "$INSTDIR\uninstall.exe"
SectionEnd
; Modern install component descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${Section1} "${SUBKEY} runtime"
!insertmacro MUI_DESCRIPTION_TEXT ${Section2} "Development headers and libraries"
!insertmacro MUI_DESCRIPTION_TEXT ${Section3} "Examples"
!insertmacro MUI_FUNCTION_DESCRIPTION_END
;Uninstall section
Section Uninstall
;Remove from registry...
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${INSTALL}"
DeleteRegKey HKLM "SOFTWARE\${SUBKEY}"
; Delete self
Delete "$INSTDIR\uninstall.exe"
; Delete Shortcuts
Delete "$SMPROGRAMS\${INSTALL}\${APPNAME}.lnk"
Delete "$SMPROGRAMS\${INSTALL}\Uninstall.lnk"
; Clean up application
Delete "$INSTDIR\bin\libform${MY_MODEL}${MY_ABI}.dll"
Delete "$INSTDIR\bin\libmenu${MY_MODEL}${MY_ABI}.dll"
Delete "$INSTDIR\bin\libncurses++${MY_MODEL}${MY_ABI}.dll"
Delete "$INSTDIR\bin\libncurses${MY_MODEL}${MY_ABI}.dll"
Delete "$INSTDIR\bin\libpanel${MY_MODEL}${MY_ABI}.dll"
Delete "$INSTDIR\include\${APPNAME}${MY_MODEL}\*.h"
Delete "$INSTDIR\lib\libform${MY_MODEL}.a"
Delete "$INSTDIR\lib\libmenu${MY_MODEL}.a"
Delete "$INSTDIR\lib\libncurses++${MY_MODEL}.a"
Delete "$INSTDIR\lib\libncurses${MY_MODEL}.a"
Delete "$INSTDIR\lib\libpanel${MY_MODEL}.a"
Delete "$INSTDIR\lib\libform${MY_MODEL}.dll.a"
Delete "$INSTDIR\lib\libmenu${MY_MODEL}.dll.a"
Delete "$INSTDIR\lib\libncurses++${MY_MODEL}.dll.a"
Delete "$INSTDIR\lib\libncurses${MY_MODEL}.dll.a"
Delete "$INSTDIR\lib\libpanel${MY_MODEL}.dll.a"
Delete "$INSTDIR\lib\${APPNAME}\*.exe"
Delete "$INSTDIR\share\${APPNAME}\*.*"
; Remove remaining directories
RMDir "$SMPROGRAMS\${INSTALL}"
RMDir "$INSTDIR\share\${APPNAME}"
RMDir "$INSTDIR\share"
RMDir "$INSTDIR\lib\${APPNAME}"
RMDir "$INSTDIR\lib"
RMDir "$INSTDIR\include\${APPNAME}${MY_MODEL}"
RMDir "$INSTDIR\include"
RMDir "$INSTDIR\bin"
RMDir "$INSTDIR\"
SectionEnd