From 7d8b9e21f6ea005d10827ae32e901d722ec08847 Mon Sep 17 00:00:00 2001
From: Bjørn Lindeijer <bjorn@lindeijer.nl>
Date: Wed, 13 May 2009 23:36:52 +0200
Subject: Dynamically download the music when selected

This way we don't need to include the music in each Windows installer,
and people can avoid the extra megabytes when they don't care about the
music.

Patch provided by QOAL.
---
 packaging/windows/setup.nsi | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

(limited to 'packaging')

diff --git a/packaging/windows/setup.nsi b/packaging/windows/setup.nsi
index 8dbbcfce..495dda3c 100644
--- a/packaging/windows/setup.nsi
+++ b/packaging/windows/setup.nsi
@@ -182,10 +182,14 @@ Section "Core files (required)" SecCore
   File "${SRCDIR}\docs\FAQ.txt"
 SectionEnd
 
-Section "Music" SecMusic
+Section /o "Music" SecMusic
+  AddSize 17602
   CreateDirectory "$INSTDIR\data\music"
   SetOutPath "$INSTDIR\data\music"
-  File /nonfatal "${SRCDIR}\data\music\*.ogg"
+  NSISdl::download "http://downloads.sourceforge.net/themanaworld/tmwmusic-0.2.tar.gz" "$TEMP\tmwmusic-0.2.tar.gz"
+  ;Requires an additional plugin from http://nsis.sourceforge.net/UnTGZ_plug-in  Place untgz.dll in your nsis/plugin dir
+  untgz::extract -j -d "$INSTDIR\data\music" "$TEMP\tmwmusic-0.2.tar.gz"
+  Delete "$TEMP\tmwmusic-0.2.tar.gz"
 SectionEnd
 
 Section "Translations" SecTrans
@@ -196,7 +200,7 @@ SectionEnd
 ;Package descriptions
 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
   !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} "The core program files."
-  !insertmacro MUI_DESCRIPTION_TEXT ${SecMusic} "Background music."
+  !insertmacro MUI_DESCRIPTION_TEXT ${SecMusic} "Background music. (If selected the music will be downloaded from the internet.)"
   !insertmacro MUI_DESCRIPTION_TEXT ${SecTrans} "Translations for the user interface into 23 different languages. Uncheck this component to leave it in English."
 !insertmacro MUI_FUNCTION_DESCRIPTION_END
 
-- 
cgit v1.2.3-70-g09d2