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
|
; Armagetron Advanced Dedicated Server Setup Script
!define PRODUCT_BASENAME "Armagetron Sty+CT"
!define PRODUCT_NAME "${PRODUCT_BASENAME} Dedicated Server"
!define PRODUCT_VERSION "0.2.9-styct_alpha20120506"
!define PRODUCT_PUBLISHER "Armagetron Advanced Team"
!define PRODUCT_WEB_SITE "http://armagetronad.sf.net"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\${PRODUCT_BASENAME}\armagetronad_dedicated.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
SetCompressor lzma
; MUI 1.67 compatible ------
!include "MUI.nsh"
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
!define MUI_WELCOMEFINISHPAGE_BITMAP "banner.bmp"
; Language Selection Dialog Settings
!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"
!define MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_FINISHPAGE_TITLE_3LINES
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!insertmacro MUI_PAGE_LICENSE "COPYING.txt"
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!insertmacro MUI_PAGE_FINISH
; Uninstaller pages
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
; Language files
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Polish"
!insertmacro MUI_LANGUAGE "Spanish"
; Reserve files
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "armagetronad-dedicated-${PRODUCT_VERSION}.win32.exe"
InstallDir "$PROGRAMFILES\${PRODUCT_BASENAME} Dedicated"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd
Section "MainSection" SEC01
SetOutPath "$INSTDIR"
SetOverwrite try
File "Armagetron Forums.url"
# install desktop entry for current user
CreateShortCut "$DESKTOP\${PRODUCT_BASENAME} Server.lnk" "$INSTDIR\armagetronad_dedicated.exe"
# install start menu for all users
SetShellVarContext all
CreateDirectory "$SMPROGRAMS\${PRODUCT_BASENAME}"
CreateShortCut "$SMPROGRAMS\${PRODUCT_BASENAME}\Armagetron Forums.lnk" "$INSTDIR\Armagetron Forums.url"
File "armagetronad_dedicated.exe"
CreateShortCut "$SMPROGRAMS\${PRODUCT_BASENAME}\${PRODUCT_BASENAME} Server.lnk" "$INSTDIR\armagetronad_dedicated.exe"
SetOutPath "$INSTDIR\config"
File ".\config\*.cfg"
File ".\config\*.srv"
SetOutPath "$INSTDIR\config\examples"
File ".\config\examples\*.cfg"
SetOutPath "$INSTDIR\config\examples\cvs_test"
File ".\config\examples\cvs_test\*.cfg"
SetOutPath "$INSTDIR"
File "*.txt"
SetOutPath "$INSTDIR\doc"
File /nonfatal ".\doc\*.html"
CreateShortCut "$SMPROGRAMS\${PRODUCT_BASENAME}\Documentation.lnk" "$INSTDIR\doc\index.html"
SetOutPath "$INSTDIR\doc\net"
File /nonfatal ".\doc\net\*.html"
SetOutPath "$INSTDIR\language"
File ".\language\*.*"
SetOutPath "$INSTDIR"
File "zlib1.dll"
File "iconv.dll"
File "libxml2.dll"
SetOutPath "$INSTDIR\models"
File ".\models\*.mod"
SetOutPath "$INSTDIR\resource\included"
File /r ".\resource\included\*.*"
SetOutPath "$INSTDIR\sound"
File ".\sound\*.wav"
SetOutPath "$INSTDIR\textures"
File ".\textures\*.png"
File ".\textures\*.jpg"
#SetOutPath "$INSTDIR\var"
#File ".\var\README.txt"
SectionEnd
Section -AdditionalIcons
CreateShortCut "$SMPROGRAMS\${PRODUCT_BASENAME}\Uninstall ${PRODUCT_BASENAME} Server.lnk" "$INSTDIR\uninst_dedicated.exe"
SectionEnd
Section -Post
WriteUninstaller "$INSTDIR\uninst_dedicated.exe"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\armagetronad_dedicated.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst_dedicated.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\armagetronad_dedicated.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd
Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
FunctionEnd
Section Uninstall
# uninstall for all users
SetShellVarContext all
Delete "$INSTDIR\*.txt"
Delete "$INSTDIR\*.exe"
Delete "$INSTDIR\*.dll"
Delete "$INSTDIR\var\README.txt"
Delete "$INSTDIR\var\stdout.txt"
RMDir /r "$INSTDIR\textures"
RMDir /r "$INSTDIR\sound"
RMDir /r "$INSTDIR\resource\included"
RMDir /r "$INSTDIR\models"
RMDir /r "$INSTDIR\language"
RMDir /r "$INSTDIR\doc"
RMDir /r "$INSTDIR\config\examples"
Delete "$INSTDIR\config\settings_visual.cfg"
Delete "$INSTDIR\config\settings_dedicated.cfg"
Delete "$INSTDIR\config\settings.cfg"
Delete "$INSTDIR\config\master.srv"
Delete "$INSTDIR\config\default.cfg"
Delete "$INSTDIR\config\aiplayers.cfg"
Delete "$INSTDIR\armagetronad.exe"
Delete "$INSTDIR\Armagetron Forums.url"
RMDir "$INSTDIR\var"
RMDir "$INSTDIR\resource"
RMDir "$INSTDIR\config"
RMDir "$INSTDIR"
Delete "$SMPROGRAMS\${PRODUCT_BASENAME}\Uninstall ${PRODUCT_BASENAME} Server.lnk"
Delete "$SMPROGRAMS\${PRODUCT_BASENAME}\Documentation.lnk"
Delete "$DESKTOP\${PRODUCT_BASENAME} Server.lnk"
Delete "$SMPROGRAMS\${PRODUCT_BASENAME}\${PRODUCT_BASENAME} Server.lnk"
Delete "$SMPROGRAMS\${PRODUCT_BASENAME}\Armagetron Forums.lnk"
RMDir "$SMPROGRAMS\${PRODUCT_BASENAME}"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
SetAutoClose true
SectionEnd
|