| Line | Revision | Contents |
| 1 | 2 | # NSIS installer script file |
| 2 | ||
| 3 | 24 | # |
| 4 | # Run with: | |
| 5 | # > makensis calliope.nsi | |
| 6 | # for a normal build, or, | |
| 7 | # > makensis -Dunstable calliope.nsi | |
| 8 | # for an unstable build. The point of this is so you can run a stable and | |
| 9 | # and unstable version of Calliope on the same system, allowing testing of | |
| 10 | 305 | # a new feature in production, without being stranded for tunes if it |
| 11 | 24 | # turns out to be really broken. |
| 12 | # | |
| 13 | ||
| 14 | 445.1.2 | # FIXME: if we were *really* clever, we could use a tool to find the dll deps of calliope.exe |
| 15 | # automatically, and include those in the installer automatically ... | |
| 16 | ||
| 17 | 2 | #!include LogicLib.nsh |
| 18 | ||
| 19 | 24 | !ifdef unstable |
| 20 | !define VERSION "0.1.0-unstable" | |
| 21 | !else | |
| 22 | # FIXME: do this automatically | |
| 23 | !define VERSION "0.1.0" | |
| 24 | !endif | |
| 25 | 2 | |
| 26 | 36 | !define PREFIX "c:\build" |
| 27 | ||
| 28 | 2 | # FIXME: version |
| 29 | OutFile calliope-${VERSION}-win32.exe | |
| 30 | Name "Calliope Music Player ${VERSION}" | |
| 31 | ||
| 32 | 196 | # FIXME: advice on this? How does it work on vista? |
| 33 | 2 | RequestExecutionLevel admin |
| 34 | # FIXME: use LZMA compression for non-debug versions? | |
| 35 | SetCompress off | |
| 36 | #SetCompressor lzma | |
| 37 | #auto | |
| 38 | ||
| 39 | 195 | InstallDirRegKey HKLM Software\Calliope\ InstallPath |
| 40 | 196 | LicenseData COPYING.rtf |
| 41 | 195 | |
| 42 | 24 | !ifdef unstable |
| 43 | InstallDir $PROGRAMFILES\Calliope-Unstable | |
| 44 | !define SMDIR "$SMPROGRAMS\Calliope Music Player (Testing)" | |
| 45 | !define DESKTOP_SHORTCUT "$DESKTOP\CalliopeUnstable.lnk" | |
| 46 | !else | |
| 47 | InstallDir $PROGRAMFILES\Calliope | |
| 48 | !define SMDIR "$SMPROGRAMS\Calliope Music Player" | |
| 49 | !define DESKTOP_SHORTCUT "$DESKTOP\Calliope.lnk" | |
| 50 | 305 | !endif |
| 51 | 24 | |
| 52 | 196 | Page license |
| 53 | 2 | Page directory |
| 54 | Page instfiles | |
| 55 | UninstPage uninstConfirm | |
| 56 | UninstPage instfiles | |
| 57 | ||
| 58 | # FIXME: make uninstaller work | |
| 59 | ||
| 60 | 192 | Section "GTK+" |
| 61 | 2 | # These are the shared GTK DLL's |
| 62 | 24 | # (missing a couple of things that we don't need) |
| 63 | 2 | SetOutPath $INSTDIR\bin |
| 64 | 36 | #File "${PREFIX}\bin\freetype6.dll" |
| 65 | File "${PREFIX}\bin\gspawn-win32-helper.exe" | |
| 66 | File "${PREFIX}\bin\gspawn-win32-helper-console.exe" | |
| 67 | File "${PREFIX}\bin\iconv.dll" | |
| 68 | File "${PREFIX}\bin\intl.dll" | |
| 69 | 70 | File "${PREFIX}\bin\jpeg62.dll" |
| 70 | 36 | File "${PREFIX}\bin\libatk-1.0-0.dll" |
| 71 | File "${PREFIX}\bin\libcairo-2.dll" | |
| 72 | File "${PREFIX}\bin\libexpat.dll" | |
| 73 | #File "${PREFIX}\bin\libfontconfig-1.dll" | |
| 74 | File "${PREFIX}\bin\libgdk_pixbuf-2.0-0.dll" | |
| 75 | File "${PREFIX}\bin\libgdk-win32-2.0-0.dll" | |
| 76 | File "${PREFIX}\bin\libglib-2.0-0.dll" | |
| 77 | File "${PREFIX}\bin\libgmodule-2.0-0.dll" | |
| 78 | File "${PREFIX}\bin\libgobject-2.0-0.dll" | |
| 79 | File "${PREFIX}\bin\libgthread-2.0-0.dll" | |
| 80 | File "${PREFIX}\bin\libgtk-win32-2.0-0.dll" | |
| 81 | File "${PREFIX}\bin\libpango-1.0-0.dll" | |
| 82 | File "${PREFIX}\bin\libpangocairo-1.0-0.dll" | |
| 83 | File "${PREFIX}\bin\libpangoft2-1.0-0.dll" | |
| 84 | File "${PREFIX}\bin\libpangowin32-1.0-0.dll" | |
| 85 | File "${PREFIX}\bin\libpng12-0.dll" | |
| 86 | File "${PREFIX}\bin\zlib1.dll" | |
| 87 | 2 | SetOutPath $INSTDIR\etc\gtk-2.0 |
| 88 | 165 | |
| 89 | # FIXME: is this right | |
| 90 | 36 | File "${PREFIX}\\etc\gtk-2.0\gdk-pixbuf.loaders" |
| 91 | 305 | |
| 92 | 36 | File "${PREFIX}\\etc\gtk-2.0\gtk.immodules" |
| 93 | 305 | |
| 94 | 2 | SetOutPath $INSTDIR\lib\gtk-2.0\2.10.0\engines |
| 95 | 36 | File "${PREFIX}\lib\gtk-2.0\2.10.0\engines\libpixmap.dll" |
| 96 | File "${PREFIX}\lib\gtk-2.0\2.10.0\engines\libwimp.dll" | |
| 97 | #SetOutPath $INSTDIR\lib\gtk-2.0\2.10.0\immodules | |
| 98 | #File "${PREFIX}\lib\gtk-2.0\2.10.0\immodules\*.dll" | |
| 99 | 305 | |
| 100 | 165 | # FIXME: Use gdi loader. |
| 101 | SetOutPath $INSTDIR\lib\gtk-2.0\2.10.0\loaders | |
| 102 | File "${PREFIX}\lib\gtk-2.0\2.10.0\loaders\libpixbufloader-png.dll" | |
| 103 | 305 | |
| 104 | 2 | SetOutPath $INSTDIR\share\themes\Default\gtk-2.0-key |
| 105 | 36 | File "${PREFIX}\share\themes\Default\gtk-2.0-key\gtkrc" |
| 106 | 2 | SetOutPath $INSTDIR\share\themes\MS-Windows\gtk-2.0 |
| 107 | 36 | File "${PREFIX}\share\themes\MS-Windows\gtk-2.0\gtkrc" |
| 108 | 305 | |
| 109 | 109 | # Write our gtkrc. |
| 110 | # | |
| 111 | SetOutPath $INSTDIR\etc\gtk-2.0 | |
| 112 | FileOpen $0 gtkrc w | |
| 113 | FileWrite $0 "# Created by Calliope installer$\n$\n" | |
| 114 | 165 | FileWrite $0 "gtk-theme-name = $\"MS-Windows$\"$\n" |
| 115 | FileWrite $0 "gtk-icon-theme-name = $\"gnome$\"$\n" | |
| 116 | FileWrite $0 "$\n" | |
| 117 | FileWrite $0 "style $\"msw-ruled-treeview$\" {$\n" | |
| 118 | FileWrite $0 " GtkTreeView::allow-rules = 1$\n" | |
| 119 | FileWrite $0 "}$\n" | |
| 120 | FileWrite $0 "$\n" | |
| 121 | FileWrite $0 "class $\"GtkTreeView$\" style $\"msw-ruled-treeview$\"$\n" | |
| 122 | 305 | FileClose $0 |
| 123 | 194 | SectionEnd |
| 124 | 192 | |
| 125 | Section "GStreamer" | |
| 126 | 110 | # FIXME: can we disable some of these in our build of gstreamer so we don't need |
| 127 | # so many dlls? | |
| 128 | 2 | SetOutPath $INSTDIR\bin |
| 129 | 36 | File "${PREFIX}\bin\dxerr9.dll" |
| 130 | File "${PREFIX}\bin\libgstaudio-0.10-0.dll" | |
| 131 | File "${PREFIX}\bin\libgstbase-0.10-0.dll" | |
| 132 | File "${PREFIX}\bin\libgstcontroller-0.10-0.dll" | |
| 133 | 110 | File "${PREFIX}\bin\libgstdataprotocol-0.10-0.dll" |
| 134 | 36 | File "${PREFIX}\bin\libgstfft-0.10-0.dll" |
| 135 | File "${PREFIX}\bin\libgstinterfaces-0.10-0.dll" | |
| 136 | 305 | File "${PREFIX}\bin\libgstnetbuffer-0.10-0.dll" |
| 137 | 36 | File "${PREFIX}\bin\libgstpbutils-0.10-0.dll" |
| 138 | File "${PREFIX}\bin\libgstreamer-0.10-0.dll" | |
| 139 | File "${PREFIX}\bin\libgstriff-0.10-0.dll" | |
| 140 | 110 | File "${PREFIX}\bin\libgstrtp-0.10-0.dll" |
| 141 | File "${PREFIX}\bin\libgstrtsp-0.10-0.dll" | |
| 142 | 305 | File "${PREFIX}\bin\libgstsdp-0.10-0.dll" |
| 143 | File "${PREFIX}\bin\libgsttag-0.10-0.dll" | |
| 144 | 110 | File "${PREFIX}\bin\libgstvideo-0.10-0.dll" |
| 145 | 36 | File "${PREFIX}\bin\libid3tag-0.dll" |
| 146 | File "${PREFIX}\bin\libflac-8.dll" | |
| 147 | File "${PREFIX}\bin\libmad-0.dll" | |
| 148 | File "${PREFIX}\bin\libogg-0.dll" | |
| 149 | File "${PREFIX}\bin\liboil-0.3-0.dll" | |
| 150 | File "${PREFIX}\bin\libvorbis-0.dll" | |
| 151 | File "${PREFIX}\bin\libvorbisenc-2.dll" | |
| 152 | 2 | SetOutPath $INSTDIR\lib\gstreamer-0.10 |
| 153 | 36 | File "${PREFIX}\lib\gstreamer-0.10\libgstapetag.dll" |
| 154 | File "${PREFIX}\lib\gstreamer-0.10\libgstaudioconvert.dll" | |
| 155 | File "${PREFIX}\lib\gstreamer-0.10\libgstaudioresample.dll" | |
| 156 | File "${PREFIX}\lib\gstreamer-0.10\libgstdirectsoundsink.dll" | |
| 157 | File "${PREFIX}\lib\gstreamer-0.10\libgstflac.dll" | |
| 158 | File "${PREFIX}\lib\gstreamer-0.10\libgstid3demux.dll" | |
| 159 | File "${PREFIX}\lib\gstreamer-0.10\libgstmpegaudioparse.dll" | |
| 160 | ;;File "${PREFIX}\lib\gstreamer-0.10\libgsturidecodebin.dll" | |
| 161 | File "${PREFIX}\lib\gstreamer-0.10\libgstvolume.dll" | |
| 162 | File "${PREFIX}\lib\gstreamer-0.10\libgstvorbis.dll" | |
| 163 | File "${PREFIX}\lib\gstreamer-0.10\libgstwavparse.dll" | |
| 164 | 24 | # gst-plugins-base |
| 165 | 36 | File "${PREFIX}\lib\gstreamer-0.10\libgstcoreelements.dll" |
| 166 | File "${PREFIX}\lib\gstreamer-0.10\libgstdecodebin.dll" | |
| 167 | File "${PREFIX}\lib\gstreamer-0.10\libgstdecodebin2.dll" | |
| 168 | File "${PREFIX}\lib\gstreamer-0.10\libgstogg.dll" | |
| 169 | File "${PREFIX}\lib\gstreamer-0.10\libgstplaybin.dll" | |
| 170 | File "${PREFIX}\lib\gstreamer-0.10\libgsttypefindfunctions.dll" | |
| 171 | 24 | # gst-plugins-bad |
| 172 | 36 | File "${PREFIX}\lib\gstreamer-0.10\libgstreplaygain.dll" |
| 173 | 24 | # gst-plugins-ugly |
| 174 | 36 | File "${PREFIX}\lib\gstreamer-0.10\libgstmad.dll" |
| 175 | 194 | SectionEnd |
| 176 | 192 | |
| 177 | # Misc libraries, and GNOME's icons | |
| 178 | Section "Support" | |
| 179 | SetOutPath $INSTDIR\bin | |
| 180 | File "${PREFIX}\bin\libsoup-2.4-1.dll" | |
| 181 | File "${PREFIX}\bin\libgio-2.0-0.dll" | |
| 182 | File "${PREFIX}\bin\libxml2.dll" | |
| 183 | ||
| 184 | ||
| 185 | # sqlite | |
| 186 | SetOutPath $INSTDIR\bin | |
| 187 | File "${PREFIX}\bin\sqlite3.dll" | |
| 188 | ||
| 189 | # gconf | |
| 190 | SetOutPath $INSTDIR\bin | |
| 191 | File "${PREFIX}\bin\libgconf-2-4.dll" | |
| 192 | File "${PREFIX}\bin\libORBit-2-0.dll" | |
| 193 | SetOutPath $INSTDIR\libexec | |
| 194 | File "${PREFIX}\libexec\gconfd-2.exe" | |
| 195 | SetOutPath $INSTDIR\lib\gconf\2 | |
| 196 | File "${PREFIX}\lib\gconf\2\libgconfbackend-xml.dll" | |
| 197 | 305 | |
| 198 | ||
| 199 | 192 | # Bits of the GNOME icon theme we use |
| 200 | # | |
| 201 | SetOutPath $INSTDIR\share\icons\gnome | |
| 202 | File "${PREFIX}\share\icons\gnome\index.theme" | |
| 203 | SetOutPath $INSTDIR\share\icons\gnome\16x16\status | |
| 204 | File "${PREFIX}\share\icons\gnome\16x16\status\stock_volume-mute.png" | |
| 205 | File "${PREFIX}\share\icons\gnome\16x16\status\stock_volume-0.png" | |
| 206 | File "${PREFIX}\share\icons\gnome\16x16\status\stock_volume-min.png" | |
| 207 | File "${PREFIX}\share\icons\gnome\16x16\status\stock_volume-med.png" | |
| 208 | File "${PREFIX}\share\icons\gnome\16x16\status\stock_volume-max.png" | |
| 209 | 194 | SectionEnd |
| 210 | 192 | |
| 211 | Section "Calliope" | |
| 212 | Call KillExisting | |
| 213 | ||
| 214 | SetOutPath $INSTDIR | |
| 215 | 305 | |
| 216 | 192 | ;;; FIXME: strip these two !! |
| 217 | File build\default\calliope.exe | |
| 218 | File build\default\calliope.dll | |
| 219 | ||
| 220 | SetOutPath $INSTDIR\data | |
| 221 | File data\calliope.ui | |
| 222 | File data\import-settings-panel.ui | |
| 223 | File data\playback-settings-panel.ui | |
| 224 | File data\view-config-dialog.ui | |
| 225 | ||
| 226 | # FIXME: calliope really needs slimming down !! | |
| 227 | # FIXME: in final version, strip all debugging symbols (warning: this causes some weird crashes if done wrong ..) | |
| 228 | # Removing gnome dependency really shouldn't be so hard i don't think. | |
| 229 | ||
| 230 | 305 | # Install gconf schemas by hand since we're not running make install |
| 231 | 192 | SetOutPath $INSTDIR\etc\gconf\gconf.xml.defaults |
| 232 | # ... gconf :( | |
| 233 | !system "mkdir gconf-install-temp" | |
| 234 | !system "pushd ${PREFIX}\bin && gconftool-2 --spawn && popd" | |
| 235 | # FIXME: how can we get this to just use current directory. | |
| 236 | !system "${PREFIX}\bin\gconftool-2 --config-source=xml:merged:e:/calliope/gconf-install-temp --install-schema-file=data/conftool.schemas" | |
| 237 | # FIXME: makensis dies here sometimes. I think it's like a race condition or something | |
| 238 | File /r gconf-install-temp\%gconf-tree.xml | |
| 239 | #!system "del /y gconf-install-temp/ && rmdir gconf-install-temp" | |
| 240 | # Make a new GConf path file, since our prebuilt path file has the build-env directory location hard-coded | |
| 241 | SetOutPath $INSTDIR\etc\gconf\2 | |
| 242 | Push $INSTDIR | |
| 243 | Push "\" | |
| 244 | Call StrSlash | |
| 245 | Pop $1 | |
| 246 | FileOpen $0 path w | |
| 247 | FileWrite $0 "# Created by Calliope installer$\n$\n" | |
| 248 | ## fixme: can we do app data dir ?? | |
| 249 | FileWrite $0 "xml:readwrite:$$(HOME)/.gconf$\n" | |
| 250 | FileWrite $0 "xml:readonly:$1/etc/gconf/gconf.xml.defaults$\n" | |
| 251 | 305 | FileClose $0 |
| 252 | ||
| 253 | ||
| 254 | 2 | ;; FIXME: make these optional |
| 255 | 305 | |
| 256 | 2 | ;Create desktop shortcut |
| 257 | SetOutPath $INSTDIR | |
| 258 | 24 | CreateShortCut "${DESKTOP_SHORTCUT}" "$INSTDIR\calliope.exe" "" |
| 259 | 305 | |
| 260 | 2 | ;Create start-menu items |
| 261 | 24 | CreateDirectory "${SMDIR}" |
| 262 | !ifdef unstable | |
| 263 | CreateShortCut "${SMDIR}\Calliope (Testing).lnk" "$INSTDIR\calliope.exe" "" "$INSTDIR\calliope.exe" 0 | |
| 264 | !else | |
| 265 | CreateShortCut "${SMDIR}\Calliope.lnk" "$INSTDIR\calliope.exe" "" "$INSTDIR\calliope.exe" 0 | |
| 266 | !endif | |
| 267 | CreateShortCut "${SMDIR}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 | |
| 268 | 305 | |
| 269 | 2 | ;Write uninstall information to the registry |
| 270 | 24 | !ifdef unstable |
| 271 | 195 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\CalliopeUnstable" \ |
| 272 | "DisplayName" "Calliope Testing (remove only)" | |
| 273 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\CalliopeUnstable" \ | |
| 274 | "UninstallString" "$INSTDIR\Uninstall.exe" | |
| 275 | WriteRegStr HKLM "Software\CalliopeUnstable" "InstallPath" "$INSTDIR" | |
| 276 | 24 | !else |
| 277 | 195 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Calliope" \ |
| 278 | "DisplayName" "Calliope (remove only)" | |
| 279 | WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Calliope" \ | |
| 280 | "UninstallString" "$INSTDIR\Uninstall.exe" | |
| 281 | WriteRegStr HKLM "Software\Calliope" "InstallPath" "$INSTDIR" | |
| 282 | 24 | !endif |
| 283 | 305 | |
| 284 | 24 | ;WriteRegStr HKCR "*\shell\OpenWithGeany" "" "Open with Geany" |
| 285 | ;WriteRegStr HKCR "*\shell\OpenWithGeany\command" "" '$INSTDIR\geany.exe "%1"' | |
| 286 | 305 | |
| 287 | 2 | WriteUninstaller "$INSTDIR\uninstall.exe" |
| 288 | SectionEnd | |
| 289 | ||
| 290 | ;; FIXME: does this work? | |
| 291 | Section "Uninstall" | |
| 292 | 305 | RMDir /r "$INSTDIR\*.*" |
| 293 | 2 | RMDir "$INSTDIR" |
| 294 | 305 | |
| 295 | 24 | Delete "$DESKTOP_SHORCUT" |
| 296 | Delete "${SMDIR}\*.*" | |
| 297 | RmDir "${SMDIR}" | |
| 298 | 305 | |
| 299 | 24 | !ifdef unstable |
| 300 | 195 | DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Calliope" |
| 301 | 305 | DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\CalliopeUnstable" |
| 302 | 24 | !else |
| 303 | 305 | DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Calliope" |
| 304 | DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Calliope" | |
| 305 | 24 | !endif |
| 306 | 2 | SectionEnd |
| 307 | ||
| 308 | 165 | Function KillExisting |
| 309 | KillProcDLL::KillProc "calliope.exe" | |
| 310 | KillProcDLL::KillProc "gconfd-2.exe" | |
| 311 | FunctionEnd | |
| 312 | ||
| 313 | ||
| 314 | 2 | # From http://nsis.sourceforge.net/Another_String_Replace_%28and_Slash/BackSlash_Converter%29 (Author: dirtydingus) |
| 315 | Function StrSlash | |
| 316 | Exch $R3 ; $R3 = needle ("\" or "/") | |
| 317 | Exch | |
| 318 | Exch $R1 ; $R1 = String to replacement in (haystack) | |
| 319 | Push $R2 ; Replaced haystack | |
| 320 | Push $R4 ; $R4 = not $R3 ("/" or "\") | |
| 321 | Push $R6 | |
| 322 | Push $R7 ; Scratch reg | |
| 323 | StrCpy $R2 "" | |
| 324 | StrLen $R6 $R1 | |
| 325 | StrCpy $R4 "\" | |
| 326 | StrCmp $R3 "/" loop | |
| 327 | 305 | StrCpy $R4 "/" |
| 328 | 2 | loop: |
| 329 | StrCpy $R7 $R1 1 | |
| 330 | StrCpy $R1 $R1 $R6 1 | |
| 331 | StrCmp $R7 $R3 found | |
| 332 | StrCpy $R2 "$R2$R7" | |
| 333 | StrCmp $R1 "" done loop | |
| 334 | found: | |
| 335 | StrCpy $R2 "$R2$R4" | |
| 336 | StrCmp $R1 "" done loop | |
| 337 | done: | |
| 338 | StrCpy $R3 $R2 | |
| 339 | Pop $R7 | |
| 340 | Pop $R6 | |
| 341 | Pop $R4 | |
| 342 | Pop $R2 | |
| 343 | Pop $R1 | |
| 344 | Exch $R3 | |
| 345 | 7 | FunctionEnd |
Loggerhead is a web-based interface for Bazaar branches