Author: KirkMcDonald
Date: 2008-01-02 21:32:50 +0000 (Wed, 02 Jan 2008)
New Revision: 732

Added:
   trunk/pysoy/win32_postinstall.py
Modified:
   trunk/pysoy/setup.py
Log:
Win32 postinstallation script. (Adds shortcut to examples to desktop.)

Modified: trunk/pysoy/setup.py
===================================================================
--- trunk/pysoy/setup.py        2008-01-02 21:16:23 UTC (rev 731)
+++ trunk/pysoy/setup.py        2008-01-02 21:32:50 UTC (rev 732)
@@ -46,6 +46,7 @@
 
 extensions   =[]
 pyrex_sources=[]
+scripts      =[]
 include_path =['include/']
 for m in modules:
   pyrex_sources.append('src/%s/soy.%s.pyx'%(m,m))
@@ -75,6 +76,7 @@
   extensions.append( Extension( name = '_core',
                                 sources = ['src/_core-w32/soy._core.c',],
                                 libraries = ['opengl32', 'glew32', 'ode', 
'gdi32']))
+  scripts.append('win32_postinstall.py')
 
 # Apple OSX
 elif sys.platform == 'darwin' : 
@@ -197,4 +199,5 @@
   # (This is used in particular to access the Windows API without binding
   # a huge swath of it to Pyrex, and do some preprocessor trickery.)
   include_dirs     = [os.path.abspath(p) for p in include_path],
+  scripts          = scripts,
 )

Added: trunk/pysoy/win32_postinstall.py
===================================================================
--- trunk/pysoy/win32_postinstall.py                            (rev 0)
+++ trunk/pysoy/win32_postinstall.py    2008-01-02 21:32:50 UTC (rev 732)
@@ -0,0 +1,14 @@
+import os, os.path
+import sys
+import distutils.sysconfig as sysconfig
+
+desktop = get_special_folder_path("CSIDL_DESKTOPDIRECTORY")
+shortcut = os.path.join(desktop, 'PySoy Examples.lnk')
+examples = os.path.join(sysconfig.get_python_lib(True), 'soy', 'examples')
+
+if sys.argv[1] == '-install':
+    create_shortcut(examples, "PySoy Examples", shortcut)
+else:
+    if os.path.exists(shortcut):
+        os.remove(shortcut)
+

_______________________________________________
PySoy-SVN mailing list
[email protected]
http://www.pysoy.org/mailman/listinfo/pysoy-svn

Reply via email to