]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - win32_install.py
* added basic code for ufoai plugin (this still needs the pending filter api patch...
[xonotic/netradiant.git] / win32_install.py
index 825ebcc25c287aa95b25a0a0ad39a9d714a0c047..03db6c12a09df5b5c1a2f1baf4f934885f8ee62c 100644 (file)
-# install the fucking files\r
-# check the md5 to decide for a copy\r
-# we have a site.conf to go through\r
-# and a data list of stuff\r
-# it's called at the end of each build to copy what needs to be\r
-# it could be called only at GtkRadiant link time\r
-\r
-# command line: a bunch of config switches default would be debug?, and release flag\r
-\r
-\r
-import sys, traceback, os, re, filecmp, shutil, pickle, string\r
-from makeversion import get_version\r
-\r
-(line, major, minor) = get_version()\r
-\r
-paths = {\r
-  'CORERADIANTDIR' : 'C:\\Program Files\\GtkRadiant-1.' + major,\r
-  'RTCWRADIANTDIR' : 'C:\\Program Files\\Return to Castle Wolfenstein - Game of The Year Edition\\Radiant-1.' + major,\r
-  'HLRADIANTDIR'   : 'C:\\Sierra\\Half-Life\\Radiant-1.' + major,\r
-  'SOF2RADIANTDIR' : 'C:\\Program Files\\Soldier of Fortune II - Double Helix\\Radiant-1.' + major,\r
-  'QUAKE2RADIANTDIR' : 'C:\\Quake2\\Radiant-1.' + major,\r
-  'HERETIC2RADIANTDIR' : 'C:\\Heretic2\\Radiant-1.' + major\r
-  }\r
-\r
-conf_filename='site.conf.win32'\r
-\r
-# site settings ----------------------\r
-\r
-if (os.path.exists(conf_filename)):\r
-  site_file = open(conf_filename, 'r')\r
-  p = pickle.Unpickler(site_file)\r
-  paths = p.load()\r
-  print 'Loaded configuration from ' + conf_filename  \r
-\r
-# end site settings ------------------\r
-\r
-# command line overrides -------------\r
-\r
-print '\nCommand line:'\r
-regex = re.compile("(.*)=(.*)")\r
-for i in sys.argv[1:]:\r
-  #print i\r
-  if ( regex.match(i) ):\r
-    (key, val) = string.split(i, '=')\r
-    #print 'key: %s val: %s' % (key, val)\r
-    paths[key] = val\r
-  else:\r
-    print 'Can''t parse command line - ignore: ' + i\r
-\r
-# end command line overrides ---------\r
-\r
-# save config ------------------------\r
-\r
-site_file = open(conf_filename, 'w')\r
-p = pickle.Pickler(site_file)\r
-p.dump(paths)\r
-site_file.close()\r
-\r
-print '\nConfiguration:'\r
-\r
-for i in paths.keys():\r
-  print '%s -> %s' % (i, paths[i])\r
-\r
-# end save config --------------------\r
-\r
-q3map2_list = [\r
-#      ( ( '..\\libpng\\projects\\msvc\\win32\\zlib\\dll_dbg\\zlibd.dll', '..\\libpng\\projects\\msvc\\win32\\zlib\\dll\\zlib.dll' ), '$CORERADIANTDIR' ),\r
-#      ( ( '..\\libpng\\projects\\msvc\\win32\\libpng\\dll_dbg\\libpng13d.dll', '..\\libpng\\projects\\msvc\\win32\\libpng\\dll\\libpng13.dll' ), '$CORERADIANTDIR' ),\r
-#      ( ( '..\\libxml2\\win32\\binaries-debug\\libxml2.dll', '..\\libxml2\\win32\\binaries-release\\libxml2.dll' ), '$CORERADIANTDIR' ),\r
-       ( ( 'tools\\quake3\\q3map2\\Debug\\Q3Map2.exe', 'tools\\quake3\\q3map2\\Release\\Q3Map2.exe' ), '$CORERADIANTDIR' ),\r
-       ]\r
-\r
-all = [\r
-       ( ( 'radiant\\Debug\\GtkRadiant.exe', 'radiant\\Release\\GtkRadiant.exe' ) ,  '$CORERADIANTDIR' ),\r
-       ( ( 'contrib\\bobtoolz\\Debug\\bobToolz.dll', 'contrib\\bobtoolz\\Release\\bobToolz.dll' ), '$CORERADIANTDIR\\plugins' ),\r
-       ( ( 'contrib\\camera\\Debug\\camera.dll', 'contrib\\camera\\Release\\camera.dll' ), '$CORERADIANTDIR\\plugins' ),\r
-       ( ( 'plugins\\entity\\Debug\\entity.dll', 'plugins\\entity\\Release\\entity.dll' ), '$CORERADIANTDIR\\modules' ),\r
-       ( ( 'plugins\\eclassfgd\\Debug\\fgd.dll', 'plugins\\eclassfgd\\Release\\fgd.dll' ), '$CORERADIANTDIR\\modules' ),\r
-       ( ( 'contrib\\gtkgensurf\\Debug\\gensurf.dll', 'contrib\\gtkgensurf\\Release\\gensurf.dll' ), '$CORERADIANTDIR\\plugins' ),\r
-       ( ( 'contrib\\hydratoolz\\Debug\\hydratoolz.dll', 'contrib\\hydratoolz\\Release\\hydratoolz.dll' ), '$HLRADIANTDIR\\plugins' ), \r
-       ( ( 'plugins\\image\\Debug\\image.dll', 'plugins\\image\\Release\\image.dll' ), '$CORERADIANTDIR\\modules' ),\r
-       ( ( 'plugins\\imagewal\\Debug\\imagewal.dll', 'plugins\\imagewal\\Release\\imagewal.dll' ), '$QUAKE2RADIANTDIR\\modules' ),\r
-       ( ( 'plugins\\imagehl\\Debug\\imagehl.dll', 'plugins\\imagehl\\Release\\imagehl.dll' ), '$CORERADIANTDIR\\modules' ),\r
-       ( ( 'plugins\\imagepng\\Debug\\imagepng.dll', 'plugins\\imagepng\\Release\\imagepng.dll' ), '$CORERADIANTDIR\\modules' ),\r
-       ( ( 'plugins\\map\\Debug\\map.dll', 'plugins\\map\\Release\\map.dll' ), '$CORERADIANTDIR\\modules' ),   \r
-       ( ( 'plugins\\mapxml\\Debug\\mapxml.dll', 'plugins\\mapxml\\Release\\mapxml.dll' ), '$CORERADIANTDIR\\modules' ),\r
-       ( ( 'plugins\\model\\Debug\\model.dll', 'plugins\\model\\Release\\model.dll' ), '$CORERADIANTDIR\\modules' ),\r
-       ( ( 'contrib\\prtview\\Debug\\PrtView.dll', 'contrib\\prtview\\Release\\PrtView.dll' ), '$CORERADIANTDIR\\plugins' ),\r
-       ( ( 'tools\\quake3\\q3data\\Debug\\q3data.exe', 'tools\\quake3\\q3data\\Release\\q3data.exe' ), '$CORERADIANTDIR' ),\r
-       ( ( 'plugins\\shaders\\Debug\\shaders.dll', 'plugins\\shaders\\Release\\shaders.dll' ), '$CORERADIANTDIR\\modules' ),   \r
-       ( ( 'plugins\\spritemodel\\Debug\\spritemodel.dll', 'plugins\\spritemodel\\Release\\spritemodel.dll' ), '$CORERADIANTDIR\\modules' ),\r
-#      ( ( 'Debug\\TexTool.dll', 'Release\\TexTool.dll' ), '$CORERADIANTDIR\\plugins' ),\r
-       ( ( 'plugins\\vfspk3\\Debug\\vfspk3.dll', 'plugins\\vfspk3\\Release\\vfspk3.dll' ), '$CORERADIANTDIR\\modules' ),\r
-       ( ( 'plugins\\vfspak\\Debug\\vfspak.dll', 'plugins\\vfspak\\Release\\vfspak.dll' ), '$QUAKE2RADIANTDIR\\modules' ),\r
-       ( ( 'plugins\\vfswad\\Debug\\vfswad.dll', 'plugins\\vfswad\\Release\\vfswad.dll' ), '$CORERADIANTDIR\\modules' ),\r
-  ( ( 'plugins\\surface\\Debug\\surface.dll', 'plugins\\surface\\Release\\surface.dll' ), '$CORERADIANTDIR\\modules' ),\r
-  ( ( 'plugins\\surface_quake2\\Debug\\surface_quake2.dll', 'plugins\\surface_quake2\\Release\\surface_quake2.dll' ), '$QUAKE2RADIANTDIR\\modules' ),\r
-  ( ( 'tools\\quake2\\q2map\\Debug\\q2map.exe', 'tools\\quake2\\q2map\\Release\\q2map.exe' ) ,  '$QUAKE2RADIANTDIR' ),\r
-  ( ( 'tools\\quake2\\qdata\\Debug\\qdata3.exe', 'tools\\quake2\\qdata\\Release\\qdata3.exe' ) ,  '$QUAKE2RADIANTDIR' ),\r
-  ( ( 'plugins\\vfspak\\Debug\\vfspak.dll', 'plugins\\vfspak\\Release\\vfspak.dll' ), '$HERETIC2RADIANTDIR\\modules' ),\r
-  ( ( 'plugins\\imagem8\\Debug\\imagem8.dll', 'plugins\\imagem8\\Release\\imagem8.dll' ), '$HERETIC2RADIANTDIR\\modules' ),\r
-  ( ( 'plugins\\surface_heretic2\\Debug\\surface_heretic2.dll', 'plugins\\surface_heretic2\\Release\\surface_heretic2.dll' ), '$HERETIC2RADIANTDIR\\modules' ),\r
-  ( ( 'tools\\quake2\\qdata_heretic2\\Debug\\qdata3.exe', 'tools\\quake2\\qdata_heretic2\\Release\\qdata3.exe' ) ,  '$HERETIC2RADIANTDIR' ),\r
-       ( ( 'contrib\\bkgrnd2d\\Debug\\bkgrnd2d.dll', 'contrib\\bkgrnd2d\\Release\\bkgrnd2d.dll' ), '$CORERADIANTDIR\\plugins' ),\r
-       ]\r
-\r
-config = 0\r
-q3map2 = 0\r
-\r
-# config check\r
-for i in sys.argv:\r
-       if ( i == 'release' ):\r
-               config = 1\r
-       elif ( i == 'q3map2' ):\r
-               q3map2 = 1\r
-\r
-if ( config == 1 ):\r
-       print 'installing release binaries'\r
-else:\r
-       print 'installing debug binaries'\r
-\r
-def expand(path_in):\r
-       for matches in paths.keys():\r
-               exp = re.compile('\\$%s' % matches)\r
-               if ( not re.match(exp, path_in) is None ):\r
-                       #print "Got a match for %s on %s" % ( matches, path_in )\r
-                       path_in = re.sub(exp, paths[matches], path_in)  \r
-                       #print "Processed to: %s" % path_in\r
-       return path_in\r
-\r
-# don't bother about stderr\r
-sys.stderr = sys.stdout\r
-\r
-if ( q3map2 == 0 ):\r
-       stuff = q3map2_list\r
-       stuff += all\r
-else:\r
-       stuff = q3map2_list\r
-\r
-for entries in stuff:\r
-       try:\r
-               src = expand(entries[0][config])\r
-               #print "src basename: %s -> %s" % (src, os.path.basename(src))\r
-               dst = entries[1]\r
-               dst = os.path.join( entries[1], os.path.basename(src) )\r
-               dst = expand(dst)\r
-               #print "src: %s dst: %s" % (src, dst)\r
-               if (os.path.isfile(src)):\r
-                       if (os.path.isfile(dst)):\r
-                               if (not filecmp.cmp(src, dst)):\r
-                                       shutil.copy(src, dst)\r
-                                       print "%s: OK - updated" % dst\r
-                               else:\r
-                                       print "%s: OK - already up to date" % dst\r
-                       else:\r
-                               shutil.copy(src, dst)\r
-                               print "%s: OK - installed" % dst\r
-               else:   \r
-                       print "%s: FAILED - not found" % src\r
-                       if (os.path.isfile(dst)):\r
-                               print "delete %s" % dst\r
-                               os.remove(dst)\r
-       except:\r
-               print "%s: FAILED" % src\r
-               traceback.print_exc()\r
-               \r
+# install the fucking files
+# check the md5 to decide for a copy
+# we have a site.conf to go through
+# and a data list of stuff
+# it's called at the end of each build to copy what needs to be
+# it could be called only at GtkRadiant link time
+
+# command line: a bunch of config switches default would be debug?, and release flag
+
+
+import sys, traceback, os, re, filecmp, shutil, pickle, string
+from makeversion import get_version
+
+(line, major, minor) = get_version()
+
+paths = {
+  'CORERADIANTDIR' : 'C:\\Program Files\\GtkRadiant-1.' + major,
+  'RTCWRADIANTDIR' : 'C:\\Program Files\\Return to Castle Wolfenstein - Game of The Year Edition\\Radiant-1.' + major,
+  'HLRADIANTDIR'   : 'C:\\Sierra\\Half-Life\\Radiant-1.' + major,
+  'SOF2RADIANTDIR' : 'C:\\Program Files\\Soldier of Fortune II - Double Helix\\Radiant-1.' + major,
+  'QUAKE2RADIANTDIR' : 'C:\\Quake2\\Radiant-1.' + major,
+  'HERETIC2RADIANTDIR' : 'C:\\Heretic2\\Radiant-1.' + major
+  }
+
+conf_filename='site.conf.win32'
+
+# site settings ----------------------
+
+if (os.path.exists(conf_filename)):
+  site_file = open(conf_filename, 'r')
+  p = pickle.Unpickler(site_file)
+  paths = p.load()
+  print 'Loaded configuration from ' + conf_filename  
+
+# end site settings ------------------
+
+# command line overrides -------------
+
+print '\nCommand line:'
+regex = re.compile("(.*)=(.*)")
+for i in sys.argv[1:]:
+  #print i
+  if ( regex.match(i) ):
+    (key, val) = string.split(i, '=')
+    #print 'key: %s val: %s' % (key, val)
+    paths[key] = val
+  else:
+    print 'Can''t parse command line - ignore: ' + i
+
+# end command line overrides ---------
+
+# save config ------------------------
+
+site_file = open(conf_filename, 'w')
+p = pickle.Pickler(site_file)
+p.dump(paths)
+site_file.close()
+
+print '\nConfiguration:'
+
+for i in paths.keys():
+  print '%s -> %s' % (i, paths[i])
+
+# end save config --------------------
+
+q3map2_list = [
+#      ( ( '..\\libpng\\projects\\msvc\\win32\\zlib\\dll_dbg\\zlibd.dll', '..\\libpng\\projects\\msvc\\win32\\zlib\\dll\\zlib.dll' ), '$CORERADIANTDIR' ),
+#      ( ( '..\\libpng\\projects\\msvc\\win32\\libpng\\dll_dbg\\libpng13d.dll', '..\\libpng\\projects\\msvc\\win32\\libpng\\dll\\libpng13.dll' ), '$CORERADIANTDIR' ),
+#      ( ( '..\\libxml2\\win32\\binaries-debug\\libxml2.dll', '..\\libxml2\\win32\\binaries-release\\libxml2.dll' ), '$CORERADIANTDIR' ),
+       ( ( 'tools\\quake3\\q3map2\\Debug\\Q3Map2.exe', 'tools\\quake3\\q3map2\\Release\\Q3Map2.exe' ), '$CORERADIANTDIR' ),
+       ]
+
+all = [
+       ( ( 'radiant\\Debug\\GtkRadiant.exe', 'radiant\\Release\\GtkRadiant.exe' ) ,  '$CORERADIANTDIR' ),
+       ( ( 'contrib\\bobtoolz\\Debug\\bobToolz.dll', 'contrib\\bobtoolz\\Release\\bobToolz.dll' ), '$CORERADIANTDIR\\plugins' ),
+       ( ( 'contrib\\camera\\Debug\\camera.dll', 'contrib\\camera\\Release\\camera.dll' ), '$CORERADIANTDIR\\plugins' ),
+       ( ( 'plugins\\entity\\Debug\\entity.dll', 'plugins\\entity\\Release\\entity.dll' ), '$CORERADIANTDIR\\modules' ),
+       ( ( 'plugins\\eclassfgd\\Debug\\fgd.dll', 'plugins\\eclassfgd\\Release\\fgd.dll' ), '$CORERADIANTDIR\\modules' ),
+       ( ( 'contrib\\gtkgensurf\\Debug\\gensurf.dll', 'contrib\\gtkgensurf\\Release\\gensurf.dll' ), '$CORERADIANTDIR\\plugins' ),
+       ( ( 'contrib\\hydratoolz\\Debug\\hydratoolz.dll', 'contrib\\hydratoolz\\Release\\hydratoolz.dll' ), '$HLRADIANTDIR\\plugins' ), 
+       ( ( 'plugins\\image\\Debug\\image.dll', 'plugins\\image\\Release\\image.dll' ), '$CORERADIANTDIR\\modules' ),
+       ( ( 'plugins\\imagewal\\Debug\\imagewal.dll', 'plugins\\imagewal\\Release\\imagewal.dll' ), '$QUAKE2RADIANTDIR\\modules' ),
+       ( ( 'plugins\\imagehl\\Debug\\imagehl.dll', 'plugins\\imagehl\\Release\\imagehl.dll' ), '$CORERADIANTDIR\\modules' ),
+       ( ( 'plugins\\imagepng\\Debug\\imagepng.dll', 'plugins\\imagepng\\Release\\imagepng.dll' ), '$CORERADIANTDIR\\modules' ),
+       ( ( 'plugins\\map\\Debug\\map.dll', 'plugins\\map\\Release\\map.dll' ), '$CORERADIANTDIR\\modules' ),   
+       ( ( 'plugins\\mapxml\\Debug\\mapxml.dll', 'plugins\\mapxml\\Release\\mapxml.dll' ), '$CORERADIANTDIR\\modules' ),
+       ( ( 'plugins\\model\\Debug\\model.dll', 'plugins\\model\\Release\\model.dll' ), '$CORERADIANTDIR\\modules' ),
+       ( ( 'contrib\\prtview\\Debug\\PrtView.dll', 'contrib\\prtview\\Release\\PrtView.dll' ), '$CORERADIANTDIR\\plugins' ),
+       ( ( 'tools\\quake3\\q3data\\Debug\\q3data.exe', 'tools\\quake3\\q3data\\Release\\q3data.exe' ), '$CORERADIANTDIR' ),
+       ( ( 'plugins\\shaders\\Debug\\shaders.dll', 'plugins\\shaders\\Release\\shaders.dll' ), '$CORERADIANTDIR\\modules' ),   
+       ( ( 'plugins\\spritemodel\\Debug\\spritemodel.dll', 'plugins\\spritemodel\\Release\\spritemodel.dll' ), '$CORERADIANTDIR\\modules' ),
+#      ( ( 'Debug\\TexTool.dll', 'Release\\TexTool.dll' ), '$CORERADIANTDIR\\plugins' ),
+       ( ( 'plugins\\vfspk3\\Debug\\vfspk3.dll', 'plugins\\vfspk3\\Release\\vfspk3.dll' ), '$CORERADIANTDIR\\modules' ),
+       ( ( 'plugins\\vfspak\\Debug\\vfspak.dll', 'plugins\\vfspak\\Release\\vfspak.dll' ), '$QUAKE2RADIANTDIR\\modules' ),
+       ( ( 'plugins\\vfswad\\Debug\\vfswad.dll', 'plugins\\vfswad\\Release\\vfswad.dll' ), '$CORERADIANTDIR\\modules' ),
+  ( ( 'plugins\\surface\\Debug\\surface.dll', 'plugins\\surface\\Release\\surface.dll' ), '$CORERADIANTDIR\\modules' ),
+  ( ( 'plugins\\surface_quake2\\Debug\\surface_quake2.dll', 'plugins\\surface_quake2\\Release\\surface_quake2.dll' ), '$QUAKE2RADIANTDIR\\modules' ),
+  ( ( 'tools\\quake2\\q2map\\Debug\\q2map.exe', 'tools\\quake2\\q2map\\Release\\q2map.exe' ) ,  '$QUAKE2RADIANTDIR' ),
+  ( ( 'tools\\quake2\\qdata\\Debug\\qdata3.exe', 'tools\\quake2\\qdata\\Release\\qdata3.exe' ) ,  '$QUAKE2RADIANTDIR' ),
+  ( ( 'plugins\\vfspak\\Debug\\vfspak.dll', 'plugins\\vfspak\\Release\\vfspak.dll' ), '$HERETIC2RADIANTDIR\\modules' ),
+  ( ( 'plugins\\imagem8\\Debug\\imagem8.dll', 'plugins\\imagem8\\Release\\imagem8.dll' ), '$HERETIC2RADIANTDIR\\modules' ),
+  ( ( 'plugins\\surface_heretic2\\Debug\\surface_heretic2.dll', 'plugins\\surface_heretic2\\Release\\surface_heretic2.dll' ), '$HERETIC2RADIANTDIR\\modules' ),
+  ( ( 'tools\\quake2\\qdata_heretic2\\Debug\\qdata3.exe', 'tools\\quake2\\qdata_heretic2\\Release\\qdata3.exe' ) ,  '$HERETIC2RADIANTDIR' ),
+       ( ( 'contrib\\bkgrnd2d\\Debug\\bkgrnd2d.dll', 'contrib\\bkgrnd2d\\Release\\bkgrnd2d.dll' ), '$CORERADIANTDIR\\plugins' ),
+       ]
+
+config = 0
+q3map2 = 0
+
+# config check
+for i in sys.argv:
+       if ( i == 'release' ):
+               config = 1
+       elif ( i == 'q3map2' ):
+               q3map2 = 1
+
+if ( config == 1 ):
+       print 'installing release binaries'
+else:
+       print 'installing debug binaries'
+
+def expand(path_in):
+       for matches in paths.keys():
+               exp = re.compile('\\$%s' % matches)
+               if ( not re.match(exp, path_in) is None ):
+                       #print "Got a match for %s on %s" % ( matches, path_in )
+                       path_in = re.sub(exp, paths[matches], path_in)  
+                       #print "Processed to: %s" % path_in
+       return path_in
+
+# don't bother about stderr
+sys.stderr = sys.stdout
+
+if ( q3map2 == 0 ):
+       stuff = q3map2_list
+       stuff += all
+else:
+       stuff = q3map2_list
+
+for entries in stuff:
+       try:
+               src = expand(entries[0][config])
+               #print "src basename: %s -> %s" % (src, os.path.basename(src))
+               dst = entries[1]
+               dst = os.path.join( entries[1], os.path.basename(src) )
+               dst = expand(dst)
+               #print "src: %s dst: %s" % (src, dst)
+               if (os.path.isfile(src)):
+                       if (os.path.isfile(dst)):
+                               if (not filecmp.cmp(src, dst)):
+                                       shutil.copy(src, dst)
+                                       print "%s: OK - updated" % dst
+                               else:
+                                       print "%s: OK - already up to date" % dst
+                       else:
+                               shutil.copy(src, dst)
+                               print "%s: OK - installed" % dst
+               else:   
+                       print "%s: FAILED - not found" % src
+                       if (os.path.isfile(dst)):
+                               print "delete %s" % dst
+                               os.remove(dst)
+       except:
+               print "%s: FAILED" % src
+               traceback.print_exc()
+