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 |
This tool provides SCons support for the Nullsoft Scriptable Install System |
This tool provides SCons support for the Nullsoft Scriptable Install System |
7 |
a windows installer builder available at http://nsis.sourceforge.net/home |
a windows installer builder available at http://nsis.sourceforge.net/home |
18 |
to NSIS. |
to NSIS. |
19 |
""" |
""" |
20 |
|
|
|
|
|
|
|
|
21 |
import SCons.Builder |
import SCons.Builder |
22 |
import SCons.Util |
import SCons.Util |
23 |
import SCons.Scanner |
import SCons.Scanner |
24 |
import os.path |
import os.path, glob, platform |
|
import glob |
|
|
|
|
25 |
|
|
26 |
def nsis_parse( sources, keyword, multiple ): |
def nsis_parse( sources, keyword, multiple ): |
27 |
""" |
""" |
174 |
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, |
175 |
where. |
where. |
176 |
""" |
""" |
177 |
|
if platform.architecture()[0] == "64bit": |
178 |
|
regpath = 'SOFTWARE\\Wow6432Node\\NSIS' |
179 |
|
else: |
180 |
|
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(SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE, |
k = SCons.Util.RegOpenKeyEx( |
185 |
'SOFTWARE\\NSIS') |
SCons.Util.hkey_mod.HKEY_LOCAL_MACHINE,regpath |
186 |
|
) |
187 |
val, tok = SCons.Util.RegQueryValueEx(k,None) |
val, tok = SCons.Util.RegQueryValueEx(k,None) |
188 |
ret = val + os.path.sep + 'makensis.exe' |
ret = val + os.path.sep + 'makensis.exe' |
189 |
if os.path.exists(ret): |
if os.path.exists(ret): |