From d744b13b174595be7bd5eab748b2201d54f7d036 Mon Sep 17 00:00:00 2001
From: McCabe Maxsted
Date: Sat, 9 Jan 2010 09:13:14 -0700
Subject: Fixed viewer_manifest.py and default packaging system for Windows
 (NSIS install script only works manually)

---
 ChangeLog.txt                                      |  12 ++
 linden/indra/develop.py                            |   4 +-
 linden/indra/lib/python/indra/util/llmanifest.py   |  13 ++-
 linden/indra/newview/CMakeLists.txt                |   2 +-
 .../installers/windows/installer_template.nsi      |   4 +-
 linden/indra/newview/viewer_manifest.py            | 130 +++++++++++++++------
 6 files changed, 120 insertions(+), 45 deletions(-)

diff --git a/ChangeLog.txt b/ChangeLog.txt
index c7f2d91..cbbf4d9 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,3 +1,15 @@
+2010-01-09 McCabe Maxsted  <hakushakukun@gmail.com>
+
+	* Fixed viewer_manifest.py and default packaging system for Windows 
+	  NSIS install script only works manually.
+	
+	  modified:   linden/indra/develop.py
+	  modified:   linden/indra/lib/python/indra/util/llmanifest.py
+	  modified:   linden/indra/newview/CMakeLists.txt
+	  modified:   linden/indra/newview/installers/windows/installer_template.nsi
+	  modified:   linden/indra/newview/viewer_manifest.py
+
+
 2010-01-08 McCabe Maxsted  <hakushakukun@gmail.com>
 
 	* Fixed options missing from Text Chat and Input & Camera preferences (see VWR-13120).
diff --git a/linden/indra/develop.py b/linden/indra/develop.py
index 8ea435c..31dcb6a 100755
--- a/linden/indra/develop.py
+++ b/linden/indra/develop.py
@@ -520,12 +520,14 @@ class WindowsSetup(PlatformSetup):
             unattended=self.unattended,
             project_name=self.project_name
             )
-        #if simple:
+        # default to packaging enabled
+        # if simple:
         #    return 'cmake %(opts)s "%(dir)s"' % args
         return ('cmake -G "%(generator)s" '
                 '-DSTANDALONE:BOOL=%(standalone)s '
                 '-DUNATTENDED:BOOL=%(unattended)s '
                 '-DROOT_PROJECT_NAME:STRING=%(project_name)s '
+                '-DPACKAGE:BOOL=ON '
                 '%(opts)s "%(dir)s"' % args)
 
     def find_visual_studio(self, gen=None):
diff --git a/linden/indra/lib/python/indra/util/llmanifest.py b/linden/indra/lib/python/indra/util/llmanifest.py
index 59c84e5..369cc81 100644
--- a/linden/indra/lib/python/indra/util/llmanifest.py
+++ b/linden/indra/lib/python/indra/util/llmanifest.py
@@ -81,10 +81,11 @@ def get_default_version(srctree):
     for p in paths:
         if os.path.exists(p):
             contents = open(p, 'r').read()
-            major = re.search("LL_VERSION_MAJOR\s=\s([0-9]+)", contents).group(1)
-            minor = re.search("LL_VERSION_MINOR\s=\s([0-9]+)", contents).group(1)
-            patch = re.search("LL_VERSION_PATCH\s=\s([0-9]+)", contents).group(1)
-            build = re.search("LL_VERSION_BUILD\s=\s([0-9]+)", contents).group(1)
+            major = re.search("IMP_VERSION_MAJOR\s=\s([0-9]+)", contents).group(1)
+            minor = re.search("IMP_VERSION_MINOR\s=\s([0-9]+)", contents).group(1)
+            patch = re.search("IMP_VERSION_PATCH\s=\s([0-9]+)", contents).group(1)
+            #build = re.search("LL_VERSION_BUILD\s=\s([0-9]+)", contents).group(1)
+	    build = re.search('const char \* const IMP_VERSION_TEST = "(.*)";', contents).group(1)
             return major, minor, patch, build
 
 def get_channel(srctree):
@@ -98,7 +99,7 @@ def get_channel(srctree):
     
 
 DEFAULT_SRCTREE = os.path.dirname(sys.argv[0])
-DEFAULT_CHANNEL = 'Second Life Release'
+DEFAULT_CHANNEL = 'Imprudence'
 
 ARGUMENTS=[
     dict(name='actions',
@@ -156,7 +157,7 @@ ARGUMENTS=[
         for use by a .bat file.""",
          default=None),
     dict(name='version',
-         description="""This specifies the version of Second Life that is
+         description="""This specifies the version of Imprudence that is
         being packaged up.""",
          default=get_default_version)
     ]
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt
index a696f6e..e451465 100644
--- a/linden/indra/newview/CMakeLists.txt
+++ b/linden/indra/newview/CMakeLists.txt
@@ -1442,7 +1442,7 @@ if (WINDOWS)
           --source=${CMAKE_CURRENT_SOURCE_DIR}
               --artwork=${ARTWORK_DIR}
               --build=${CMAKE_CURRENT_BINARY_DIR}
-              --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
+              --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/package
               --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/touched.bat
         DEPENDS ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
         )
