[gnue] r9791 - trunk/gnue-reports/packaging/win32

[email protected]
Newsgroups gmane.comp.cms.gnue.cvs
Message-ID <[email protected]>
Author: johannes
Date: 2007-10-02 07:18:39 -0500 (Tue, 02 Oct 2007)
New Revision: 9791

Added:
   trunk/gnue-reports/packaging/win32/gnue-reports.iss.dist_template
   trunk/gnue-reports/packaging/win32/setup.cmd
   trunk/gnue-reports/packaging/win32/setup.py
Removed:
   trunk/gnue-reports/packaging/win32/gnue-reports.iss
Log:
Building packaging environment for win32 setup.exe


Deleted: trunk/gnue-reports/packaging/win32/gnue-reports.iss
===================================================================
--- trunk/gnue-reports/packaging/win32/gnue-reports.iss	2007-10-02 11:49:03 UTC (rev 9790)
+++ trunk/gnue-reports/packaging/win32/gnue-reports.iss	2007-10-02 12:18:39 UTC (rev 9791)
@@ -1,85 +0,0 @@
-; Script generated by the Inno Setup Script Wizard.
-; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
-
-[Setup]
-AppId=GNUe-Reports
-AppName=<application name>
-AppVerName=<application name and version>
-AppPublisher=GNU Enterprise
-AppPublisherURL=http://www.gnuenterprise.org
-AppSupportURL=http://www.gnuenterprise.org
-AppUpdatesURL=http://www.gnuenterprise.org
-DefaultDirName={pf}\GNUe\
-DefaultGroupName=GNUe
-AllowNoIcons=true
-LicenseFile=c:\gnue\LICENSE.txt
-ChangesAssociations=true
-CreateAppDir=true
-ShowLanguageDialog=yes
-OutputBaseFilename=<filename of setup file>
-DisableDirPage=true
-
-[Tasks]
-Name: desktopicon; Description: Create a &desktop icon; GroupDescription: Additional icons:; MinVersion: 4,4
-
-[Components]
-Name: main; Description: Shared Program Files; Types: full compact custom; Flags: fixed
-Name: doc; Description: Documentation; Types: full
-Name: translations; Description: Translations; Types: full
-
-[Files]
-Source: c:\gnue\bin\gnue-reports.exe; DestDir: {app}\bin; Components: main; Flags: ignoreversion
-Source: c:\gnue\bin\gnue-reports-server.exe; DestDir: {app}\bin; Components: main; Flags: ignoreversion
-Source: c:\gnue\bin\gnue\reports\*.*; DestDir: {app}\bin\gnue\reports; Flags: recursesubdirs ignoreversion; Components: main
-Source: C:\gnue\etc\sample.report-filters.conf; DestDir: {app}\etc; Components: main; Flags: ignoreversion
-Source: C:\gnue\etc\report-filters.conf; DestDir: {app}\etc; Components: main; Flags: onlyifdoesntexist
-Source: c:\gnue\share\locale\de\LC_MESSAGES\gnue-reports.mo; DestDir: {app}\share\locale\de\LC_MESSAGES\; Flags: recursesubdirs; Components: translations
-;Source: c:\gnue\share\locale\es_MX\LC_MESSAGES\gnue-reports.mo; DestDir: {app}\share\locale\es_MX\LC_MESSAGES\; Flags: recursesubdirs; Components: translations
-;Source: c:\gnue\share\locale\es_ES\LC_MESSAGES\gnue-reports.mo; DestDir: {app}\share\locale\es_ES\LC_MESSAGES\; Flags: recursesubdirs; Components: translations
-;Source: c:\gnue\share\locale\fr\LC_MESSAGES\gnue-reports.mo; DestDir: {app}\share\locale\fr\LC_MESSAGES\; Flags: recursesubdirs; Components: translations
-Source: c:\gnue\share\locale\hu\LC_MESSAGES\gnue-reports.mo; DestDir: {app}\share\locale\hu\LC_MESSAGES\; Flags: recursesubdirs; Components: translations
-;Source: c:\gnue\share\locale\lt\LC_MESSAGES\gnue-reports.mo; DestDir: {app}\share\locale\lt\LC_MESSAGES\; Flags: recursesubdirs; Components: translations
-;Source: c:\gnue\share\locale\ro\LC_MESSAGES\gnue-reports.mo; DestDir: {app}\share\locale\ro\LC_MESSAGES\; Flags: recursesubdirs; Components: translations
-;Source: c:\gnue\share\locale\ru\LC_MESSAGES\gnue-reports.mo; DestDir: {app}\share\locale\ru\LC_MESSAGES\; Flags: recursesubdirs; Components: translations
-Source: c:\gnue\share\doc\gnue-reports\*.*; DestDir: {app}\share\doc\gnue-reports; Flags: recursesubdirs; Components: doc
-Source: c:\gnue\share\gnue\filters\*.*; DestDir: {app}\share\gnue\filters; Flags: recursesubdirs; Components: main
-Source: c:\gnue\share\gnue\grpc\GRServer.grpc; DestDir: {app}\share\gnue\grpc; Components: main
-
-[Icons]
-;Name: {group}\Documentation\Reports Concepts Guide (PDF Format); Filename: {app}\share\doc\gnue-reports\Concepts-Guide.pdf; Components: doc
-
-[UninstallDelete]
-Name: {app}\bin\gnue\reports\*.*; Type: filesandordirs
-
-[Code]
-function GetPathInstalled(AppID: String): String;
-var
-   sPrevPath: String;
-begin
-  sPrevPath := '';
-  if not RegQueryStringValue( HKLM,
-    'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1',
-    'Inno Setup: App Path', sPrevpath) then
-    RegQueryStringValue( HKCU, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1' ,
-      'Inno Setup: App Path', sPrevpath);
-
-  Result := sPrevPath;
-end;
-
-
-function InitializeSetup(): Boolean;
-var
-	sPrevPath: String;
-	sPrevID: String;
-begin
-  sPrevID := 'GNUe-Tools';
-  sPrevPath := GetPathInstalled( sprevID );
-
-  if ( Length(sPrevPath) > 0 ) then
-    Result := true
-  else
-    begin
-      MsgBox( 'GNUe-Runtime-Environment is not installed!', mbInformation, MB_OK );
-      Result := false;
-    end;
-end;

