[Avida-cvs] [avida-svn] r481 - branches/developers/avida-edward/source/python/scripts/win32

gerrishj@myxo.css.msu.edu gerrishj at myxo.css.msu.edu
Thu Feb 23 19:00:54 PST 2006


Author: gerrishj
Date: 2006-02-23 22:00:54 -0500 (Thu, 23 Feb 2006)
New Revision: 481

Added:
   branches/developers/avida-edward/source/python/scripts/win32/setup.nsi
   branches/developers/avida-edward/source/python/scripts/win32/setup.py
Modified:
   branches/developers/avida-edward/source/python/scripts/win32/README
Log:
Added Windows py2exe packager script and NSIS installer script.
Updated README.


Modified: branches/developers/avida-edward/source/python/scripts/win32/README
===================================================================
--- branches/developers/avida-edward/source/python/scripts/win32/README	2006-02-22 20:22:51 UTC (rev 480)
+++ branches/developers/avida-edward/source/python/scripts/win32/README	2006-02-24 03:00:54 UTC (rev 481)
@@ -1,5 +1,8 @@
 Included in this directory are support scripts to assist in building under
 Windows.
 
-The two fix- scripts should be run in:
-build/source/bindings/Boost.Python/CMakeFiles/AvidaCore
+mingw-setupshell.sh will setup the PATH and other environment variables for MinGW.
+
+setup.py is the py2exe setup script.  Run with: python setup.py py2exe
+
+setup.nsi is a NSIS installer script that unpacks the executable to a temporary directory and sets up the default workspace.  Run with: makensis setup.nsi

Added: branches/developers/avida-edward/source/python/scripts/win32/setup.nsi
===================================================================
--- branches/developers/avida-edward/source/python/scripts/win32/setup.nsi	2006-02-22 20:22:51 UTC (rev 480)
+++ branches/developers/avida-edward/source/python/scripts/win32/setup.nsi	2006-02-24 03:00:54 UTC (rev 481)
@@ -0,0 +1,44 @@
+; 
+; NSIS installer to package up the Avida-ED executable created by py2exe
+; This allows distributing the default.workspace with the executable
+; Also, more control over where things get unpacked and installed.
+;
+
+!define py2exeOutputDir 'dist'
+!define exe             'Avida-ED.exe'
+!define icon            'C:\Python24\py.ico'
+; !define compressor      'lzma'  ;one of 'zlib', 'bzip2', 'lzma'
+!define onlyOneInstance 
+ 
+; - - - - do not edit below this line, normaly - - - - 
+!ifdef compressor 
+    SetCompressor ${compressor} 
+!else 
+    SetCompress Off 
+!endif 
+Name ${exe} 
+OutFile ${exe} 
+SilentInstall silent 
+!ifdef icon 
+    Icon ${icon} 
+!endif 
+ 
+; - - - - Allow only one installer instance - - - -  
+!ifdef onlyOneInstance 
+Function .onInit 
+ System::Call "kernel32::CreateMutexA(i 0, i 0, t '$(^Name)') i .r0 ?e" 
+ Pop $0 
+ StrCmp $0 0 launch 
+  Abort 
+ launch: 
+FunctionEnd 
+!endif 
+; - - - - Allow only one installer instance - - - -  
+ 
+Section 
+    InitPluginsDir 
+    SetOutPath '$PLUGINSDIR' 
+    File /r '${py2exeOutputDir}\*.*' 
+    ;SetOutPath '$EXEDIR'        ; uncomment this line to start the exe in the PLUGINSDIR 
+    nsExec::Exec $PLUGINSDIR\${exe} 
+SectionEnd

Added: branches/developers/avida-edward/source/python/scripts/win32/setup.py
===================================================================
--- branches/developers/avida-edward/source/python/scripts/win32/setup.py	2006-02-22 20:22:51 UTC (rev 480)
+++ branches/developers/avida-edward/source/python/scripts/win32/setup.py	2006-02-24 03:00:54 UTC (rev 481)
@@ -0,0 +1,42 @@
+#!/usr/bin/python
+#
+# Windows py2exe setup script
+# Usage: python setup.py py2exe
+#
+
+from distutils.core import setup
+import py2exe
+import os
+
+opts = {
+    "py2exe": {
+        "includes": "sip",
+        "packages": "AvidaGui2",
+        "bundle_files": 1
+    }
+}
+
+def recurse_dir(dir, filter, ltrim):
+    "Recursively return list of files in directory.  filter is a functino to filter the directories and ltrim will trim off n characters from the directory."
+    l = []
+    for root, newdir, files in os.walk(dir):
+        if filter(root):
+            for file in files:
+                if len(dir) >= root:
+                    l.append(file)
+                else:
+                    l.append((root[ltrim:], [root + "/" + file]))
+    return l
+
+setup(
+    version = "0.0.1",
+    description = "Avida-ED Windows Executable",
+    name = "Avida-ED",
+
+    # targets to build
+    console = ["Avida-ED.py"],
+    data_files =  recurse_dir("../../default.workspace",
+                              lambda x: not '.svn' in x, 6),
+    options = opts,
+    zipfile = None
+)




More information about the Avida-cvs mailing list