/[ascend]/trunk/pygtk/ascend.in
ViewVC logotype

Diff of /trunk/pygtk/ascend.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1550 by jpye, Thu Jun 28 13:46:33 2007 UTC revision 1551 by jpye, Tue Jul 24 07:29:42 2007 UTC
# Line 1  Line 1 
1  #!@PYTHON@  #!@PYTHON@
2    # ^ python path substituted here is not depended upon in Windows
3    
4  import os.path, sys, platform  import os.path, sys, platform
5    
# Line 19  restart = 0 Line 20  restart = 0
20  if platform.system()=="Windows":  if platform.system()=="Windows":
21      import _winreg as wreg      import _winreg as wreg
22      k = wreg.OpenKey(wreg.HKEY_LOCAL_MACHINE, "SOFTWARE\ASCEND")      k = wreg.OpenKey(wreg.HKEY_LOCAL_MACHINE, "SOFTWARE\ASCEND")
23      print k      print k
24    
25      # for some reason, QueryValue doesn't work on Py 2.4, need to use QueryValueEx.      # for some reason, QueryValue doesn't work on Py 2.4, need to use QueryValueEx.
26      INSTALL_SOLVERS,t = wreg.QueryValueEx(k,"INSTALL_SOLVERS")      INSTALL_SOLVERS,t = wreg.QueryValueEx(k,"INSTALL_SOLVERS")
# Line 31  if platform.system()=="Windows": Line 32  if platform.system()=="Windows":
32            
33      PYVERSION = "@PYVERSION@"      PYVERSION = "@PYVERSION@"
34            
35      k = wreg.OpenKey(wreg.HKEY_CURRENT_USER      PYTHON=os.path.join(sys.prefix,"pythonw.exe")
         ,"SOFTWARE\Python\PythonCore\%s\InstallPath" % PYVERSION  
     )  
     pypath,t = wreg.QueryValueEx(k,"")  
     if pypath == '':  
         k = wreg.OpenKey(wreg.HKEY_LOCAL_MACHINE  
             ,"SOFTWARE\Python\PythonCore\%s\InstallPath" % PYVERSION  
         )  
         pypath,t = wreg.QueryValueEx(k,"")  
         if pypath == '':  
             import winsound  
             winsound.MessageBeep(MB_ICONEXCLAMATION)  
             print "Unable to locate Python install path"  
             sys.exit(1)  
       
     print "pypath =",pypath  
       
     PYTHON=os.path.join(pypath,"pythonw.exe")  
36            
37      print "PYTHON =",PYTHON      print "PYTHON =",PYTHON
38      SEP=";"      SEP=";"

Legend:
Removed from v.1550  
changed lines
  Added in v.1551

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22