Added: trunk/gnue-reports/packaging/win32/gnue-reports.iss.dist_template
===================================================================
--- trunk/gnue-reports/packaging/win32/gnue-reports.iss.dist_template	2007-10-02 11:49:03 UTC (rev 9790)
+++ trunk/gnue-reports/packaging/win32/gnue-reports.iss.dist_template	2007-10-02 12:18:39 UTC (rev 9791)
@@ -0,0 +1,86 @@
+; Script generated by the Inno Setup Script Wizard.
+; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
+
+[Setup]
+AppId=GNUe-Reports
+AppName=:TITLE:
+AppVerName=:TITLE: :VERSION:
+AppPublisher=GNU Enterprise
+AppPublisherURL=http://www.gnuenterprise.org
+AppSupportURL=http://www.gnuenterprise.org
+AppUpdatesURL=http://www.gnuenterprise.org
+DefaultDirName={pf}\GNUe\
+DefaultGroupName=GNUe
+AllowNoIcons=true
+LicenseFile=
+ChangesAssociations=true
+CreateAppDir=true
+ShowLanguageDialog=yes
+OutputDir=C:\GNUE\dist
+OutputBaseFilename=:PACKAGE:-:VERSION:
+DisableDirPage=true
+AppendDefaultDirName=false
+
+[Tasks]
+
+[Components]
+Name: main; Description: Shared Program Files; Types: full compact custom; Flags: fixed
+Name: doc; Description: Documentation; Types: full
+Name: translations; Description: Translations; Types: full
+
+[Files]
+Source: c:\gnue\bin\gnue-reports.exe; DestDir: {app}\bin; Components: main; Flags: ignoreversion
+Source: c:\gnue\bin\gnue-reports-server.exe; DestDir: {app}\bin; Components: main; Flags: ignoreversion
+Source: c:\gnue\bin\gnue\reports\*.*; DestDir: {app}\bin\gnue\reports; Flags: recursesubdirs ignoreversion; Components: main
+Source: c:\gnue\share\locale\gnue-reports.mo; DestDir: {app}\share\locale\; Flags: recursesubdirs createallsubdirs; Components: translations
+Source: c:\gnue\share\doc\gnue-reports\*.*; DestDir: {app}\share\doc\gnue-reports; Flags: recursesubdirs; Components: doc
+Source: c:\gnue\share\gnue\*.*; DestDir: {app}\share\gnue\; Components: main; Flags: recursesubdirs createallsubdirs
+
+[Icons]
+
+[Registry]
+; Place the associations for GRD files with GNUe Reports here (later)
+
+
+[UninstallDelete]
+Name: {app}\bin\gnue\reports\*.*; Type: filesandordirs
+
+[Code]
+function GetPathInstalled(AppID: String): String;
+var
+   sPrevPath: String;
+begin
+  sPrevPath := '';
+  if not RegQueryStringValue( HKLM,
+    'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1',
+    'Inno Setup: App Path', sPrevpath) then
+    RegQueryStringValue( HKCU, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1' ,
+      'Inno Setup: App Path', sPrevpath);
+
+  Result := sPrevPath;
+end;
+
+
+function InitializeSetup(): Boolean;
+var
+	sPrevPath: String;
+	sPrevID: String;
+begin
+  sPrevID := 'GNUe-Tools';
+  sPrevPath := GetPathInstalled( sprevID );
+
+  if ( Length(sPrevPath) > 0 ) then
+    Result := true
+  else
+    begin
+      MsgBox( 'GNUe-Runtime-Environment is not installed!', mbInformation, MB_OK );
+      Result := false;
+    end;
+
+  if (Length(GetPathInstalled('GNUe-Common')) > 0) then
+      Result := true
+  else begin
+      MsgBox('GNUe-Common is not installed!  Please install the GNUe-Common package in order to setup GNUe-Forms.', mbInformation, MB_OK);
+      Result := false;
+  end;
+end;

