1; NSIS description file for ioquake3 installer
2;
3; EDIT WITH CARE!
4;
5; This file is used to automatically build the installers in the
6; openSUSE build service, don't break this!
7;
8; you have to copy SDL.dll and libcurl-4.dll here manually
9
10!define MULTIUSER_MUI
11!define MULTIUSER_EXECUTIONLEVEL Highest
12!define MULTIUSER_INSTALLMODE_COMMANDLINE
13!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY "Software\ioquake3"
14!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME "Install_Mode"
15!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "Software\ioquake3"
16!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME "Install_Dir"
17!define MULTIUSER_INSTALLMODE_INSTDIR "ioquake3"
18!include MultiUser.nsh
19
20!include "MUI2.nsh"
21!define MUI_ICON "../quake3.ico"
22
23; The name of the installer
24Name "ioquake3"
25
26; The file to write
27OutFile "ioquake3-XXXVERSIONXXX-XXXRELEASEXXX.x86.exe"
28
29; The default installation directory
30; set by Multiuser.nsh
31;InstallDir $PROGRAMFILES\ioquake3
32
33; Registry key to check for directory (so if you install again, it will
34; overwrite the old one automatically)
35; handled by Multiuser.nsh
36;InstallDirRegKey HKLM "Software\ioquake3" "Install_Dir"
37
38;--------------------------------
39;Interface Settings
40
41!define MUI_ABORTWARNING
42
43;--------------------------------
44;Pages
45
46!insertmacro MULTIUSER_PAGE_INSTALLMODE
47#!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
48!insertmacro MUI_PAGE_COMPONENTS
49!insertmacro MUI_PAGE_DIRECTORY
50!insertmacro MUI_PAGE_INSTFILES
51
52!insertmacro MUI_UNPAGE_CONFIRM
53!insertmacro MUI_UNPAGE_INSTFILES
54
55;--------------------------------
56;Languages
57
58!insertmacro MUI_LANGUAGE "English"
59
60;--------------------------------
61
62;--------------------------------
63;Multiuser stuff
64Function .onInit
65  !insertmacro MULTIUSER_INIT
66FunctionEnd
67
68Function un.onInit
69  !insertmacro MULTIUSER_UNINIT
70FunctionEnd
71
72; The stuff to install
73Section "ioquake3 (required)"
74
75  SectionIn RO
76
77  ; Set output path to the installation directory.
78  SetOutPath $INSTDIR
79
80  ; Put file there
81  File "../../build/release-mingw32-x86/ioq3ded.x86.exe"
82  File "../../build/release-mingw32-x86/ioquake3.x86.exe"
83  File "../../COPYING.txt"
84  File "../../README.txt"
85  File "../../id-readme.txt"
86  File "../../voip-readme.txt"
87
88  SetOutPath "$INSTDIR\baseq3"
89  File "../../build/release-mingw32-x86/baseq3/cgamex86.dll"
90  File "../../build/release-mingw32-x86/baseq3/qagamex86.dll"
91  File "../../build/release-mingw32-x86/baseq3/uix86.dll"
92  SetOutPath "$INSTDIR\missionpack"
93  File "../../build/release-mingw32-x86/missionpack/cgamex86.dll"
94  File "../../build/release-mingw32-x86/missionpack/qagamex86.dll"
95  File "../../build/release-mingw32-x86/missionpack/uix86.dll"
96
97  ; Write the installation path into the registry
98  WriteRegStr SHCTX "Software\ioquake3" ${MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME} "$INSTDIR"
99  WriteRegStr SHCTX "Software\ioquake3" ${MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME} "$MultiUser.InstallMode"
100
101  ; Write the uninstall keys for Windows
102  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ioquake3" "DisplayName" "ioquake3"
103  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ioquake3" "UninstallString" '"$INSTDIR\uninstall.exe"'
104  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ioquake3" "NoModify" 1
105  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ioquake3" "NoRepair" 1
106  WriteUninstaller "uninstall.exe"
107
108SectionEnd
109
110; Optional section (can be disabled by the user)
111Section "Start Menu Shortcuts"
112
113  CreateDirectory "$SMPROGRAMS\ioquake3"
114  CreateShortCut "$SMPROGRAMS\ioquake3\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
115  CreateShortCut "$SMPROGRAMS\ioquake3\ioquake3.lnk" "$INSTDIR\ioquake3.x86.exe" "" "$INSTDIR\ioquake3.x86.exe" 0
116
117SectionEnd
118
119Section "SDL.dll"
120
121  SetOutPath $INSTDIR
122
123  File "SDL.dll"
124
125SectionEnd
126
127Section "libcurl"
128
129  SetOutPath $INSTDIR
130
131  File "libcurl-4.dll"
132
133SectionEnd
134
135Section "OpenAL-Soft library"
136
137  SetOutPath $INSTDIR
138
139  File "openal32.dll"
140
141SectionEnd
142
143;--------------------------------
144
145; Uninstaller
146
147Section "Uninstall"
148
149  ; Remove registry keys
150  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ioquake3"
151  DeleteRegKey SHCTX "Software\ioquake3"
152
153  ; Remove files and uninstaller
154  Delete $INSTDIR\baseq3\cgamex86.dll
155  Delete $INSTDIR\baseq3\qagamex86.dll
156  Delete $INSTDIR\baseq3\uix86.dll
157  Delete $INSTDIR\missionpack\cgamex86.dll
158  Delete $INSTDIR\missionpack\qagamex86.dll
159  Delete $INSTDIR\missionpack\uix86.dll
160  Delete $INSTDIR\ioquake3.x86.exe
161  Delete $INSTDIR\ioq3ded.x86.exe
162
163  Delete $INSTDIR\COPYING.txt
164  Delete $INSTDIR\README.txt
165  Delete $INSTDIR\id-readme.txt
166  Delete $INSTDIR\voip-readme.txt
167
168  Delete $INSTDIR\SDL.dll
169
170  Delete $INSTDIR\libcurl-4.dll
171
172  Delete $INSTDIR\openal32.dll
173
174  Delete $INSTDIR\uninstall.exe
175
176  ; Remove shortcuts, if any
177  Delete "$SMPROGRAMS\ioquake3\Uninstall.lnk"
178  Delete "$SMPROGRAMS\ioquake3\ioquake3.lnk"
179
180  ; Remove directories used
181  RMDir "$SMPROGRAMS\ioquake3"
182  RMDir "$INSTDIR\baseq3"
183  RMDir "$INSTDIR\missionpack"
184  RMDir "$INSTDIR"
185
186SectionEnd
187