diff --git a/linden/indra/newview/installers/windows/installer_template.nsi b/linden/indra/newview/installers/windows/installer_template.nsi
index 32aefda..8afde89 100644
--- a/linden/indra/newview/installers/windows/installer_template.nsi
+++ b/linden/indra/newview/installers/windows/installer_template.nsi
@@ -51,8 +51,8 @@ Name ${INSTNAME}
 SubCaption 0 $(LicenseSubTitleSetup)	; override "license agreement" text
 
 BrandingText " "						; bottom of window text
-Icon          %%SOURCE%%\installers\windows\install_icon.ico
-UninstallIcon %%SOURCE%%\installers\windows\uninstall_icon.ico
+Icon          %%SOURCE%%\res\imp_icon.ico
+UninstallIcon %%SOURCE%%\res\imp_icon.ico
 WindowIcon on							; show our icon in left corner
 BGGradient off							; no big background window
 CRCCheck on								; make sure CRC is OK
diff --git a/linden/indra/newview/viewer_manifest.py b/linden/indra/newview/viewer_manifest.py
index 8510dc4..d7acfea 100755
--- a/linden/indra/newview/viewer_manifest.py
+++ b/linden/indra/newview/viewer_manifest.py
@@ -30,6 +30,13 @@
 # WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
 # COMPLETENESS OR PERFORMANCE.
 # $/LicenseInfo$
+
+# DO NOT RUN THIS FILE DIRECTLY
+# Instead, run develop.py with "configure -DPACKAGE:BOOL=ON" e.g.:
+#   develop.py -G vc80 configure -DPACKAGE:BOOL=ON
+# to generate the "package" project in Visual Studio 2005
+# Note: as of Imprudence 1.3, this defaults to on for Windows
+
 import sys
 import os.path
 import re
@@ -68,37 +75,33 @@ class ViewerManifest(LLManifest):
 
         # Include our fonts
         if self.prefix(src="fonts"):
-            self.path("LiberationSans-Bold.ttf")
-            self.path("LiberationSans-Regular.ttf")
-            self.path("VeraMono.ttf")
+            self.path("*.ttf")
             self.path("*.txt")
             self.end_prefix("fonts")
 
         # skins
         if self.prefix(src="skins"):
-            self.path("paths.xml")
-            
-            # include the entire textures directory recursively
-            if self.prefix(src="*/textures"):
-                self.path("*.tga")
-                self.path("*.j2c")
-                self.path("*.jpg")
-                self.path("*.png")
-                self.path("textures.xml")
-                self.end_prefix("*/textures")
-
-            self.path("*/xui/*/*.xml")
-            self.path("*/*.xml")
-
-            # Local HTML files (e.g. loading screen)
-            if self.prefix(src="*/html"):
-                self.path("*.png")
-                self.path("*/*/*.html")
-                self.path("*/*/*.gif")
-                self.end_prefix("*/html")
+                self.path("paths.xml")
+                # include the entire textures directory recursively
+                if self.prefix(src="*/textures"):
+                        self.path("*.tga")
+                        self.path("*.j2c")
+                        self.path("*.jpg")
+                        self.path("*.png")
+                        self.path("textures.xml")
+                        self.end_prefix("*/textures")
+                self.path("*/xui/*/*.xml")
+                self.path("*/*.xml")
                 
-            self.end_prefix("skins")
-            
+                # Local HTML files (e.g. loading screen)
+                if self.prefix(src="*/html"):
+                        self.path("*.png")
+                        self.path("*/*/*.html")
+                        self.path("*/*/*.gif")
+                        self.end_prefix("*/html")
+                self.end_prefix("skins")
+        
+        # Files in the newview/ directory
         self.path("gpu_table.txt")
 
 
@@ -140,7 +143,7 @@ class ViewerManifest(LLManifest):
     def channel(self):
         return self.args['channel']
     def channel_unique(self):
-        return self.channel().replace("Second Life", "").strip()
+        return self.channel().replace("Imprudence", "").strip()
     def channel_oneword(self):
         return "".join(self.channel_unique().split())
     def channel_lowerword(self):
@@ -236,16 +239,16 @@ class WindowsManifest(ViewerManifest):
             self.end_prefix()
 
         # The config file name needs to match the exe's name.
-        self.path(src="%s/secondlife-bin.exe.config" % self.args['configuration'], dst=self.final_exe() + ".config")
+        self.path(src="%s/imprudence-bin.exe.config" % self.args['configuration'], dst=self.final_exe() + ".config")
 
         # We need this one too, so that llkdu loads at runtime - DEV-41194
-        self.path(src="%s/secondlife-bin.exe.config" % self.args['configuration'], dst="llkdu.dll.2.config")
+        self.path(src="%s/imprudence-bin.exe.config" % self.args['configuration'], dst="llkdu.dll.2.config")
 
         # We need this one too, so that win_crash_logger.exe loads at runtime - DEV-19004