Added: trunk/gnue-reports/packaging/win32/setup.cmd
===================================================================
--- trunk/gnue-reports/packaging/win32/setup.cmd	2007-10-02 11:49:03 UTC (rev 9790)
+++ trunk/gnue-reports/packaging/win32/setup.cmd	2007-10-02 12:18:39 UTC (rev 9791)
@@ -0,0 +1,57 @@
+@ECHO OFF
+REM ---------------------------------------------------------------------------
+REM Create an Installer Package for GNUe Reports
+REM 
+REM $Id$
+REM ---------------------------------------------------------------------------
+
+REM ---------------------------------------------------------------------------
+REM Prepare the build environment
+REM ---------------------------------------------------------------------------
+
+@ECHO Setting up the build environment ...
+SET GNUE_PATH="C:\GNUE"
+
+IF EXIST %GNUE_PATH% (
+   RMDIR /S /Q %GNUE_PATH%
+)
+MKDIR %GNUE_PATH%
+MKDIR %GNUE_PATH%\Scripts
+
+COPY setup.py %GNUE_PATH%\Scripts
+COPY gnue-reports.iss %GNUE_PATH%\Scripts
+
+REM ---------------------------------------------------------------------------
+REM Install the package into the build environment
+REM ---------------------------------------------------------------------------
+
+CD ..\..
+@ECHO Installing the package into local build environment ...
+
+REM Note: We do *not* compile the py files here, because this would add a wrong
+REM path to the pyc-files, which in turn breaks translations later.
+
+python setup.py install --install-scripts=%GNUE_PATH%\Scripts --install-lib=%GNUE_PATH%\bin --install-data=%GNUE_PATH% --install-config=%GNUE_PATH%\etc --no-compile
+
+
+REM ---------------------------------------------------------------------------
+REM Compile everything into an exe
+REM ---------------------------------------------------------------------------
+
+CD packaging\win32
+
+@ECHO Building EXE-File ...
+PUSHD %GNUE_PATH%\Scripts
+
+python setup.py py2exe -c -d %GNUE_PATH%\bin
+
+POPD
+
+REM Catch the built EXE and clean up the build environment
+IF EXIST %GNUE_PATH%\dist\*.exe (
+    COPY %GNUE_PATH%\dist\*.exe .
+    RMDIR /S /Q %GNUE_PATH%
+    @ECHO Package completed
+)
+
+:EXIT


Property changes on: trunk/gnue-reports/packaging/win32/setup.cmd
___________________________________________________________________
Name: svn:keywords
   + Id

