/[ascend]/trunk/scons/nsis.py
ViewVC logotype

Diff of /trunk/scons/nsis.py

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

revision 2556 by jpye, Fri Feb 3 00:17:16 2012 UTC revision 2609 by jpye, Thu Apr 26 17:45:25 2012 UTC
# Line 2  Line 2 
2  # Written by Mike Elkins, January 2004  # Written by Mike Elkins, January 2004
3  # Provided 'as-is', it works for me!  # Provided 'as-is', it works for me!
4    
5    
6  """  """
7  This tool provides SCons support for the Nullsoft Scriptable Install System  This tool provides SCons support for the Nullsoft Scriptable Install System
8  a windows installer builder available at http://nsis.sourceforge.net/home  a windows installer builder available at http://nsis.sourceforge.net/home
# Line 18  In addition, if you set NSISDEFINES to a Line 19  In addition, if you set NSISDEFINES to a
19  to NSIS.  to NSIS.
20  """  """
21    
22    
23    
24  import SCons.Builder  import SCons.Builder
25  import SCons.Util  import SCons.Util
26  import SCons.Scanner  import SCons.Scanner
27  import os.path, glob, platform  import os.path
28    import glob
29    
30  def nsis_parse( sources, keyword, multiple ):  def nsis_parse( sources, keyword, multiple ):
31    """    """
# Line 174  def find_nsis(env): Line 178  def find_nsis(env):
178    Try and figure out if NSIS is installed on this machine, and if so,    Try and figure out if NSIS is installed on this machine, and if so,
179    where.    where.
180    """    """
   if platform.architecture()[0] == "64bit":  
     regpath = 'SOFTWARE\\Wow6432Node\\NSIS'  
   else:  
     regpath = 'SOFTWARE\\NSIS'  
181    if SCons.Util.can_read_reg:    if SCons.Util.can_read_reg:
182      # If we can read the registry, get the NSIS command from it      # If we can read the registry, get the NSIS command from it
183      try:      try:
184        k = SCons.Util.RegOpenKeyEx(          # 131609 is KEY_READ | KEY_WOW64_32KEY since NSIS is 32-bit
185          SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE,regpath          k = SCons.Util.RegOpenKeyEx(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE,'SOFTWARE\\NSIS',0,131609)
186        )          val, tok = SCons.Util.RegQueryValueEx(k,None)
187        val, tok = SCons.Util.RegQueryValueEx(k,None)          ret = val + os.path.sep + 'makensis.exe'
188        ret = val + os.path.sep + 'makensis.exe'          if os.path.exists(ret):
189        if os.path.exists(ret):              return '"' + ret + '"'
190          return '"' + ret + '"'          else:
191        else:              return None
         return None  
192      except:      except:
193        pass # Couldn't find the key, just act like we can't read the registry        pass # Couldn't find the key, just act like we can't read the registry
194    # Hope it's on the path    # Hope it's on the path

Legend:
Removed from v.2556  
changed lines
  Added in v.2609

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