From 7879770ea7cfdcae8e3c751b70e6d2d6bc33f8ec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Brammer?= <gbrammer@gmx.de>
Date: Mon, 31 Oct 2011 01:31:56 +0100
Subject: [PATCH 07/10] win32: Fill in Games Explorer XML data from
 Version.txt

---
 Makefile.am                                        |    3 +++
 Version.txt                                        |    5 ++++-
 ...mesExplorer.xml => WindowsGamesExplorer.xml.in} |    8 ++++----
 tools/install/oc.nsi                               |    4 +++-
 4 files changed, 14 insertions(+), 6 deletions(-)
 rename src/res/{WindowsGamesExplorer.xml => WindowsGamesExplorer.xml.in} (75%)

diff --git a/Makefile.am b/Makefile.am
index be973b2..adf7ecb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -85,6 +85,9 @@ do_subst = sed -e 's,[@]C4PROJECT[@],'"$$(sed -n 's/SET(C4PROJECT\s\+"\(.\+\)")/
 
 C4Version.h: $(srcdir)/src/C4Version.h.in $(srcdir)/Version.txt
 	$(do_subst) < $< > $@
+WindowsGamesExplorer.xml: $(srcdir)/src/res/WindowsGamesExplorer.xml.in $(srcdir)/Version.txt
+	$(do_subst) < $< > $@
+src/res/engine.o: WindowsGamesExplorer.xml
 
 #various hacks to get dependency tracking working with a precompiled C4Include
 if RECENT_GCC
diff --git a/Version.txt b/Version.txt
index 80dc466..78bdf78 100644
--- a/Version.txt
+++ b/Version.txt
@@ -74,4 +74,7 @@ else()
 endif()
 
 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/src/C4Version.h.in ${CMAKE_CURRENT_BINARY_DIR}/C4Version.h ESCAPE_QUOTES)
-
+if(WIN32)
+	#FIXME: make the resource compiler find this in the BINARY_DIR somehow
+	CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/src/res/WindowsGamesExplorer.xml.in ${CMAKE_CURRENT_SOURCE_DIR}/src/res/WindowsGamesExplorer.xml ESCAPE_QUOTES)
+endif()
diff --git a/src/res/WindowsGamesExplorer.xml b/src/res/WindowsGamesExplorer.xml.in
similarity index 75%
rename from src/res/WindowsGamesExplorer.xml
rename to src/res/WindowsGamesExplorer.xml.in
index d4f5a72..193fec6 100644
--- a/src/res/WindowsGamesExplorer.xml
+++ b/src/res/WindowsGamesExplorer.xml.in
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <GameDefinitionFile xmlns:baseTypes="urn:schemas-microsoft-com:GamesExplorerBaseTypes.v1" xmlns="urn:schemas-microsoft-com:GameDescription.v1">
     <GameDefinition gameID="{C90AA63B-E8DB-4EAF-88EC-B5257A86FF5A}">
-        <Name>OpenClonk</Name>
+        <Name>@C4ENGINENAME@</Name>
         <Genres>
             <Genre>Action</Genre>
             <Genre>Strategy</Genre>
@@ -9,9 +9,9 @@
         <Version>
             <VersionFile path="Clonk.exe" />
         </Version>
-        <SavedGames baseKnownFolderID="{f1b32785-6fba-4fcf-9d55-7b8e7f157091}" path="OpenClonk" />
+        <SavedGames baseKnownFolderID="{f1b32785-6fba-4fcf-9d55-7b8e7f157091}" path="@C4ENGINENAME@" />
         <Developers>
-            <Developer URI="http://openclonk.org">OpenClonk Project</Developer>
+            <Developer URI="@C4PROJECT_URL@">@C4PROJECT@</Developer>
         </Developers>
     </GameDefinition>
-</GameDefinitionFile>
\ No newline at end of file
+</GameDefinitionFile>
diff --git a/tools/install/oc.nsi b/tools/install/oc.nsi
index df05750..25d23e7 100644
--- a/tools/install/oc.nsi
+++ b/tools/install/oc.nsi
@@ -105,8 +105,10 @@ Section
   ${GameExplorer_AddGame} $MultiUser.InstallMode $INSTDIR\Clonk.exe $INSTDIR $INSTDIR\Clonk.exe ${PRODUCT_GAME_EXPLORER_INSTANCE}
 
   IfErrors StartMenu 0
+    CreateDirectory $APPDATA\Microsoft\Windows\GameExplorer\${PRODUCT_GAME_EXPLORER_INSTANCE}\PlayTasks\1
+    CreateShortcut $APPDATA\Microsoft\Windows\GameExplorer\${PRODUCT_GAME_EXPLORER_INSTANCE}\PlayTasks\1\Editor.lnk $INSTDIR\Clonk.exe --editor
     CreateDirectory $APPDATA\Microsoft\Windows\GameExplorer\${PRODUCT_GAME_EXPLORER_INSTANCE}\SupportTasks\0
-    CreateShortcut $APPDATA\Microsoft\Windows\GameExplorer\${PRODUCT_GAME_EXPLORER_INSTANCE}\SupportTasks\0\Editor.lnk $INSTDIR\Clonk.exe --editor
+    CreateShortcut "$APPDATA\Microsoft\Windows\GameExplorer\${PRODUCT_GAME_EXPLORER_INSTANCE}\SupportTasks\0\${PRODUCT_WEB_SITE_NAME}.lnk" "$INSTDIR\${PRODUCT_WEB_SITE_NAME}.url"
     goto EndStartMenu
 
   StartMenu:
-- 
1.7.7.1

