~swag/armagetronad/0.2.9-sty+ct+ap-fork

« back to all changes in this revision

Viewing changes to win32/required/armagetronad.nsi

  • Committer: SwagTron
  • Date: 2019-03-05 07:13:03 UTC
  • Revision ID: swagtron-20190305071303-5m4cn9hs6h8ydsgf
- Ported toggle from 0.4. Seems kind of hacky. Had to add another FindConfigItem of type tConfItemBase due to tab completion using the previous tString function. Plan to change this later, but I really needed the toggle function. Tried to cast the two, but that did not work out. Seemed like the bug-less option for the time being. Those unfamiliar with this function, you can now toggle boolean commands (Ex. toggle text_out)

Show diffs side-by-side

added added

removed removed

Lines of Context:
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"
10
 
 
11
 
SetCompressor lzma
12
 
 
13
 
; MUI 1.67 compatible ------
14
 
!include "MUI.nsh"
15
 
 
16
 
; MUI Settings
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"
21
 
 
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
28
 
 
29
 
; Welcome page
30
 
!insertmacro MUI_PAGE_WELCOME
31
 
; License page
32
 
!insertmacro MUI_PAGE_LICENSE "COPYING.txt"
33
 
; Directory page
34
 
!insertmacro MUI_PAGE_DIRECTORY
35
 
; Instfiles page
36
 
!insertmacro MUI_PAGE_INSTFILES
37
 
; Finish page
38
 
!define MUI_FINISHPAGE_RUN "$INSTDIR\armagetronad.exe"
39
 
!insertmacro MUI_PAGE_FINISH
40
 
 
41
 
; Uninstaller pages
42
 
!insertmacro MUI_UNPAGE_CONFIRM
43
 
!insertmacro MUI_UNPAGE_INSTFILES
44
 
 
45
 
; Language files
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"
52
 
 
53
 
; Reserve files
54
 
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
55
 
 
56
 
; MUI end ------
57
 
 
58
 
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
59
 
OutFile "armagetronad-${PRODUCT_VERSION}.win32.exe"
60
 
InstallDir "$PROGRAMFILES\${PRODUCT_NAME}"
61
 
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
62
 
ShowInstDetails show
63
 
ShowUnInstDetails show
64
 
 
65
 
Function .onInit
66
 
  !insertmacro MUI_LANGDLL_DISPLAY
67
 
FunctionEnd
68
 
 
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)'
73
 
FunctionEnd
74
 
 
75
 
Section "MainSection" SEC01
76
 
 
77
 
  SetOutPath "$INSTDIR"
78
 
  SetOverwrite try
79
 
  File "Armagetron Forums.url"
80
 
 
81
 
  # install desktop shortcut for current user
82
 
  CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "$INSTDIR\armagetronad.exe"
83
 
 
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"
97
 
  File ".\config\*.cfg"
98
 
  File ".\config\*.srv"
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"
104
 
  File "*.txt"
105
 
  File "*.dll"
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"
112
 
  File "iconv.dll"
113
 
  File "jpeg.dll"
114
 
  SetOutPath "$INSTDIR\language"
115
 
  File ".\language\*.*"
116
 
  SetOutPath "$INSTDIR"
117
 
  File "libpng13.dll"
118
 
  File "libxml2.dll"
119
 
  SetOutPath "$INSTDIR\models"
120
 
  File ".\models\*.mod"
121
 
  SetOutPath "$INSTDIR\resource\included"
122
 
  File /r ".\resource\included\*.*"
123
 
  SetOutPath "$INSTDIR\sound"
124
 
  File ".\sound\*.wav"
125
 
  SetOutPath "$INSTDIR\textures"
126
 
  File ".\textures\*.png"
127
 
  File ".\textures\*.jpg"
128
 
 
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"'
134
 
 
135
 
  Call RefreshShellIcons
136
 
SectionEnd
137
 
 
138
 
Section -AdditionalIcons
139
 
  CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall ${PRODUCT_NAME}.lnk" "$INSTDIR\uninst.exe"
140
 
SectionEnd
141
 
 
142
 
Section -Post
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}"
151
 
SectionEnd
152
 
 
153
 
Function un.onInit
154
 
!insertmacro MUI_UNGETLANGUAGE
155
 
FunctionEnd
156
 
 
157
 
Section Uninstall
158
 
  # uninstall from everywhere
159
 
  SetShellVarContext all
160
 
 
161
 
  Delete "$INSTDIR\*.txt"
162
 
  Delete "$INSTDIR\*.exe"
163
 
  Delete "$INSTDIR\*.dll"
164
 
  Delete "$INSTDIR\stdout.txt"
165
 
  Delete "$INSTDIR\stderr.txt"
166
 
 
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"
182
 
 
183
 
  RMDir "$INSTDIR\var"
184
 
  RMDir "$INSTDIR\resource"
185
 
  RMDir "$INSTDIR\config"
186
 
  RMDir "$INSTDIR"
187
 
 
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"
198
 
 
199
 
  RMDir "$SMPROGRAMS\${PRODUCT_NAME}"
200
 
 
201
 
  DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
202
 
  DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
203
 
  SetAutoClose true
204
 
SectionEnd