20130319
[gdash.git] / gdash.nsi.in
blob9a712ecacf2ac669406985efdb320aedc0448ddc
1 ; GDash.nsi
3 ; UI
4 !include "MUI2.nsh"
6 !define MUI_ICON "gdash.ico"
7 !define MUI_UNICON "gdash.ico"
8 !define MUI_COMPONENTSPAGE_NODESC
10 !insertmacro MUI_PAGE_WELCOME
11 !insertmacro MUI_PAGE_COMPONENTS
12 !insertmacro MUI_PAGE_DIRECTORY
13 !insertmacro MUI_PAGE_INSTFILES
14 !insertmacro MUI_PAGE_FINISH
16 !insertmacro MUI_UNPAGE_CONFIRM
17 !insertmacro MUI_UNPAGE_INSTFILES
19 ; Should be inserted as last one
20 !insertmacro MUI_LANGUAGE "English"
22 ; The name of the installer
23 Name "GDash"
25 !define VERSION GDASH-VERSION
26 !define MINGWDIR c:\mingw
28 ; The file to write
29 OutFile "gdash-${VERSION}-installer.exe"
31 ; The default installation directory
32 InstallDir $PROGRAMFILES\GDash
34 ; Registry key to check for directory (so if you install again, it will
35 ; overwrite the old one automatically)
36 InstallDirRegKey HKLM "Software\GDash" "Install_Dir"
38 ;--------------------------------
40 ; The stuff to install
41 Section "GDash (required)"
43 SectionIn RO
45 ; Program files
46 SetOutPath $INSTDIR
47 File "src\gdash.exe"
48 File "include\boulder_rush.png"
49 File "include\c64_gfx.png"
50 File "include\c64_gfx_bd2.png"
51 File "include\gdash_screen.png"
52 File "include\gdash_tile.png"
53 File "gdash.ico"
54 File /oname=README.txt "README"
55 File /oname=TODO.txt "TODO"
56 File /oname=COPYING.txt "COPYING"
57 File /oname=COPYING_SDL.txt "COPYING.SDL"
58 File /oname=COPYING_GTK.txt "COPYING.GTK"
59 File README-SDL.txt
61 ; Program files, dlls
62 SetOutPath $INSTDIR
63 File ${MINGWDIR}\bin\libgcc_s_dw2-1.dll
64 File ${MINGWDIR}\bin\libstdc++-6.dll
66 ; Program files, Glib dlls
67 File ${MINGWDIR}\bin\intl.dll
68 File ${MINGWDIR}\bin\libglib-2.0-0.dll
69 File ${MINGWDIR}\bin\libgio-2.0-0.dll
70 File ${MINGWDIR}\bin\libgmodule-2.0-0.dll
71 File ${MINGWDIR}\bin\libgobject-2.0-0.dll
72 File ${MINGWDIR}\bin\libgthread-2.0-0.dll
74 ; Program files, GTK+ dlls
75 SetOutPath $INSTDIR
76 File ${MINGWDIR}\bin\freetype6.dll
77 File ${MINGWDIR}\bin\libatk-1.0-0.dll
78 File ${MINGWDIR}\bin\libcairo-2.dll
79 File ${MINGWDIR}\bin\libexpat-1.dll
80 File ${MINGWDIR}\bin\libfontconfig-1.dll
81 File ${MINGWDIR}\bin\libgdk_pixbuf-2.0-0.dll
82 File ${MINGWDIR}\bin\libgdk-win32-2.0-0.dll
83 File ${MINGWDIR}\bin\libgtk-win32-2.0-0.dll
84 File ${MINGWDIR}\bin\libpango-1.0-0.dll
85 File ${MINGWDIR}\bin\libpangocairo-1.0-0.dll
86 File ${MINGWDIR}\bin\libpangoft2-1.0-0.dll
87 File ${MINGWDIR}\bin\libpangowin32-1.0-0.dll
88 File ${MINGWDIR}\bin\libpng14-14.dll
89 File ${MINGWDIR}\bin\libpng15-15.dll
90 File ${MINGWDIR}\bin\zlib1.dll
91 ; GTK+ theming stuff for Win32
92 SetOutPath $INSTDIR\etc\gtk-2.0
93 File /oname=gtkrc gtkrc_win32
94 SetOutPath $INSTDIR\share\themes\MS-Windows\gtk-2.0
95 File ${MINGWDIR}\share\themes\MS-Windows\gtk-2.0\gtkrc
96 SetOutPath $INSTDIR\lib\gtk-2.0\2.10.0\engines
97 File ${MINGWDIR}\lib\gtk-2.0\2.10.0\engines\libwimp.dll
99 ; Program files, SDL dlls
100 SetOutPath $INSTDIR
101 File ${MINGWDIR}\bin\SDL.dll
102 File ${MINGWDIR}\bin\SDL_mixer.dll
103 File ${MINGWDIR}\bin\SDL_image.dll
104 File ${MINGWDIR}\bin\libvorbis-0.dll
105 File ${MINGWDIR}\bin\libvorbisfile-3.dll
106 File ${MINGWDIR}\bin\libogg-0.dll
107 ; the currently used sdl_img required a different version of libpng.
108 ; also requires zlib1, but that is also shipped with gtk+
109 ; also ship jpeg, so the game can load jpegs - just in case.
110 File ${MINGWDIR}\bin\libpng14-14.dll
111 File ${MINGWDIR}\bin\libjpeg-8.dll
114 ; Documentation
115 SetOutPath $INSTDIR
116 File docs\replay_to_avi.html
117 File docs\style.css
118 File docs\background.png
119 File docs\gdash.png
120 File docs\avidemux_codec.png
121 File docs\avidemux_fps.png
123 ; Write the installation path into the registry
124 WriteRegStr HKLM SOFTWARE\GDash "Install_Dir" "$INSTDIR"
126 ; Write the uninstall keys for Windows
127 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GDash" "DisplayName" "GDash"
128 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GDash" "UninstallString" '"$INSTDIR\uninstall.exe"'
129 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GDash" "NoModify" 1
130 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GDash" "NoRepair" 1
131 WriteUninstaller "uninstall.exe"
133 SectionEnd
135 ; Optional section (can be disabled by the user)
136 ; The stuff to install
137 Section "Cave sets"
139 ; Set output path to the installation directory.
140 SetOutPath $INSTDIR\caves
142 ; Put files there
143 File /r /x Makefile* /x create_makefile.sh "caves\*"
145 SectionEnd
147 Section "Sound files"
148 SetOutPath $INSTDIR\sound
149 File "sound\*.ogg"
151 SetOutPath $INSTDIR\music
152 File "music\*.ogg"
154 SectionEnd
156 Section "Translations"
157 ; Translations
158 SetOutPath $INSTDIR\hu\LC_MESSAGES
159 File /r ${MINGWDIR}\share\locale\hu\LC_MESSAGES\gtk20.mo
160 File /r ${MINGWDIR}\share\locale\hu\LC_MESSAGES\glib20.mo
161 SetOutPath $INSTDIR\de\LC_MESSAGES
162 File /r ${MINGWDIR}\share\locale\de\LC_MESSAGES\gtk20.mo
163 File /r ${MINGWDIR}\share\locale\de\LC_MESSAGES\glib20.mo
165 SetOutPath $INSTDIR\hu\LC_MESSAGES
166 File /oname=gdash.mo "po\hu.gmo"
167 SetOutPath $INSTDIR\de\LC_MESSAGES
168 File /oname=gdash.mo "po\de.gmo"
169 SectionEnd
172 ; Optional section (can be disabled by the user)
173 Section "Start Menu Shortcuts"
175 SetOutPath $INSTDIR
176 CreateDirectory "$SMPROGRAMS\GDash"
177 CreateShortCut "$SMPROGRAMS\GDash\GDash.lnk" "$INSTDIR\gdash.exe" "" "$INSTDIR\gdash.ico" 0
178 CreateShortCut "$SMPROGRAMS\GDash\README.lnk" "$INSTDIR\README.txt" "" "" 0
179 CreateShortCut "$SMPROGRAMS\GDash\Replay to AVI HOWTO.lnk" "$INSTDIR\replay_to_avi.html" "" "" 0
180 CreateShortCut "$SMPROGRAMS\GDash\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
182 SectionEnd
186 ; Optional section (can be disabled by the user)
187 Section "Register *.bd and *.gds files"
189 WriteRegStr HKCR ".bd" "" "GDash.Caveset"
190 WriteRegStr HKCR ".gds" "" "GDash.Caveset"
192 WriteRegStr HKCR "GDash.Caveset" "" "GDash Caveset"
193 WriteRegStr HKCR "GDash.Caveset\DefaultIcon" "" "$INSTDIR\gdash.ico,0"
195 WriteRegStr HKCR "GDash.Caveset\shell\open\command" "" '"$INSTDIR\gdash.exe" "%1"'
196 WriteRegStr HKCR "GDash.Caveset\shell\edit\command" "" '"$INSTDIR\gdash.exe" -e "%1"'
198 SectionEnd
203 ;--------------------------------
204 ; Uninstaller
206 Section "Uninstall"
208 ; Remove registry keys
209 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GDash"
210 DeleteRegKey HKLM SOFTWARE\GDash
211 DeleteRegKey HKCR ".bd"
212 DeleteRegKey HKCR ".gds"
213 DeleteRegKey HKCR "GDash.Caveset"
215 ; Remove shortcuts, if any
216 Delete "$SMPROGRAMS\GDash\*.*"
217 RMDir "$SMPROGRAMS\GDash"
219 ; Remove directories used
220 RMDir /r "$INSTDIR"
222 SectionEnd