Added: trunk/gnue-reports/packaging/win32/setup.py
===================================================================
--- trunk/gnue-reports/packaging/win32/setup.py	2007-10-02 11:49:03 UTC (rev 9790)
+++ trunk/gnue-reports/packaging/win32/setup.py	2007-10-02 12:18:39 UTC (rev 9791)
@@ -0,0 +1,178 @@
+# GNU Enterprise Reports - Setup Script for py2exe
+#
+# Copyright 2001-2007 Free Software Foundation
+#
+# This file is part of GNU Enterprise
+#
+# GNU Enterprise is free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2, or (at your option) any later version.
+#
+# GNU Enterprise is distributed in the hope that it will be
+# useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+# PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with program; see the file COPYING. If not,
+# write to the Free Software Foundation, Inc., 59 Temple Place
+# - Suite 330, Boston, MA 02111-1307, USA.
+#
+# $Id$
+
+import os
+import sys
+import py2exe
+import win32api
+import win32con
+
+from distutils.core import setup
+
+# -----------------------------------------------------------------------------
+# Constants used by this setup
+# -----------------------------------------------------------------------------
+
+# The path where we are creating the build environment for the setup compiler
+GNUE_PATH='C:\\GNUE'            
+# The config files to rewrite (wrt line-ending)
+CFG_FILES = []
+# The InnoSetup configuration file
+ISS_FILE = 'gnue-reports.iss'
+
+# The manifest will be inserted as resource into .exe files.  This
+# gives the controls the Windows XP appearance (if run on XP).
+manifest = '''
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<assemblyIdentity
+    version="5.0.0.0"
+    processorArchitecture="x86"
+    name="Controls"
+    type="win32"
+/>
+<description>GNU Enterprise</description>
+<dependency>
+    <dependentAssembly>
+        <assemblyIdentity
+            type="win32"
+            name="Microsoft.Windows.Common-Controls"
+            version="6.0.0.0"
+            processorArchitecture="X86"
+            publicKeyToken="6595b64144ccf1df"
+            language="*"
+        />
+    </dependentAssembly>
+</dependency>
+</assembly>
+'''
+
+RT_MANIFEST = 24
+
+
+# -----------------------------------------------------------------------------
+# Create a list of all modules in the standard library
+# -----------------------------------------------------------------------------
+
+def getimports(libdir):
+    """
+    Returns a list of all modules in the standard python library.
+    """
+    importlist = []
+    for entry in os.listdir(libdir):
+        if entry.startswith('_') or '-' in entry or \
+           entry.count('.')>1 or ' ' in entry:
+            continue
+    
+        if not os.path.splitext(entry)[1] == '.py':
+            continue
+
+        importlist.append(entry[:entry.find('.')])
+
+    return importlist
+
+
+# -----------------------------------------------------------------------------
+# Run the setup to create all the exe files in the gnue-common package
+# -----------------------------------------------------------------------------
+def create_exe_files():
+    """
+    Create gnue-schema.exe (which is currently the only exe supplied by
+    gnue-common.
+    """
+
+    setup( \
+        windows = [{"script": "gnue-reports",
+                    "other_resources": [(RT_MANIFEST, 1, manifest)]}],
+        options = {"py2exe":
+            {"dll_excludes": ["msvcp60.dll",
+                              "tcl84.dll",
+                              "tk84.dll",
+                              "oci.dll"],
+             "excludes": ["gnue.reports", "wx", "mx", "PIL"]
+            }
+        }
+    )
+
+
+# -----------------------------------------------------------------------------
+# Finalize the build environment
+# -----------------------------------------------------------------------------
+
+def finalize_build_env():
+    """
+    Finalize the build environment ready to be processed by the setup compiler
+    """
+
+    for name in CFG_FILES:
+        fhd = open(os.path.join(GNUE_PATH, 'etc', 'sample.%s' % name))
+        data = [line.strip() for line in fhd.readlines()]
+        out = open(os.path.join(GNUE_PATH, 'etc', name), 'wb')
+        for line in data:
+            out.write('%s%s' % (line, os.linesep))
+        out.close()
+        fhd.close()
+
+
+# -----------------------------------------------------------------------------
+# Examine the registry to find out where the InnoSetup compiler is located
+# -----------------------------------------------------------------------------
+
+def get_istool():
+    root = win32con.HKEY_CLASSES_ROOT
+    item = "InnoSetupScriptFile\\shell\\OpenWithISTool"
+    try:
+        path = None
+        key = win32api.RegOpenKeyEx(root, item, 0, win32con.KEY_READ)
+        value = win32api.RegQueryValue(key, "command")
+        if isinstance(value, basestring):
+            path = value.split(' ', 1)[0]
+    except:
+        pass
+
+    return path
+
+# -----------------------------------------------------------------------------
+# Compile the setup
+# -----------------------------------------------------------------------------
+
+def compile_setup():
+    
+    istool = get_istool()
+    if not istool:
+        print "Cannot find ISTool.exe"
+        sys.exit(1)
+
+    cmd = '%s -compile %s' % (istool, ISS_FILE)
+    os.system(cmd)
+
+
+# =============================================================================
+# Main program
+# =============================================================================
+
+create_exe_files()
+
+finalize_build_env()
+
+compile_setup()


Property changes on: trunk/gnue-reports/packaging/win32/setup.py
___________________________________________________________________
Name: svn:keywords
   + Id
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.