-        self.path(src="%s/secondlife-bin.exe.config" % self.args['configuration'], dst="win_crash_logger.exe.config")
+        self.path(src="%s/imprudence-bin.exe.config" % self.args['configuration'], dst="win_crash_logger.exe.config")
 
         # same thing for auto-updater.
-        self.path(src="%s/secondlife-bin.exe.config" % self.args['configuration'], dst="updater.exe.config")
+        self.path(src="%s/imprudence-bin.exe.config" % self.args['configuration'], dst="updater.exe.config")
 
         # Mozilla runtime DLLs (CP)
         if self.prefix(src="../../libraries/i686-win32/lib/release", dst=""):
@@ -276,9 +279,9 @@ class WindowsManifest(ViewerManifest):
         # Mozilla hack to get it to accept newer versions of msvc*80.dll than are listed in manifest
         # necessary as llmozlib2-vc80.lib refers to an old version of msvc*80.dll - can be removed when new version of llmozlib is built - Nyx
         # Vivox runtimes
-        if self.prefix(src="vivox-runtime/i686-win32", dst=""):
+        #if self.prefix(src="vivox-runtime/i686-win32", dst=""):
         #    self.path("alut.dll")
-            self.path("wrap_oal.dll")
+        #    self.path("wrap_oal.dll")
 
         #    self.path("SLVoice.exe")
         #    self.path("SLVoiceAgent.exe")
@@ -289,8 +292,65 @@ class WindowsManifest(ViewerManifest):
         #    self.path("vivoxsdk.dll")
         #    self.path("ortp.dll")
 
+        #    self.end_prefix()
+
+        # Gstreamer plugins
+        if self.prefix(src="lib/gstreamer-plugins", dst=""):
+            self.path("*.dll", dst="lib/gstreamer-plugins/*.dll")
             self.end_prefix()
 
+        # Gstreamer libs
+        if self.prefix(src="../../libraries/i686-win32/lib/release", dst=""):
+            self.path("iconv.dll")
+            self.path("libxml2.dll")
+            self.path("libcairo-2.dll")
+            self.path("libgio-2.0-0.dll")
+            self.path("libglib-2.0-0.dll")
+            self.path("libgmodule-2.0-0.dll")
+            self.path("libgobject-2.0-0.dll")
+            self.path("libgthread-2.0-0.dll")
+            self.path("charset.dll")
+            self.path("intl.dll")
+            self.path("libgcrypt-11.dll")
+            self.path("libgnutls-26.dll")
+            self.path("libgpg-error-0.dll")
+            self.path("libgstapp.dll")
+            self.path("libgstaudio.dll")
+            self.path("libgstbase-0.10.dll")
+            self.path("libgstcdda.dll")
+            self.path("libgstcontroller-0.10.dll")
+            self.path("libgstdataprotocol-0.10.dll")
+            self.path("libgstdshow.dll")
+            self.path("libgstfft.dll")
+            self.path("libgstinterfaces.dll")
+            self.path("libgstnet-0.10.dll")
+            self.path("libgstnetbuffer.dll")
+            self.path("libgstpbutils.dll")
+            self.path("libgstreamer-0.10.dll")
+            self.path("libgstriff.dll")
+            self.path("libgstrtp.dll")
+            self.path("libgstrtsp.dll")
+            self.path("libgstsdp.dll")
+            self.path("libgsttag.dll")
+            self.path("libgstvideo.dll")
+            self.path("libjpeg.dll")
+            self.path("libmp3lame-0.dll")
+            self.path("libneon-27.dll")
+            self.path("libogg-0.dll")
+            self.path("liboil-0.3-0.dll")
+            self.path("libopenjpeg-2.dll")
+            self.path("libpng12-0.dll")
+            self.path("libschroedinger-1.0-0.dll")
+            self.path("libspeex-1.dll")
+            self.path("libtheora-0.dll")
+            self.path("libvorbis-0.dll")
+            self.path("libvorbisenc-2.dll")
+            self.path("libxml2-2.dll")
+            self.path("glew32.dll")
+            self.path("xvidcore.dll")
+            self.path("zlib1.dll")
+            self.end_prefix()            
+
 #        # pull in the crash logger and updater from other projects
 #        self.path(src=self.find_existing_file( # tag:"crash-logger" here as a cue to the exporter
 #                "../win_crash_logger/debug/windows-crash-logger.exe",
@@ -355,9 +415,9 @@ class WindowsManifest(ViewerManifest):
     def package_finish(self):
         # a standard map of strings for replacing in the templates
         substitution_strings = {
-            'version' : '.'.join(self.args['version']),
-            'version_short' : '.'.join(self.args['version'][:-1]),
-            'version_dashes' : '-'.join(self.args['version']),
+            'version' : '.'.join(self.args['version']).replace(' ', '_'),
+            'version_short' : '.'.join(self.args['version'][:-1]).replace(' ', '_'),
+            'version_dashes' : '-'.join(self.args['version']).replace(' ', '_'),
             'final_exe' : self.final_exe(),
             'grid':self.args['grid'],
             'grid_caps':self.args['grid'].upper(),
-- 
cgit v1.1