1
; Armagetron Advanced Client Setup Script
2
!define PRODUCT_BASENAME "Armagetron Sty+CT"
3
!define PRODUCT_NAME "${PRODUCT_BASENAME}"
4
!define PRODUCT_VERSION "0.2.9-styct_alpha20120506"
5
!define PRODUCT_PUBLISHER "Armagetron Advanced Team"
6
!define PRODUCT_WEB_SITE "http://armagetronad.net"
7
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\${PRODUCT_BASENAME}\armagetronad.exe"
8
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
9
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
13
; MUI 1.67 compatible ------
17
!define MUI_ABORTWARNING
18
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
19
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
20
!define MUI_WELCOMEFINISHPAGE_BITMAP "banner.bmp"
22
; Language Selection Dialog Settings
23
!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
24
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
25
!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"
26
!define MUI_WELCOMEPAGE_TITLE_3LINES
27
!define MUI_FINISHPAGE_TITLE_3LINES
30
!insertmacro MUI_PAGE_WELCOME
32
!insertmacro MUI_PAGE_LICENSE "COPYING.txt"
34
!insertmacro MUI_PAGE_DIRECTORY
36
!insertmacro MUI_PAGE_INSTFILES
38
!define MUI_FINISHPAGE_RUN "$INSTDIR\armagetronad.exe"
39
!insertmacro MUI_PAGE_FINISH
42
!insertmacro MUI_UNPAGE_CONFIRM
43
!insertmacro MUI_UNPAGE_INSTFILES
46
!insertmacro MUI_LANGUAGE "Dutch"
47
!insertmacro MUI_LANGUAGE "English"
48
!insertmacro MUI_LANGUAGE "French"
49
!insertmacro MUI_LANGUAGE "German"
50
!insertmacro MUI_LANGUAGE "Polish"
51
!insertmacro MUI_LANGUAGE "Spanish"
54
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
58
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
59
OutFile "armagetronad-${PRODUCT_VERSION}.win32.exe"
60
InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
61
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
63
ShowUnInstDetails show
66
!insertmacro MUI_LANGDLL_DISPLAY
69
Function RefreshShellIcons
70
!define SHCNE_ASSOCCHANGED 0x08000000
71
!define SHCNF_IDLIST 0
72
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
75
Section "MainSection" SEC01
79
File "Armagetron Forums.url"
81
# install desktop shortcut for current user
82
CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "$INSTDIR\armagetronad.exe"
84
# install start menu for all users
85
SetShellVarContext all
86
CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
87
CreateDirectory "$APPDATA\Armagetron"
88
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Armagetron Forums.lnk" "$INSTDIR\Armagetron Forums.url"
89
File "armagetronad.exe"
90
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk" "$INSTDIR\armagetronad.exe"
91
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} Record.lnk" "$INSTDIR\armagetronad.exe" '--record "%USERPROFILE%\Desktop\ArmagetronAdvancedDebugRecording.aarec"'
92
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} Playback.lnk" "$INSTDIR\armagetronad.exe" '--playback "%USERPROFILE%\Desktop\ArmagetronAdvancedDebugRecording.aarec"'
93
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} Benchmark.lnk" "$INSTDIR\armagetronad.exe" '--benchmark --playback "%USERPROFILE%\Desktop\ArmagetronAdvancedDebugRecording.aarec"'
94
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} User Data.lnk" "$APPDATA\Armagetron"
95
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} System Data.lnk" "$INSTDIR"
96
SetOutPath "$INSTDIR\config"
99
SetOutPath "$INSTDIR\config\examples"
100
File ".\config\examples\*.cfg"
101
SetOutPath "$INSTDIR\config\examples\cvs_test"
102
File ".\config\examples\cvs_test\*.cfg"
103
SetOutPath "$INSTDIR"
106
SetOutPath "$INSTDIR\doc"
107
File /nonfatal ".\doc\*.html"
108
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Documentation.lnk" "$INSTDIR\doc\index.html"
109
SetOutPath "$INSTDIR\doc\net"
110
File /nonfatal ".\doc\net\*.html"
111
SetOutPath "$INSTDIR"
114
SetOutPath "$INSTDIR\language"
115
File ".\language\*.*"
116
SetOutPath "$INSTDIR"
119
SetOutPath "$INSTDIR\models"
120
File ".\models\*.mod"
121
SetOutPath "$INSTDIR\resource\included"
122
File /r ".\resource\included\*.*"
123
SetOutPath "$INSTDIR\sound"
125
SetOutPath "$INSTDIR\textures"
126
File ".\textures\*.png"
127
File ".\textures\*.jpg"
129
; register recording file type
130
WriteRegStr HKCR ".aarec" "" "ArmagetronAd.Recording"
131
WriteRegStr HKCR "ArmagetronAd.Recording" "" "Armagetron Advanced Debug Recording"
132
WriteRegStr HKCR "ArmagetronAd.Recording\shell\DefaultIcon" "" "$INSTDIR\armagetronad.exe,1"
133
WriteRegStr HKCR "ArmagetronAd.Recording\shell\open\command" "" '"$INSTDIR\armagetronad.exe" --playback "%1"'
135
Call RefreshShellIcons
138
Section -AdditionalIcons
139
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall ${PRODUCT_NAME}.lnk" "$INSTDIR\uninst.exe"
143
WriteUninstaller "$INSTDIR\uninst.exe"
144
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\armagetronad.exe"
145
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
146
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
147
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\armagetronad.exe"
148
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
149
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
150
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
154
!insertmacro MUI_UNGETLANGUAGE
158
# uninstall from everywhere
159
SetShellVarContext all
161
Delete "$INSTDIR\*.txt"
162
Delete "$INSTDIR\*.exe"
163
Delete "$INSTDIR\*.dll"
164
Delete "$INSTDIR\stdout.txt"
165
Delete "$INSTDIR\stderr.txt"
167
RMDir /r "$INSTDIR\textures"
168
RMDir /r "$INSTDIR\sound"
169
RMDir /r "$INSTDIR\resource\included"
170
RMDir /r "$INSTDIR\models"
171
RMDir /r "$INSTDIR\language"
172
RMDir /r "$INSTDIR\doc"
173
RMDir /r "$INSTDIR\config\examples"
174
Delete "$INSTDIR\config\settings_visual.cfg"
175
Delete "$INSTDIR\config\settings_dedicated.cfg"
176
Delete "$INSTDIR\config\settings.cfg"
177
Delete "$INSTDIR\config\master.srv"
178
Delete "$INSTDIR\config\default.cfg"
179
Delete "$INSTDIR\config\aiplayers.cfg"
180
Delete "$INSTDIR\armagetronad.exe"
181
Delete "$INSTDIR\Armagetron Forums.url"
184
RMDir "$INSTDIR\resource"
185
RMDir "$INSTDIR\config"
188
Delete "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall ${PRODUCT_NAME}.lnk"
189
Delete "$SMPROGRAMS\${PRODUCT_NAME}\Documentation.lnk"
190
Delete "$DESKTOP\${PRODUCT_NAME}.lnk"
191
Delete "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk"
192
Delete "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} Record.lnk"
193
Delete "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} Playback.lnk"
194
Delete "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} Benchmark.lnk"
195
Delete "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} User Data.lnk"
196
Delete "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME} System Data.lnk"
197
Delete "$SMPROGRAMS\${PRODUCT_NAME}\Armagetron Forums.lnk"
199
RMDir "$SMPROGRAMS\${PRODUCT_NAME}"
201
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
202
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"