From 5cd1ca7cb60e9a47cec8bf1e42d2584bad32bef2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali.rohar@gmail.com>
Date: Sun, 21 Nov 2010 15:27:21 +0100
Subject: [PATCH] Include debug version to Windows NSIS Installer

---
 build-win32-cross.sh | 12 ++++++++++++
 stratagus.nsi        |  3 +++
 2 files changed, 15 insertions(+)

diff --git a/build-win32-cross.sh b/build-win32-cross.sh
index e9840b782..94974f7fd 100755
--- a/build-win32-cross.sh
+++ b/build-win32-cross.sh
@@ -6,6 +6,12 @@ make distclean || exit 1
 make || exit 1
 make strip || exit 1
 #upx -9 stratagus.exe || exit 1
+mv stratagus.exe stratagus-rel.exe || exit 1
+make distclean || exit 1
+./autogen.sh || exit 1
+./configure --enable-win32 --host=x86_64-w64-mingw32 --prefix=/usr/x86_64-w64-mingw32 --enable-static --enable-debug --without-bzip2 --disable-stdio-redirect || exit 1
+make OUTFILE=stratagus-dbg.exe || exit 1
+mv stratagus-rel.exe stratagus.exe || exit 1
 makensis -DAMD64 stratagus.nsi || exit 1
 
 make distclean || exit 1
@@ -14,4 +20,10 @@ make distclean || exit 1
 make || exit 1
 make strip || exit 1
 upx -9 stratagus.exe || exit 1
+mv stratagus.exe stratagus-rel.exe || exit 1
+make distclean || exit 1
+./autogen.sh || exit 1
+./configure --enable-win32 --host=i686-w64-mingw32 --prefix=/usr/i686-w64-mingw32 --enable-static --enable-debug --without-bzip2 --disable-stdio-redirect || exit 1
+make OUTFILE=stratagus-dbg.exe || exit 1
+mv stratagus-rel.exe stratagus.exe || exit 1
 makensis stratagus.nsi || exit 1
diff --git a/stratagus.nsi b/stratagus.nsi
index 7b6afa565..e4126dfc3 100644
--- a/stratagus.nsi
+++ b/stratagus.nsi
@@ -33,6 +33,7 @@
 
 !define ICON "contrib/stratagus.ico"
 !define STRATAGUS "stratagus.exe"
+!define STRATAGUSDBG "stratagus-dbg.exe"
 !define UNINSTALL "uninstall.exe"
 !define INSTALLER "${NAME}-${VERSION}.exe"
 !define INSTALLDIR "$PROGRAMFILES\${NAME}\"
@@ -177,6 +178,7 @@ Section "${NAME}"
 
 	SetOutPath $INSTDIR
 	File "${STRATAGUS}"
+	File "${STRATAGUSDBG}"
 	WriteRegStr HKLM "${REGKEY}" "DisplayName" "${NAME}"
 	WriteRegStr HKLM "${REGKEY}" "UninstallString" "$\"$INSTDIR\${UNINSTALL}$\""
 	WriteRegStr HKLM "${REGKEY}" "QuietUninstallString" "$\"$INSTDIR\${UNINSTALL}$\" /S"
@@ -202,6 +204,7 @@ Section "un.${NAME}" Executable
 	SectionIn RO
 
 	Delete "$INSTDIR\${STRATAGUS}"
+	Delete "$INSTDIR\${STRATAGUSDBG}"
 	Delete "$INSTDIR\${UNINSTALL}"
 	RMDir "$INSTDIR"
 	DeleteRegKey /ifempty HKLM "${REGKEY}"