Index: SConstruct
===================================================================
RCS file: /cvsroot/nsis/NSIS/SConstruct,v
retrieving revision 1.55
diff -u -r1.55 SConstruct
--- SConstruct	8 Oct 2005 21:13:02 -0000	1.55
+++ SConstruct	29 Oct 2005 18:08:41 -0000
@@ -79,6 +79,37 @@
 
 opts = Options()
 
+if defenv['PLATFORM'] == 'win32':
+	prefix = None
+	dest_dir = None
+	conf_dir = None
+	bin_dir = None
+	data_dir = None
+	contrib_dir = 'Contrib'
+	include_dir = 'Include'
+	plugin_dir = 'Plugins'
+	stubs_dir = 'Stubs'
+	w32_bin_dir = 'Bin'
+	doc_dir = None
+	docs_dir = 'Docs'
+	examples_dir = 'Examples'
+	menu_dir = 'Menu'
+else:
+	dest_dir = None
+	prefix = '/usr/local'
+	conf_dir = '$PREFIX/etc/nsis'
+	bin_dir = '$PREFIX/bin'
+	data_dir = '$PREFIX/share/nsis'
+	contrib_dir = '$NSIS_DATA_DIR/Contrib'
+	include_dir = '$NSIS_DATA_DIR/Include'
+	plugin_dir = '$NSIS_DATA_DIR/Plugins'
+	stubs_dir = '$NSIS_DATA_DIR/Stubs'
+	w32_bin_dir = '$NSIS_DATA_DIR/Bin'
+	menu_dir = '$NSIS_DATA_DIR/Menu'
+	doc_dir = '$PREFIX/share/doc/nsis'
+	docs_dir = '$NSIS_DOC_DIR/Docs'
+	examples_dir = '$NSIS_DOC_DIR/Examples'
+
 # version
 opts.Add(('VERSION', 'Version of NSIS', cvs_version))
 opts.Add(('VER_MAJOR', 'Major version of NSIS (recommended for dist-installer)', None))
@@ -86,7 +117,7 @@
 opts.Add(('VER_REVISION', 'Revision of NSIS (recommended for dist-installer)', None))
 opts.Add(('VER_BUILD', 'Build version of NSIS (recommended for dist-installer)', None))
 # installation
-opts.Add(PathOption('PREFIX', 'Installation prefix', None))
+opts.Add(('PREFIX', 'Installation prefix.', prefix))
 opts.Add(ListOption('SKIPSTUBS', 'A list of stubs that will not be built', 'none', stubs))
 opts.Add(ListOption('SKIPPLUGINS', 'A list of plug-ins that will not be built', 'none', plugins))
 opts.Add(ListOption('SKIPUTILS', 'A list of utilities that will not be built', 'none', utils))
@@ -99,6 +130,20 @@
 # build options
 opts.Add(BoolOption('DEBUG', 'Build executables with debugging information', 'no'))
 opts.Add(PathOption('CODESIGNER', 'A program used to sign executables', None))
+# path related build options
+opts.Add(('DESTDIR', 'Intermediate installation prefix (extra install time prefix).', dest_dir))
+opts.Add(('NSIS_CONF_DIR','Path to install conf.nsh to.',conf_dir))
+opts.Add(('NSIS_BIN_DIR','Path to install native binaries to.',bin_dir))
+opts.Add(('NSIS_DATA_DIR','Path to install nsis data to (plugins, includes, stubs, contrib, win32 binaries)',data_dir))
+opts.Add(('NSIS_CONTRIB_DIR','Path to install nsis contrib files to.',contrib_dir))
+opts.Add(('NSIS_INCLUDE_DIR','Path to install nsis include files to.',include_dir))
+opts.Add(('NSIS_PLUGIN_DIR','Path to install nsis plugins to.',plugin_dir))
+opts.Add(('NSIS_STUBS_DIR','Path to install nsis stubs to.',stubs_dir))
+opts.Add(('NSIS_W32_BIN_DIR','Path to install nsis Win32 Binaries to',w32_bin_dir))
+opts.Add(('NSIS_MENU_DIR','Path to install nsis menu to',menu_dir))
+opts.Add(('NSIS_DOC_DIR','Path to install nsis README / INSTALL / TODO files to.',doc_dir))
+opts.Add(('NSIS_DOCS_DIR','Path to install nsis documentation to.',docs_dir))
+opts.Add(('NSIS_EXAMPLES_DIR','Path to install nsis examples to.',examples_dir))
 
 opts.Update(defenv)
 
@@ -123,13 +168,16 @@
 defenv.Execute(Delete('$INSTDISTDIR'))
 defenv.Execute(Delete('$TESTDISTDIR'))
 
+for define in ('NSIS_CONF_DIR','NSIS_BIN_DIR','NSIS_DATA_DIR','NSIS_CONTRIB_DIR','NSIS_INCLUDE_DIR','NSIS_PLUGIN_DIR','NSIS_STUBS_DIR','NSIS_W32_BIN_DIR','NSIS_DOC_DIR','NSIS_DOCS_DIR','NSIS_EXAMPLES_DIR'):
+	defenv.Append(NSIS_CPPDEFINES = [(define, '"'+defenv[define]+'"')])
+
 def Distribute(dir, files):
 	defenv.Install('$ZIPDISTDIR/%s' % dir, files)
 	defenv.Install('$INSTDISTDIR/%s' % dir, files)
 	defenv.Install('$TESTDISTDIR/%s' % dir, files)
 
-	if defenv.has_key('PREFIX') and defenv['PREFIX']:
-		ins = defenv.Install('$PREFIX/%s' % dir, files)
+	if defenv.has_key('DESTDIR') and defenv['DESTDIR']:
+		ins = defenv.Install('$DESTDIR/%s' % dir, files)
 		return ins
 
 	return []
@@ -139,20 +187,24 @@
 	defenv.InstallAs('$INSTDISTDIR/%s' % path, file)
 	defenv.InstallAs('$TESTDISTDIR/%s' % path, file)
 
-	if defenv.has_key('PREFIX') and defenv['PREFIX']:
-		ins = defenv.InstallAs('$PREFIX/%s' % path, file)
+	if defenv.has_key('DESTDIR') and defenv['DESTDIR']:
+		ins = defenv.InstallAs('$DESTDIR/%s' % path, file)
 		return ins
 
 	return []
 
+def DistributeStub(path, file):
+	ins = defenv.InstallAs('$DESTDIR/$NSIS_STUBS_DIR/%s' % path, file)
+	return ins
+
 def DistributeExamples(dir, examples):
-	return Distribute('Examples/%s' % dir, examples)
+	return Distribute('$NSIS_EXAMPLES_DIR/%s' % dir, examples)
 
 def DistributeDocs(dir, docs):
-	return Distribute('Docs/%s' % dir, docs)
+	return Distribute('$NSIS_DOCS_DIR/%s' % dir, docs)
 
 def DistributeContribs(dir, contribs):
-	return Distribute('Contrib/%s' % dir, contribs)
+	return Distribute('$NSIS_CONTRIB_DIR/%s' % dir, contribs)
 
 def Sign(targets):
 	if defenv.has_key('CODESIGNER'):
@@ -162,6 +214,7 @@
 
 defenv.Distribute = Distribute
 defenv.DistributeAs = DistributeAs
+defenv.DistributeStub = DistributeStub
 defenv.DistributeExamples = DistributeExamples
 defenv.DistributeDocs = DistributeDocs
 defenv.DistributeContribs = DistributeContribs
@@ -202,13 +255,24 @@
 #######  Aliases                                                   ###
 ######################################################################
 
-defenv.Alias('install', '$PREFIX')
-defenv.Alias('install-docs', '$PREFIX/NSIS.chm')
-defenv.Alias('install-docs', '$PREFIX/Docs')
-defenv.Alias('install-examples', '$PREFIX/Examples')
-defenv.Alias('install-plugins', '$PREFIX/Plugins')
-defenv.Alias('install-stubs', '$PREFIX/Stubs')
-defenv.Alias('install-includes', '$PREFIX/Include')
+defenv.Alias('install', '$DESTDIR')
+defenv.Alias('install', '$DESTDIR/$NSIS_CONF_DIR')
+defenv.Alias('install', '$DESTDIR/$NSIS_BIN_DIR')
+defenv.Alias('install', '$DESTDIR/$NSIS_DATA_DIR')
+defenv.Alias('install', '$DESTDIR/$NSIS_CONTRIB_DIR')
+defenv.Alias('install', '$DESTDIR/$NSIS_INCLUDE_DIR')
+defenv.Alias('install', '$DESTDIR/$NSIS_PLUGIN_DIR')
+defenv.Alias('install', '$DESTDIR/$NSIS_STUBS_DIR')
+defenv.Alias('install', '$DESTDIR/$NSIS_W32_BIN_DIR')
+defenv.Alias('install', '$DESTDIR/$NSIS_DOC_DIR')
+defenv.Alias('install', '$DESTDIR/$NSIS_DOCS_DIR')
+defenv.Alias('install', '$DESTDIR/$NSIS_EXAMPLES_DIR')
+defenv.Alias('install-docs', '$DESTDIR/$PREFIX/NSIS.chm')
+defenv.Alias('install-docs', '$DESTDIR/$NSIS_DOCS_DIR')
+defenv.Alias('install-examples', '$DESTDIR/$NSIS_EXAMPLES_DIR')
+defenv.Alias('install-plugins', '$DESTDIR/$NSIS_PLUGIN_DIR')
+defenv.Alias('install-stubs', '$DESTDIR/$NSIS_STUBS_DIR')
+defenv.Alias('install-includes', '$DESTDIR/$NSIS_INCLUDE_DIR')
 
 # defined elsewhere:
 #  install-compiler
@@ -248,8 +312,9 @@
 #######  Distribute Basics                                         ###
 ######################################################################
 
-defenv.Distribute('', 'license.txt')
-defenv.Distribute('', 'nsisconf.nsh')
+defenv.Distribute('$NSIS_DOC_DIR', 'TODO.txt')
+defenv.Distribute('$NSIS_DOC_DIR', 'license.txt')
+defenv.Distribute('$NSIS_CONF_DIR', 'nsisconf.nsh')
 
 ######################################################################
 #######  Stubs                                                     ###
@@ -269,7 +334,7 @@
 	target = defenv.SConscript(dirs = 'Source/exehead', build_dir = build_dir, duplicate = False, exports = exports)
 	env.SideEffect('%s/stub_%s.map' % (build_dir, stub), target)
 
-	env.DistributeAs('Stubs/%s%s' % (compression, suffix), target)
+	env.DistributeStub(compression+suffix, target)
 
 	defenv.Alias(compression, target)
 	defenv.Alias('stubs', target)
@@ -281,7 +346,7 @@
 	BuildStub(stub, False)
 	BuildStub(stub, True)
 
-defenv.DistributeAs('Stubs/uninst', 'Source/exehead/uninst.ico')
+defenv.DistributeStub('uninst', 'Source/exehead/uninst.ico')
 
 ######################################################################
 #######  makensis                                                  ###
@@ -296,7 +361,7 @@
 
 defenv.Alias('makensis', makensis)
 
-ins = defenv.Distribute('', makensis)
+ins = defenv.Distribute('$NSIS_BIN_DIR', makensis)
 defenv.Alias('install-compiler', ins)
 
 ######################################################################
@@ -356,7 +421,7 @@
 
 	CleanMap(env, plugin, target)
 
-	env.Distribute('Plugins', plugin)
+	env.Distribute('$NSIS_PLUGIN_DIR', plugin)
 
 	DistributeExtras(env, target, examples, docs)
 
Index: nsisconf.nsh
===================================================================
RCS file: /cvsroot/nsis/NSIS/nsisconf.nsh,v
retrieving revision 1.6
diff -u -r1.6 nsisconf.nsh
--- nsisconf.nsh	5 Feb 2004 21:47:08 -0000	1.6
+++ nsisconf.nsh	29 Oct 2005 18:08:41 -0000
@@ -30,8 +30,8 @@
 
 ;Change the default icons
 
-;Icon "${NSISDIR}\Contrib\Graphics\Icons\arrow-install.ico"
-;UninstallIcon "${NSISDIR}\Contrib\Graphics\Icons\arrow-uninstall.ico"
+;Icon "${CONTRIBDIR}\Graphics\Icons\arrow-install.ico"
+;UninstallIcon "${CONTRIBDIR}\Graphics\Icons\arrow-uninstall.ico"
 
 ;------------------------
 
@@ -55,8 +55,8 @@
   ;Example: Change the default Modern UI icons
   
   ;!ifndef MUI_ICON & MUI_UNICON
-  ;  !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\arrow-install.ico"
-  ;  !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\arrow-uninstall.ico"
+  ;  !define MUI_ICON "${CONTRIBDIR}\Graphics\Icons\arrow-install.ico"
+  ;  !define MUI_UNICON "${CONTRIBDIR}\Graphics\Icons\arrow-uninstall.ico"
   ;!endif
   
 !macroend
\ No newline at end of file
Index: Contrib/AdvSplash/Example.nsi
===================================================================
RCS file: /cvsroot/nsis/NSIS/Contrib/AdvSplash/Example.nsi,v
retrieving revision 1.8
diff -u -r1.8 Example.nsi
--- Contrib/AdvSplash/Example.nsi	16 Sep 2005 11:27:50 -0000	1.8
+++ Contrib/AdvSplash/Example.nsi	29 Oct 2005 18:08:41 -0000
@@ -7,7 +7,7 @@
 Function .onInit
         # the plugins dir is automatically deleted when the installer exits
         InitPluginsDir
-        File /oname=$PLUGINSDIR\splash.bmp "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp"
+        File /oname=$PLUGINSDIR\splash.bmp "${CONTRIBDIR}\Graphics\Header\nsis.bmp"
         #optional
         #File /oname=$PLUGINSDIR\splash.wav "C:\myprog\sound.wav"
 
@@ -19,12 +19,12 @@
                         ; '0' if everything closed normally, and '-1' if some error occurred.
 
         MessageBox MB_OK "Transparency"
-        File /oname=$PLUGINSDIR\splash.bmp "${NSISDIR}\Contrib\Graphics\Wizard\orange-uninstall.bmp"
+        File /oname=$PLUGINSDIR\splash.bmp "${CONTRIBDIR}\Graphics\Wizard\orange-uninstall.bmp"
         advsplash::show 2000 0 0 0x1856B1 $PLUGINSDIR\splash
         Pop $0 
 
         MessageBox MB_OK "Transparency/Fading"
-        File /oname=$PLUGINSDIR\splash.bmp "${NSISDIR}\Contrib\Graphics\Wizard\llama.bmp"
+        File /oname=$PLUGINSDIR\splash.bmp "${CONTRIBDIR}\Graphics\Wizard\llama.bmp"
         advsplash::show 1000 600 400 0x04025C $PLUGINSDIR\splash
         Pop $0 
 
Index: Contrib/BgImage/Example.nsi
===================================================================
RCS file: /cvsroot/nsis/NSIS/Contrib/BgImage/Example.nsi,v
retrieving revision 1.4
diff -u -r1.4 Example.nsi
--- Contrib/BgImage/Example.nsi	6 Nov 2003 13:15:45 -0000	1.4
+++ Contrib/BgImage/Example.nsi	29 Oct 2005 18:08:42 -0000
@@ -17,8 +17,8 @@
 	# the plugins dir is automatically deleted when the installer exits
 	InitPluginsDir
 	# lets extract some bitmaps...
-	File /oname=$PLUGINSDIR\1.bmp "${NSISDIR}\Contrib\Graphics\Wizard\llama.bmp"
-	File /oname=$PLUGINSDIR\2.bmp "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp"
+	File /oname=$PLUGINSDIR\1.bmp "${CONTRIBDIR}\Graphics\Wizard\llama.bmp"
+	File /oname=$PLUGINSDIR\2.bmp "${CONTRIBDIR}\Graphics\Checks\modern.bmp"
 
 !ifdef DEBUG
 	# turn return values on if in debug mode
Index: Contrib/InstallOptions/Readme.html
===================================================================
RCS file: /cvsroot/nsis/NSIS/Contrib/InstallOptions/Readme.html,v
retrieving revision 1.53
diff -u -r1.53 Readme.html
--- Contrib/InstallOptions/Readme.html	11 Oct 2005 16:31:27 -0000	1.53
+++ Contrib/InstallOptions/Readme.html	29 Oct 2005 18:08:47 -0000
@@ -800,7 +800,7 @@
 sections and functions:</p>
 <pre>
 ReserveFile "test.ini"
-ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
+ReserveFile "${PLUGINDIR}\InstallOptions.dll"
 </pre></div>
 <h2>Fonts and colors</h2>
 <div>
Index: Contrib/InstallOptions/test.nsi
===================================================================
RCS file: /cvsroot/nsis/NSIS/Contrib/InstallOptions/test.nsi,v
retrieving revision 1.18
diff -u -r1.18 test.nsi
--- Contrib/InstallOptions/test.nsi	10 Jun 2003 13:18:07 -0000	1.18
+++ Contrib/InstallOptions/test.nsi	29 Oct 2005 18:08:48 -0000
@@ -17,7 +17,7 @@
 ;Only useful for BZIP2 compression
 ;Use ReserveFile for your own InstallOptions INI files too!
 
-ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
+ReserveFile "${PLUGINDIR}\InstallOptions.dll"
 ReserveFile "test.ini"
 
 ;Order of pages
Index: Contrib/InstallOptions/testimgs.nsi
===================================================================
RCS file: /cvsroot/nsis/NSIS/Contrib/InstallOptions/testimgs.nsi,v
retrieving revision 1.2
diff -u -r1.2 testimgs.nsi
--- Contrib/InstallOptions/testimgs.nsi	19 Jun 2005 21:39:03 -0000	1.2
+++ Contrib/InstallOptions/testimgs.nsi	29 Oct 2005 18:08:48 -0000
@@ -15,11 +15,11 @@
 ;Only useful for BZIP2 compression
 ;Use ReserveFile for your own InstallOptions INI files too!
 
-ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
+ReserveFile "${PLUGINDIR}\InstallOptions.dll"
 ReserveFile "testimgs.ini"
-ReserveFile "${NSISDIR}\Contrib\Graphics\Checks\colorful.bmp"
-ReserveFile "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp"
-ReserveFile "${NSISDIR}\Contrib\Graphics\Icons\pixel-install.ico"
+ReserveFile "${CONTRIBDIR}\Graphics\Checks\colorful.bmp"
+ReserveFile "${CONTRIBDIR}\Graphics\Checks\modern.bmp"
+ReserveFile "${CONTRIBDIR}\Graphics\Icons\pixel-install.ico"
 
 ;Order of pages
 Page custom SetCustom "" ": Testing InstallOptions" ;Custom page. InstallOptions gets called in SetCustom.
@@ -35,9 +35,9 @@
   
   InitPluginsDir
   File /oname=$PLUGINSDIR\testimgs.ini "testimgs.ini"
-  File /oname=$PLUGINSDIR\image.bmp "${NSISDIR}\Contrib\Graphics\Checks\colorful.bmp"
-  File /oname=$PLUGINSDIR\image2.bmp "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp"
-  File /oname=$PLUGINSDIR\icon.ico "${NSISDIR}\Contrib\Graphics\Icons\pixel-install.ico"
+  File /oname=$PLUGINSDIR\image.bmp "${CONTRIBDIR}\Graphics\Checks\colorful.bmp"
+  File /oname=$PLUGINSDIR\image2.bmp "${CONTRIBDIR}\Graphics\Checks\modern.bmp"
+  File /oname=$PLUGINSDIR\icon.ico "${CONTRIBDIR}\Graphics\Icons\pixel-install.ico"
 
   ;Write image paths to the INI file
 
Index: Contrib/InstallOptions/testlink.nsi
===================================================================
RCS file: /cvsroot/nsis/NSIS/Contrib/InstallOptions/testlink.nsi,v
retrieving revision 1.1
diff -u -r1.1 testlink.nsi
--- Contrib/InstallOptions/testlink.nsi	16 Jun 2003 18:49:23 -0000	1.1
+++ Contrib/InstallOptions/testlink.nsi	29 Oct 2005 18:08:48 -0000
@@ -19,7 +19,7 @@
 ;Only useful for BZIP2 compression
 ;Use ReserveFile for your own InstallOptions INI files too!
 
-ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
+ReserveFile "${PLUGINDIR}\InstallOptions.dll"
 ReserveFile "testlink.ini"
 
 ;Order of pages
Index: Contrib/Library/LibraryLocal/SConscript
===================================================================
RCS file: /cvsroot/nsis/NSIS/Contrib/Library/LibraryLocal/SConscript,v
retrieving revision 1.1
diff -u -r1.1 SConscript
--- Contrib/Library/LibraryLocal/SConscript	16 Apr 2005 18:48:50 -0000	1.1
+++ Contrib/Library/LibraryLocal/SConscript	29 Oct 2005 18:08:49 -0000
@@ -12,4 +12,4 @@
 
 Import('BuildUtil')
 
-BuildUtil(target, files, libs, flags = ['$EXCEPTION_FLAG'], install = 'Bin')
+BuildUtil(target, files, libs, flags = ['$EXCEPTION_FLAG'], install = '$NSIS_W32_BIN_DIR')
Index: Contrib/Library/RegTool/SConscript
===================================================================
RCS file: /cvsroot/nsis/NSIS/Contrib/Library/RegTool/SConscript,v
retrieving revision 1.3
diff -u -r1.3 SConscript
--- Contrib/Library/RegTool/SConscript	17 Sep 2005 08:50:41 -0000	1.3
+++ Contrib/Library/RegTool/SConscript	29 Oct 2005 18:08:49 -0000
@@ -14,4 +14,4 @@
 
 Import('BuildUtil')
 
-BuildUtil(target, files, libs, entry = 'WinMain', nodeflib = True, install_as = 'Bin/RegTool.bin')
+BuildUtil(target, files, libs, entry = 'WinMain', nodeflib = True, install_as = '$NSIS_CONTRIB_DIR/RegTool.bin')
Index: Contrib/MakeLangId/SConscript
===================================================================
RCS file: /cvsroot/nsis/NSIS/Contrib/MakeLangId/SConscript,v
retrieving revision 1.2
diff -u -r1.2 SConscript
--- Contrib/MakeLangId/SConscript	22 Oct 2005 12:05:33 -0000	1.2
+++ Contrib/MakeLangId/SConscript	29 Oct 2005 18:08:49 -0000
@@ -19,5 +19,5 @@
 
 Import('BuildUtil')
 
-BuildUtil(target, files, libs, res = res, resources = resources, entry = 'WinMain', install = 'Bin')
+BuildUtil(target, files, libs, res = res, resources = resources, entry = 'WinMain', install = '$NSIS_W32_BIN_DIR')
 
Index: Contrib/Makensisw/SConscript
===================================================================
RCS file: /cvsroot/nsis/NSIS/Contrib/Makensisw/SConscript,v
retrieving revision 1.4
diff -u -r1.4 SConscript
--- Contrib/Makensisw/SConscript	19 Jun 2005 11:20:15 -0000	1.4
+++ Contrib/Makensisw/SConscript	29 Oct 2005 18:08:49 -0000
@@ -53,7 +53,7 @@
 	res = res,
 	resources = resources,
 	entry = 'WinMain',
-	install = '',
+	install = '$NSIS_W32_BIN_DIR',
 	defines = ['WIN32_MEAN_AND_LEAN', 'RELEASE=2.0'],
 	docs = docs
 )
Index: Contrib/Modern UI/Readme.html
===================================================================
RCS file: /cvsroot/nsis/NSIS/Contrib/Modern UI/Readme.html,v
retrieving revision 1.146
diff -u -r1.146 Readme.html
--- Contrib/Modern UI/Readme.html	16 Sep 2005 11:27:51 -0000	1.146
+++ Contrib/Modern UI/Readme.html	29 Oct 2005 18:08:57 -0000
@@ -265,12 +265,12 @@
 "parameter">icon_file</span><br />
 The icon for the installer.<br />
 <em>Default:
-${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico</em></p>
+${CONTRIBDIR}\Graphics\Icons\modern-install.ico</em></p>
 <p><strong>MUI_UNICON</strong> <span class=
 "parameter">icon_file</span><br />
 The icon for the uninstaller.<br />
 <em>Default:
-${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico</em></p>
+${CONTRIBDIR}\Graphics\Icons\modern-uninstall.ico</em></p>
 <p><strong>MUI_HEADERIMAGE</strong><br />
 Display an image on the header of the page.</p>
 <div>
@@ -278,7 +278,7 @@
 "parameter">bmp_file</span><br />
 Bitmap image to display on the header of installers pages
 (recommended size: 150x57 pixels).<br />
-<em>Default: ${NSISDIR}\Contrib\Graphics\Header\nsis.bmp</em></p>
+<em>Default: ${CONTRIBDIR}\Graphics\Header\nsis.bmp</em></p>
 <div>
 <p><strong>MUI_HEADERIMAGE_BITMAP_NOSTRETCH</strong><br />
 Do not stretch the installer header bitmap to fit the size of the
@@ -348,18 +348,18 @@
 "parameter">ui_file</span><br />
 The interface file with the dialog resources. Change this if you
 have made your own customized UI.<br />
-<em>Default: ${NSISDIR}\Contrib\UIs\modern.exe</em></p>
+<em>Default: ${CONTRIBDIR}\UIs\modern.exe</em></p>
 <p><strong>MUI_UI_HEADERIMAGE</strong> <span class=
 "parameter">ui_file</span><br />
 The interface files with the dialog resource IDD_INST that contains
 a bitmap control and space for the header bitmap.<br />
-<em>Default: ${NSISDIR}\Contrib\UIs\modern_headerbmp.exe</em></p>
+<em>Default: ${CONTRIBDIR}\UIs\modern_headerbmp.exe</em></p>
 <p><strong>MUI_UI_HEADERIMAGE_RIGHT</strong> <span class=
 "parameter">ui_file</span><br />
 The interface files with the dialog resource IDD_INST that contains
 a bitmap control and space for the header bitmap on the right
 side.<br />
-<em>Default: ${NSISDIR}\Contrib\UIs\modern_headerbmpr.exe</em></p>
+<em>Default: ${CONTRIBDIR}\UIs\modern_headerbmpr.exe</em></p>
 <p><strong>MUI_UI_COMPONENTSPAGE_SMALLDESC</strong> <span class=
 "parameter">ui_file</span><br />
 The interface files with a customized dialog resource IDD_SELCOM
@@ -380,7 +380,7 @@
 "parameter">bmp_file</span><br />
 Bitmap for the Welcome page and the Finish page (recommended size:
 164x314 pixels).<br />
-<em>Default: ${NSISDIR}\Contrib\Graphics\Wizard\win.bmp</em></p>
+<em>Default: ${CONTRIBDIR}\Graphics\Wizard\win.bmp</em></p>
 <div>
 <p><strong>MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH</strong><br />
 Do not stretch the bitmap for the Welcome and Finish page to fit
@@ -400,7 +400,7 @@
 "parameter">ini_file</span><br />
 InstallOptions INI file for the Welcome page and the Finish
 page.<br />
-<em>Default: ${NSISDIR}\Contrib\Modern UI\ioSpecial.ini</em></p>
+<em>Default: ${CONTRIBDIR}\Modern UI\ioSpecial.ini</em></p>
 </div>
 <h3><img class="trigger" alt="Open/Close section" id=
 "trigger_inuwf" src="images/closed.gif" onclick=
@@ -411,7 +411,7 @@
 "parameter">bmp_file</span><br />
 Bitmap for the Welcome page and the Finish page (recommended size:
 164x314 pixels).<br />
-<em>Default: ${NSISDIR}\Contrib\Graphics\Wizard\win.bmp</em></p>
+<em>Default: ${CONTRIBDIR}\Graphics\Wizard\win.bmp</em></p>
 <div>
 <p><strong>MUI_UNWELCOMEFINISHPAGE_BITMAP_NOSTRETCH</strong><br />
 Do not stretch the bitmap for the Welcome and Finish page to fit
@@ -431,7 +431,7 @@
 "parameter">ini_file</span><br />
 InstallOptions INI file for the uninstaller Welcome page and the
 Finish page.<br />
-<em>Default: ${NSISDIR}\Contrib\Modern UI\ioSpecial.ini</em></p>
+<em>Default: ${CONTRIBDIR}\Modern UI\ioSpecial.ini</em></p>
 </div>
 <h3><img class="trigger" alt="Open/Close section" id="trigger_inl"
 src="images/closed.gif" onclick=
@@ -455,7 +455,7 @@
 "parameter">bitmap_file</span><br />
 The bitmap with images for the checks of the component select
 treeview.<br />
-<em>Default: ${NSISDIR}\Contrib\Graphics\Checks\modern.bmp</em></p>
+<em>Default: ${CONTRIBDIR}\Graphics\Checks\modern.bmp</em></p>
 <p><strong>MUI_COMPONENTSPAGE_SMALLDESC</strong><br />
 A small description area on the bottom of the page. Use this layout
 if you have a lot of sections and don't need large
Index: Contrib/Modern UI/System.nsh
===================================================================
RCS file: /cvsroot/nsis/NSIS/Contrib/Modern UI/System.nsh,v
retrieving revision 1.200
diff -u -r1.200 System.nsh
--- Contrib/Modern UI/System.nsh	4 Sep 2005 21:24:27 -0000	1.200
+++ Contrib/Modern UI/System.nsh	29 Oct 2005 18:09:07 -0000
@@ -97,26 +97,26 @@
     !insertmacro MUI_NSISCONF
   !endif
 
-  !insertmacro MUI_DEFAULT MUI_UI "${NSISDIR}\Contrib\UIs\modern.exe"
-  !insertmacro MUI_DEFAULT MUI_UI_HEADERIMAGE "${NSISDIR}\Contrib\UIs\modern_headerbmp.exe"
-  !insertmacro MUI_DEFAULT MUI_UI_HEADERIMAGE_RIGHT "${NSISDIR}\Contrib\UIs\modern_headerbmpr.exe"
-  !insertmacro MUI_DEFAULT MUI_UI_COMPONENTSPAGE_SMALLDESC "${NSISDIR}\Contrib\UIs\modern_smalldesc.exe"
-  !insertmacro MUI_DEFAULT MUI_UI_COMPONENTSPAGE_NODESC "${NSISDIR}\Contrib\UIs\modern_nodesc.exe"
-  !insertmacro MUI_DEFAULT MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
-  !insertmacro MUI_DEFAULT MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
-  !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_CHECKBITMAP "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp"
+  !insertmacro MUI_DEFAULT MUI_UI "${CONTRIBDIR}\UIs\modern.exe"
+  !insertmacro MUI_DEFAULT MUI_UI_HEADERIMAGE "${CONTRIBDIR}\UIs\modern_headerbmp.exe"
+  !insertmacro MUI_DEFAULT MUI_UI_HEADERIMAGE_RIGHT "${CONTRIBDIR}\UIs\modern_headerbmpr.exe"
+  !insertmacro MUI_DEFAULT MUI_UI_COMPONENTSPAGE_SMALLDESC "${CONTRIBDIR}\UIs\modern_smalldesc.exe"
+  !insertmacro MUI_DEFAULT MUI_UI_COMPONENTSPAGE_NODESC "${CONTRIBDIR}\UIs\modern_nodesc.exe"
+  !insertmacro MUI_DEFAULT MUI_ICON "${CONTRIBDIR}\Graphics\Icons\modern-install.ico"
+  !insertmacro MUI_DEFAULT MUI_UNICON "${CONTRIBDIR}\Graphics\Icons\modern-uninstall.ico"
+  !insertmacro MUI_DEFAULT MUI_COMPONENTSPAGE_CHECKBITMAP "${CONTRIBDIR}\Graphics\Checks\modern.bmp"
   !insertmacro MUI_DEFAULT MUI_LICENSEPAGE_BGCOLOR "/windows"
   !insertmacro MUI_DEFAULT MUI_INSTFILESPAGE_COLORS "/windows"
   !insertmacro MUI_DEFAULT MUI_INSTFILESPAGE_PROGRESSBAR "smooth"
   !insertmacro MUI_DEFAULT MUI_BGCOLOR "FFFFFF"
-  !insertmacro MUI_DEFAULT MUI_WELCOMEFINISHPAGE_INI "${NSISDIR}\Contrib\Modern UI\ioSpecial.ini"
-  !insertmacro MUI_DEFAULT MUI_UNWELCOMEFINISHPAGE_INI "${NSISDIR}\Contrib\Modern UI\ioSpecial.ini"
-  !insertmacro MUI_DEFAULT MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\win.bmp"
-  !insertmacro MUI_DEFAULT MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\win.bmp"
+  !insertmacro MUI_DEFAULT MUI_WELCOMEFINISHPAGE_INI "${CONTRIBDIR}\Modern UI\ioSpecial.ini"
+  !insertmacro MUI_DEFAULT MUI_UNWELCOMEFINISHPAGE_INI "${CONTRIBDIR}\Modern UI\ioSpecial.ini"
+  !insertmacro MUI_DEFAULT MUI_WELCOMEFINISHPAGE_BITMAP "${CONTRIBDIR}\Graphics\Wizard\win.bmp"
+  !insertmacro MUI_DEFAULT MUI_UNWELCOMEFINISHPAGE_BITMAP "${CONTRIBDIR}\Graphics\Wizard\win.bmp"
 
   !ifdef MUI_HEADERIMAGE
 
-    !insertmacro MUI_DEFAULT MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp"
+    !insertmacro MUI_DEFAULT MUI_HEADERIMAGE_BITMAP "${CONTRIBDIR}\Graphics\Header\nsis.bmp"
 
     !ifndef MUI_HEADERIMAGE_UNBITMAP
       !define MUI_HEADERIMAGE_UNBITMAP "${MUI_HEADERIMAGE_BITMAP}"
@@ -1926,7 +1926,7 @@
   !verbose push
   !verbose ${MUI_VERBOSE}
 
-  ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
+  ReserveFile "${PLUGINDIR}\InstallOptions.dll"
 
   !verbose pop
 
@@ -1937,7 +1937,7 @@
   !verbose push
   !verbose ${MUI_VERBOSE}
 
-  ReserveFile "${NSISDIR}\Plugins\LangDLL.dll"
+  ReserveFile "${PLUGINDIR}\LangDLL.dll"
 
   !verbose pop
 
@@ -1951,7 +1951,7 @@
   !verbose push
   !verbose ${MUI_VERBOSE}
 
-  !include "${NSISDIR}\Contrib\Modern UI\Language files\${LANGUAGE}.nsh"
+  !include "${CONTRIBDIR}\Modern UI\Language files\${LANGUAGE}.nsh"
 
   !verbose pop
 
@@ -2058,7 +2058,7 @@
 
     !define "MUI_LANGUAGEFILE_${LANGUAGE}_USED"
 
-    LoadLanguageFile "${NSISDIR}\Contrib\Language files\${LANGUAGE}.nlf"
+    LoadLanguageFile "${CONTRIBDIR}\Language files\${LANGUAGE}.nlf"
 
   !else
 
@@ -2154,7 +2154,7 @@
 
 !macro MUI_LANGUAGEFILE_END
 
-  !include "${NSISDIR}\Contrib\Modern UI\Language files\Default.nsh"
+  !include "${CONTRIBDIR}\Modern UI\Language files\Default.nsh"
   !ifdef MUI_LANGUAGEFILE_DEFAULT_USED
     !undef MUI_LANGUAGEFILE_DEFAULT_USED
     !warning "${LANGUAGE} Modern UI language file version doesn't match. Using default English texts for missing strings."
Index: Contrib/NSIS Menu/SConscript
===================================================================
RCS file: /cvsroot/nsis/NSIS/Contrib/NSIS Menu/SConscript,v
retrieving revision 1.1
diff -u -r1.1 SConscript
--- Contrib/NSIS Menu/SConscript	17 Jun 2005 18:38:36 -0000	1.1
+++ Contrib/NSIS Menu/SConscript	29 Oct 2005 18:09:08 -0000
@@ -46,24 +46,24 @@
 #BuildUtil(target, files, libs, libpath = wxlib, cpppath = wxinc, res = rc, resources = resources, install = '', flags = ['/MD'])
 
 # install pre-built NSIS.exe
-ins = env.Distribute('', '#NSIS.exe')
+ins = env.Distribute('$NSIS_W32_BIN_DIR', '#NSIS.exe')
 
 env.Alias('install-utils', ins)
 
 # install menu files
-env.Distribute('Menu', '#Menu/compiler.html')
-env.Distribute('Menu', '#Menu/docs.html')
-env.Distribute('Menu', '#Menu/index.html')
-env.Distribute('Menu', '#Menu/intro.html')
-env.Distribute('Menu', '#Menu/notinstalled.html')
-env.Distribute('Menu', '#Menu/update.html')
-env.Distribute('Menu', '#Menu/websites.html')
+env.Distribute('$NSIS_MENU_DIR', '#Menu/compiler.html')
+env.Distribute('$NSIS_MENU_DIR', '#Menu/docs.html')
+env.Distribute('$NSIS_MENU_DIR', '#Menu/index.html')
+env.Distribute('$NSIS_MENU_DIR', '#Menu/intro.html')
+env.Distribute('$NSIS_MENU_DIR', '#Menu/notinstalled.html')
+env.Distribute('$NSIS_MENU_DIR', '#Menu/update.html')
+env.Distribute('$NSIS_MENU_DIR', '#Menu/websites.html')
 
-env.Distribute('Menu/images', '#Menu/images/clear.gif')
-env.Distribute('Menu/images', '#Menu/images/header.gif')
-env.Distribute('Menu/images', '#Menu/images/line.gif')
-env.Distribute('Menu/images', '#Menu/images/menu.gif')
-env.Distribute('Menu/images', '#Menu/images/menud.gif')
-env.Distribute('Menu/images', '#Menu/images/site.gif')
+env.Distribute('$NSIS_MENU_DIR/images', '#Menu/images/clear.gif')
+env.Distribute('$NSIS_MENU_DIR/images', '#Menu/images/header.gif')
+env.Distribute('$NSIS_MENU_DIR/images', '#Menu/images/line.gif')
+env.Distribute('$NSIS_MENU_DIR/images', '#Menu/images/menu.gif')
+env.Distribute('$NSIS_MENU_DIR/images', '#Menu/images/menud.gif')
+env.Distribute('$NSIS_MENU_DIR/images', '#Menu/images/site.gif')
 
-env.Alias('install-utils', '$PREFIX/Menu')
+env.Alias('install-utils', '$NSIS_MENU_DIR')
Index: Contrib/Splash/Example.nsi
===================================================================
RCS file: /cvsroot/nsis/NSIS/Contrib/Splash/Example.nsi,v
retrieving revision 1.3
diff -u -r1.3 Example.nsi
--- Contrib/Splash/Example.nsi	16 Sep 2005 11:27:51 -0000	1.3
+++ Contrib/Splash/Example.nsi	29 Oct 2005 18:09:09 -0000
@@ -7,7 +7,7 @@
 Function .onInit
 	# the plugins dir is automatically deleted when the installer exits
 	InitPluginsDir
-	File /oname=$PLUGINSDIR\splash.bmp "${NSISDIR}\Contrib\Graphics\Wizard\orange-nsis.bmp"
+	File /oname=$PLUGINSDIR\splash.bmp "${CONTRIBDIR}\Graphics\Wizard\orange-nsis.bmp"
 	#optional
 	#File /oname=$PLUGINSDIR\splash.wav "C:\myprog\sound.wav"
 
Index: Contrib/StartMenu/Example.nsi
===================================================================
RCS file: /cvsroot/nsis/NSIS/Contrib/StartMenu/Example.nsi,v
retrieving revision 1.9
diff -u -r1.9 Example.nsi
--- Contrib/StartMenu/Example.nsi	18 Mar 2003 15:50:58 -0000	1.9
+++ Contrib/StartMenu/Example.nsi	29 Oct 2005 18:09:09 -0000
@@ -7,7 +7,7 @@
 Page directory
 DirText "This installer will create some shortcuts to MakeNSIS in the start menu.$\nFor this it needs NSIS's path." \
   "Please specify the path in which you have installed NSIS:"
-InstallDir "${NSISDIR}"
+InstallDir "$EXEDIR"
 Function .onVerifyInstDir
 	IfFileExists $INSTDIR\makensis.exe +2
 		Abort
@@ -46,4 +46,4 @@
 		CreateShortCut "$SMPROGRAMS\$R0\All users MakeNSISw.lnk" $INSTDIR\makensisw.exe
 
 	skip:
-SectionEnd
\ No newline at end of file
+SectionEnd
Index: Contrib/System/System.nsi
===================================================================
RCS file: /cvsroot/nsis/NSIS/Contrib/System/System.nsi,v
retrieving revision 1.11
diff -u -r1.11 System.nsi
--- Contrib/System/System.nsi	19 Jun 2005 21:39:04 -0000	1.11
+++ Contrib/System/System.nsi	29 Oct 2005 18:09:10 -0000
@@ -114,7 +114,7 @@
      ; ----- Sample 7 ----- systemSplash -> Callbacks demonstration -----
 
      ; Logo
-     File /oname=spltmp.bmp "${NSISDIR}\Contrib\Graphics\Header\orange-nsis.bmp"
+     File /oname=spltmp.bmp "${CONTRIBDIR}\Graphics\Header\orange-nsis.bmp"
 ;     File /oname=spltmp.wav "d:\Windows\Media\tada.wav"
 
      ; I. systemSplash variant
Index: Contrib/UIs/SConscript
===================================================================
RCS file: /cvsroot/nsis/NSIS/Contrib/UIs/SConscript,v
retrieving revision 1.4
diff -u -r1.4 SConscript
--- Contrib/UIs/SConscript	16 Jul 2005 10:03:54 -0000	1.4
+++ Contrib/UIs/SConscript	29 Oct 2005 18:09:17 -0000
@@ -22,5 +22,5 @@
 code = env.Object(code)
 
 for ui in uis:
-	ui = BuildUtil(ui, [code], libs, entry = 'WinMain', res = ui + '.rc', install = 'Contrib/UIs')
+	ui = BuildUtil(ui, [code], libs, entry = 'WinMain', res = ui + '.rc', install = '$NSIS_CONTRIB_DIR/UIs')
 	env.Alias('UIs', ui)
Index: Contrib/VPatch/SConscript
===================================================================
RCS file: /cvsroot/nsis/NSIS/Contrib/VPatch/SConscript,v
retrieving revision 1.1
diff -u -r1.1 SConscript
--- Contrib/VPatch/SConscript	17 Sep 2005 09:25:44 -0000	1.1
+++ Contrib/VPatch/SConscript	29 Oct 2005 18:09:17 -0000
@@ -19,4 +19,4 @@
 
 defenv.DistributeExamples(target, examples)
 defenv.DistributeDocs(target, docs)
-defenv.Distribute('Include', includes)
+defenv.Distribute('$NSIS_INCLUDE_DIR', includes)
Index: Contrib/VPatch/Source/GenPat/SConscript
===================================================================
RCS file: /cvsroot/nsis/NSIS/Contrib/VPatch/Source/GenPat/SConscript,v
retrieving revision 1.2
diff -u -r1.2 SConscript
--- Contrib/VPatch/Source/GenPat/SConscript	17 Sep 2005 09:43:40 -0000	1.2
+++ Contrib/VPatch/Source/GenPat/SConscript	29 Oct 2005 18:09:17 -0000
@@ -17,4 +17,4 @@
 
 Import('BuildUtil')
 
-BuildUtil(target, files, libs, flags = ['$EXCEPTION_FLAG'], install = 'Bin', cross_platform = True)
+BuildUtil(target, files, libs, flags = ['$EXCEPTION_FLAG'], install = '$NSIS_BIN_DIR', cross_platform = True)
Index: Contrib/zip2exe/SConscript
===================================================================
RCS file: /cvsroot/nsis/NSIS/Contrib/zip2exe/SConscript,v
retrieving revision 1.3
diff -u -r1.3 SConscript
--- Contrib/zip2exe/SConscript	30 Apr 2005 18:04:54 -0000	1.3
+++ Contrib/zip2exe/SConscript	29 Oct 2005 18:09:18 -0000
@@ -36,6 +36,6 @@
 
 Import('BuildUtil defenv')
 
-BuildUtil(target, files, libs, res = rc, resources = resources, install = 'Bin')
+BuildUtil(target, files, libs, res = rc, resources = resources, install = '$NSIS_W32_BIN_DIR')
 
 defenv.DistributeContribs(target, headers)
Index: Contrib/zip2exe/main.cpp
===================================================================
RCS file: /cvsroot/nsis/NSIS/Contrib/zip2exe/main.cpp,v
retrieving revision 1.13
diff -u -r1.13 main.cpp
--- Contrib/zip2exe/main.cpp	21 Oct 2005 13:55:15 -0000	1.13
+++ Contrib/zip2exe/main.cpp	29 Oct 2005 18:09:21 -0000
@@ -515,8 +515,8 @@
     fprintf(fp,"!define ZIP2EXE_INSTALLDIR `%s`\n",buf);
   }
 
-  fprintf(fp,"!include `${NSISDIR}\\Contrib\\zip2exe\\Base.nsh`\n");
-  fprintf(fp,"!include `${NSISDIR}\\Contrib\\zip2exe\\%s.nsh`\n",g_mui?"Modern":"Classic");
+  fprintf(fp,"!include `${CONTRIBDIR}\\zip2exe\\Base.nsh`\n");
+  fprintf(fp,"!include `${CONTRIBDIR}\\zip2exe\\%s.nsh`\n",g_mui?"Modern":"Classic");
 
   fprintf(fp,"!insertmacro SECTION_BEGIN\n");
   fprintf(fp,"File /r `%s\\*.*`\n",tempzip_path);
Index: Docs/src/SConscript
===================================================================
RCS file: /cvsroot/nsis/NSIS/Docs/src/SConscript,v
retrieving revision 1.8
diff -u -r1.8 SConscript
--- Docs/src/SConscript	21 Jun 2005 12:37:38 -0000	1.8
+++ Docs/src/SConscript	29 Oct 2005 18:09:21 -0000
@@ -86,6 +86,7 @@
 	env.Distribute('', chm)
 
 else:
+	print '${SOURCE.dir}/../style.css'
 	html_builder = Builder(
 		action = [
 			Copy(build_dir, '${SOURCE.dir}/../style.css'),
Index: Docs/src/attributes.but
===================================================================
RCS file: /cvsroot/nsis/NSIS/Docs/src/attributes.but,v
retrieving revision 1.66
diff -u -r1.66 attributes.but
--- Docs/src/attributes.but	22 Oct 2005 16:52:16 -0000	1.66
+++ Docs/src/attributes.but	29 Oct 2005 18:09:25 -0000
@@ -80,7 +80,7 @@
 
 \b \e{IDD_VERIFY} must contain \e{IDC_STR} (static).
 
-\c ChangeUI all "${NSISDIR}\Contrib\UIs\sdbarker_tiny.exe"
+\c ChangeUI all "${CONTRIBDIR}\UIs\sdbarker_tiny.exe"
 
 \S2{acheckbitmap} CheckBitmap
 
Index: Docs/src/callback.but
===================================================================
RCS file: /cvsroot/nsis/NSIS/Docs/src/callback.but,v
retrieving revision 1.19
diff -u -r1.19 callback.but
--- Docs/src/callback.but	30 Jun 2005 18:16:26 -0000	1.19
+++ Docs/src/callback.but	29 Oct 2005 18:09:26 -0000
@@ -10,7 +10,7 @@
 
 Example:
 
-\c  !include "${NSISDIR}\Include\WinMessages.nsh"
+\c  !include "WinMessages.nsh"
 \c
 \c  Function .onGUIInit
 \c    # 1028 is the id of the branding text control
Index: Docs/src/compiler.but
===================================================================
RCS file: /cvsroot/nsis/NSIS/Docs/src/compiler.but,v
retrieving revision 1.24
diff -u -r1.24 compiler.but
--- Docs/src/compiler.but	12 Oct 2005 14:24:21 -0000	1.24
+++ Docs/src/compiler.but	29 Oct 2005 18:09:27 -0000
@@ -19,7 +19,7 @@
 
 \c directory
 
-Adds another include directory to the include directories list. This list is searched when !include is used. This list's initial value is $\{NSISDIR\}\\Include alone.
+Adds another include directory to the include directories list. This list is searched when !include is used. This list's initial value is $\{INCLUDEDIR\} alone.
 
 \c !addincludedir ..\include
 \c !include something.nsh
Index: Docs/src/var.but
===================================================================
RCS file: /cvsroot/nsis/NSIS/Docs/src/var.but,v
retrieving revision 1.35
diff -u -r1.35 var.but
--- Docs/src/var.but	16 Sep 2005 11:27:51 -0000	1.35
+++ Docs/src/var.but	29 Oct 2005 18:09:29 -0000
@@ -75,9 +75,13 @@
 
 The location of the installer executable (technically you can modify this variable, but it is probably not a good idea).
 
-\e{$\{NSISDIR\}}
+\e{$\{CONTRIBDIR\}}
 
-A symbol that contains the path where NSIS is installed. Detected at compile time. Useful if you want to call resources that are in NSIS directory e.g. Icons, UIs...
+A symbol that contains the path where NSIS resources are installed. Useful if you want to call resources that are in NSIS directory e.g. Icons, UIs...
+
+\e{$\{PLUGINDIR\}}
+
+A symbol that contains the path where NSIS plugins are installed.
 
 \e{$WINDIR}
 
Index: Examples/VersionInfo.nsi
===================================================================
RCS file: /cvsroot/nsis/NSIS/Examples/VersionInfo.nsi,v
retrieving revision 1.7
diff -u -r1.7 VersionInfo.nsi
--- Examples/VersionInfo.nsi	21 Apr 2005 14:22:23 -0000	1.7
+++ Examples/VersionInfo.nsi	29 Oct 2005 18:09:29 -0000
@@ -9,7 +9,7 @@
 
 OutFile "VersionInfo.exe"
 
-LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf"
+LoadLanguageFile "${CONTRIBDIR}\Language files\English.nlf"
 ;--------------------------------
 ;Version Information
 
Index: Examples/bigtest.nsi
===================================================================
RCS file: /cvsroot/nsis/NSIS/Examples/bigtest.nsi,v
retrieving revision 1.11
diff -u -r1.11 bigtest.nsi
--- Examples/bigtest.nsi	26 Oct 2005 19:01:13 -0000	1.11
+++ Examples/bigtest.nsi	29 Oct 2005 18:09:30 -0000
@@ -16,7 +16,7 @@
 
 Name "BigNSISTest"
 Caption "NSIS Big Test"
-Icon "${NSISDIR}\Contrib\Graphics\Icons\nsis1-install.ico"
+Icon "${CONTRIBDIR}\Graphics\Icons\nsis1-install.ico"
 OutFile "bigtest.exe"
 
 SetDateSave on
@@ -30,7 +30,7 @@
 InstallDir "$PROGRAMFILES\NSISTest\BigNSISTest"
 InstallDirRegKey HKLM "Software\NSISTest\BigNSISTest" ""
 
-CheckBitmap "${NSISDIR}\Contrib\Graphics\Checks\classic-cross.bmp"
+CheckBitmap "${CONTRIBDIR}\Graphics\Checks\classic-cross.bmp"
 
 LicenseText "A test text, make sure it's all there"
 LicenseData "bigtest.nsi"
@@ -277,7 +277,7 @@
 ; Uninstaller
 
 UninstallText "This will uninstall example2. Hit next to continue."
-UninstallIcon "${NSISDIR}\Contrib\Graphics\Icons\nsis1-uninstall.ico"
+UninstallIcon "${CONTRIBDIR}\Graphics\Icons\nsis1-uninstall.ico"
 
 Section "Uninstall"
 
Index: Examples/gfx.nsi
===================================================================
RCS file: /cvsroot/nsis/NSIS/Examples/gfx.nsi,v
retrieving revision 1.9
diff -u -r1.9 gfx.nsi
--- Examples/gfx.nsi	23 Sep 2003 18:33:59 -0000	1.9
+++ Examples/gfx.nsi	29 Oct 2005 18:09:31 -0000
@@ -57,7 +57,7 @@
 Section ""
 	; You can also use the BI_NEXT macro here...
 	MessageBox MB_YESNO "We can change the branding image from within a section too!$\nDo you want me to change it?" IDNO done
-		!insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Wizard\nsis.bmp" ""
+		!insertmacro BIMAGE "${CONTRIBDIR}\Graphics\Wizard\nsis.bmp" ""
 	done:
 	WriteUninstaller uninst.exe
 SectionEnd
@@ -65,24 +65,24 @@
 ;--------------------------------
 
 Function licenseImage
-	!insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp" /RESIZETOFIT
+	!insertmacro BIMAGE "${CONTRIBDIR}\Graphics\Header\nsis.bmp" /RESIZETOFIT
 	MessageBox MB_YESNO 'Would you like to skip the license page?' IDNO no
 		Abort
 	no:
 FunctionEnd
 
 Function customPage
-	!insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp" /RESIZETOFIT
+	!insertmacro BIMAGE "${CONTRIBDIR}\Graphics\Checks\modern.bmp" /RESIZETOFIT
 	MessageBox MB_OK 'This is a nice custom "page" with yet another image :P'
 	#insert install options/start menu/<insert plugin name here> here
 FunctionEnd
 
 Function dirImage
-	!insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Header\win.bmp" /RESIZETOFIT
+	!insertmacro BIMAGE "${CONTRIBDIR}\Graphics\Header\win.bmp" /RESIZETOFIT
 FunctionEnd
 
 Function instImage
-	!insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Wizard\llama.bmp" /RESIZETOFIT
+	!insertmacro BIMAGE "${CONTRIBDIR}\Graphics\Wizard\llama.bmp" /RESIZETOFIT
 FunctionEnd
 
 ;--------------------------------
@@ -94,17 +94,17 @@
 UninstPage instfiles un.instImage
 
 Function un.uninstImage
-	!insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp" /RESIZETOFIT
+	!insertmacro BIMAGE "${CONTRIBDIR}\Graphics\Checks\modern.bmp" /RESIZETOFIT
 FunctionEnd
 
 Function un.customPage
-	!insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Header\win.bmp" /RESIZETOFIT
+	!insertmacro BIMAGE "${CONTRIBDIR}\Graphics\Header\win.bmp" /RESIZETOFIT
 	MessageBox MB_OK 'This is a nice uninstaller custom "page" with yet another image :P'
 	#insert install options/start menu/<insert plugin name here> here
 FunctionEnd
 
 Function un.instImage
-	!insertmacro BIMAGE "${NSISDIR}\Contrib\Graphics\Wizard\llama.bmp" /RESIZETOFIT
+	!insertmacro BIMAGE "${CONTRIBDIR}\Graphics\Wizard\llama.bmp" /RESIZETOFIT
 FunctionEnd
 
 ;--------------------------------
Index: Examples/languages.nsi
===================================================================
RCS file: /cvsroot/nsis/NSIS/Examples/languages.nsi,v
retrieving revision 1.18
diff -u -r1.18 languages.nsi
--- Examples/languages.nsi	19 Jun 2005 21:39:04 -0000	1.18
+++ Examples/languages.nsi	29 Oct 2005 18:09:32 -0000
@@ -18,17 +18,17 @@
 ;--------------------------------
 
 ; First is default
-LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf"
-LoadLanguageFile "${NSISDIR}\Contrib\Language files\Dutch.nlf"
-LoadLanguageFile "${NSISDIR}\Contrib\Language files\French.nlf"
-LoadLanguageFile "${NSISDIR}\Contrib\Language files\German.nlf"
-LoadLanguageFile "${NSISDIR}\Contrib\Language files\Korean.nlf"
-LoadLanguageFile "${NSISDIR}\Contrib\Language files\Russian.nlf"
-LoadLanguageFile "${NSISDIR}\Contrib\Language files\Spanish.nlf"
-LoadLanguageFile "${NSISDIR}\Contrib\Language files\Swedish.nlf"
-LoadLanguageFile "${NSISDIR}\Contrib\Language files\TradChinese.nlf"
-LoadLanguageFile "${NSISDIR}\Contrib\Language files\SimpChinese.nlf"
-LoadLanguageFile "${NSISDIR}\Contrib\Language files\Slovak.nlf"
+LoadLanguageFile "${CONTRIBDIR}\Language files\English.nlf"
+LoadLanguageFile "${CONTRIBDIR}\Language files\Dutch.nlf"
+LoadLanguageFile "${CONTRIBDIR}\Language files\French.nlf"
+LoadLanguageFile "${CONTRIBDIR}\Language files\German.nlf"
+LoadLanguageFile "${CONTRIBDIR}\Language files\Korean.nlf"
+LoadLanguageFile "${CONTRIBDIR}\Language files\Russian.nlf"
+LoadLanguageFile "${CONTRIBDIR}\Language files\Spanish.nlf"
+LoadLanguageFile "${CONTRIBDIR}\Language files\Swedish.nlf"
+LoadLanguageFile "${CONTRIBDIR}\Language files\TradChinese.nlf"
+LoadLanguageFile "${CONTRIBDIR}\Language files\SimpChinese.nlf"
+LoadLanguageFile "${CONTRIBDIR}\Language files\Slovak.nlf"
 
 ; License data
 ; Not exactly translated, but it shows what's needed
Index: Examples/makensis.nsi
===================================================================
RCS file: /cvsroot/nsis/NSIS/Examples/makensis.nsi,v
retrieving revision 1.209
diff -u -r1.209 makensis.nsi
--- Examples/makensis.nsi	17 Sep 2005 09:25:44 -0000	1.209
+++ Examples/makensis.nsi	29 Oct 2005 18:09:37 -0000
@@ -46,7 +46,7 @@
 !define MUI_ABORTWARNING
 
 !define MUI_HEADERIMAGE
-!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\nsis.bmp"
+!define MUI_WELCOMEFINISHPAGE_BITMAP "${CONTRIBDIR}\Graphics\Wizard\nsis.bmp"
 
 !define MUI_COMPONENTSPAGE_SMALLDESC
 
Index: Examples/waplugin.nsi
===================================================================
RCS file: /cvsroot/nsis/NSIS/Examples/waplugin.nsi,v
retrieving revision 1.9
diff -u -r1.9 waplugin.nsi
--- Examples/waplugin.nsi	9 Jul 2005 15:56:54 -0000	1.9
+++ Examples/waplugin.nsi	29 Oct 2005 18:09:37 -0000
@@ -57,7 +57,7 @@
 
   ; File to extract
   #File "C:\program files\winamp\plugins\vis_nsfs.dll"
-  File /oname=vis_nsfs.dll "${NSISDIR}\Plugins\TypeLib.dll" # dummy plug-in
+  File /oname=vis_nsfs.dll "${PLUGINDIR}\TypeLib.dll" # dummy plug-in
 
   ; prompt user, and if they select no, go to NoWinamp
   MessageBox MB_YESNO|MB_ICONQUESTION \
Index: Examples/Modern UI/HeaderBitmap.nsi
===================================================================
RCS file: /cvsroot/nsis/NSIS/Examples/Modern UI/HeaderBitmap.nsi,v
retrieving revision 1.22
diff -u -r1.22 HeaderBitmap.nsi
--- Examples/Modern UI/HeaderBitmap.nsi	19 Jun 2005 21:39:04 -0000	1.22
+++ Examples/Modern UI/HeaderBitmap.nsi	29 Oct 2005 18:09:38 -0000
@@ -24,7 +24,7 @@
 ;Interface Configuration
 
   !define MUI_HEADERIMAGE
-  !define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp" ; optional
+  !define MUI_HEADERIMAGE_BITMAP "${CONTRIBDIR}\Graphics\Header\nsis.bmp" ; optional
   !define MUI_ABORTWARNING
 
 ;--------------------------------
Index: Include/Library.nsh
===================================================================
RCS file: /cvsroot/nsis/NSIS/Include/Library.nsh,v
retrieving revision 1.25
diff -u -r1.25 Library.nsh
--- Include/Library.nsh	12 Oct 2005 11:10:23 -0000	1.25
+++ Include/Library.nsh	29 Oct 2005 18:09:40 -0000
@@ -89,7 +89,7 @@
   StrCpy $R3 $R3 -4 1
   IfFileExists $R3 +3
 
-    File /oname=$R2\NSIS.Library.RegTool.v2.$__INSTALLLLIB_SESSIONGUID.exe "${NSISDIR}\Bin\RegTool.bin"
+    File /oname=$R2\NSIS.Library.RegTool.v2.$__INSTALLLLIB_SESSIONGUID.exe "${CONTRIBDIR}\RegTool.bin"
     WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\RunOnce" \
       "NSIS.Library.RegTool.v2" '"$R2\NSIS.Library.RegTool.v2.$__INSTALLLLIB_SESSIONGUID.exe" /S'
 
@@ -110,7 +110,7 @@
 !macro __InstallLib_Helper_GetVersion TYPE FILE
 
   !tempfile LIBRARY_TEMP_NSH
-  !execute '"${NSISDIR}\Bin\LibraryLocal.exe" "${TYPE}" "${FILE}" "${LIBRARY_TEMP_NSH}"'
+  !execute '"${BINDIR}\LibraryLocal.exe" "${TYPE}" "${FILE}" "${LIBRARY_TEMP_NSH}"'
   !include "${LIBRARY_TEMP_NSH}"
   !delfile "${LIBRARY_TEMP_NSH}"
   !undef LIBRARY_TEMP_NSH
Index: Include/MUI.nsh
===================================================================
RCS file: /cvsroot/nsis/NSIS/Include/MUI.nsh,v
retrieving revision 1.1
diff -u -r1.1 MUI.nsh
--- Include/MUI.nsh	7 Feb 2003 14:15:51 -0000	1.1
+++ Include/MUI.nsh	29 Oct 2005 18:09:40 -0000
@@ -1 +1 @@
-!include "${NSISDIR}\Contrib\Modern UI\System.nsh"
\ No newline at end of file
+!include "${CONTRIBDIR}\Modern UI\System.nsh"
\ No newline at end of file
Index: Include/SConscript
===================================================================
RCS file: /cvsroot/nsis/NSIS/Include/SConscript,v
retrieving revision 1.2
diff -u -r1.2 SConscript
--- Include/SConscript	21 Jun 2005 17:43:36 -0000	1.2
+++ Include/SConscript	29 Oct 2005 18:09:40 -0000
@@ -14,5 +14,5 @@
 
 Import('env')
 
-env.Distribute('Include', includes)
+env.Distribute('$NSIS_INCLUDE_DIR', includes)
 env.DistributeDocs('StrFunc', 'StrFunc.txt')
Index: Include/UpgradeDLL.nsh
===================================================================
RCS file: /cvsroot/nsis/NSIS/Include/UpgradeDLL.nsh,v
retrieving revision 1.8
diff -u -r1.8 UpgradeDLL.nsh
--- Include/UpgradeDLL.nsh	12 Oct 2005 11:10:23 -0000	1.8
+++ Include/UpgradeDLL.nsh	29 Oct 2005 18:09:41 -0000
@@ -71,7 +71,7 @@
   StrCpy $R3 $R3 -4 1
   IfFileExists $R3 +3
 
-    File /oname=$R2\NSIS.Library.RegTool.v2.$HWNDPARENT.exe "${NSISDIR}\Bin\RegTool.bin"
+    File /oname=$R2\NSIS.Library.RegTool.v2.$HWNDPARENT.exe "${CONTRIBDIR}\RegTool.bin"
     WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\RunOnce" \
       "NSIS.Library.RegTool.v2" '"$R2\NSIS.Library.RegTool.v2.$HWNDPARENT.exe" /S'
 
Index: SCons/config.py
===================================================================
RCS file: /cvsroot/nsis/NSIS/SCons/config.py,v
retrieving revision 1.3
diff -u -r1.3 config.py
--- SCons/config.py	16 Oct 2005 12:50:29 -0000	1.3
+++ SCons/config.py	29 Oct 2005 18:09:43 -0000
@@ -399,6 +399,19 @@
   )
 )
 
+if defenv['PLATFORM'] is 'win32':
+  runtime_paths = 'yes'
+else:
+  runtime_paths = 'no'
+
+cfg.Add(
+  BoolOption(
+    'NSIS_CONFIG_RUNTIME_PATHS',
+    'determines if plugins, includes, stubs etc are located at runtime based on the location of the compiler (only available on Win32).',
+    runtime_paths
+  )
+)
+
 ### Generate help
 
 Help(cfg.GenerateHelpText(defenv))
@@ -467,3 +480,4 @@
 AddBoolDefine('NSIS_LOCKWINDOW_SUPPORT')
 AddBoolDefine('NSIS_CONFIG_PLUGIN_SUPPORT')
 AddBoolDefine('NSIS_FIX_COMMENT_HANDLING')
+AddBoolDefine('NSIS_CONFIG_RUNTIME_PATHS')
Index: Source/build.cpp
===================================================================
RCS file: /cvsroot/nsis/NSIS/Source/build.cpp,v
retrieving revision 1.193
diff -u -r1.193 build.cpp
--- Source/build.cpp	16 Oct 2005 05:37:12 -0000	1.193
+++ Source/build.cpp	29 Oct 2005 18:09:58 -0000
@@ -463,18 +463,49 @@
 
 void CEXEBuild::initialize(const char *makensis_path)
 {
-  string nsis_dir = get_executable_dir(makensis_path);
-
+#ifdef NSIS_CONFIG_RUNTIME_PATHS
+  string nsis_dir = get_executable_dir(makensis_path)
+  nsis_dir += PLATFORM_PATH_SEPARATOR_STR;
+  nsis_dir += CONST_STR(NSIS_DATA_DIR);
+#else
+  string nsis_dir = CONST_STR(NSIS_DATA_DIR);
+#endif
   definedlist.add("NSISDIR",nsis_dir.c_str());
 
+#ifdef NSIS_CONFIG_RUNTIME_PATHS
   string includes_dir = nsis_dir;
   includes_dir += PLATFORM_PATH_SEPARATOR_STR;
-  includes_dir += "Include";
+  includes_dir += CONST_STR(NSIS_INCLUDE_DIR);
+#else
+  string includes_dir = CONST_STR(NSIS_INCLUDE_DIR);
+#endif
   include_dirs.add(includes_dir.c_str(),0);
 
+#ifdef NSIS_CONFIG_RUNTIME_PATHS
   stubs_dir = nsis_dir;
   stubs_dir += PLATFORM_PATH_SEPARATOR_STR;
-  stubs_dir += "Stubs";
+  stubs_dir += CONST_STR(NSIS_STUBS_DIR);
+#else
+  stubs_dir = CONST_STR(NSIS_STUBS_DIR);
+#endif
+
+#ifdef NSIS_CONFIG_RUNTIME_PATHS
+  string contrib_dir = nsis_dir;
+  contrib_dir += PLATFORM_PATH_SEPARATOR_STR;
+  contrib_dir += CONST_STR(NSIS_CONTRIB_DIR);
+#else
+  string contrib_dir = CONST_STR(NSIS_CONTRIB_DIR);
+#endif
+  definedlist.add("CONTRIBDIR",contrib_dir.c_str());
+
+#ifdef NSIS_CONFIG_RUNTIME_PATHS
+  string plugin_dir = nsis_dir;
+  plugin_dir += PLATFORM_PATH_SEPARATOR_STR;
+  plugin_dir += CONST_STR(NSIS_PLUGIN_DIR);
+#else
+  string plugin_dir = CONST_STR(NSIS_PLUGIN_DIR);
+#endif
+  definedlist.add("PLUGINDIR",plugin_dir.c_str());
 
   if (set_compressor("zlib", false) != PS_OK)
   {
@@ -3150,18 +3181,12 @@
 
   plugin_used = false;
   uninst_plugin_used = false;
-  char* nsisdir = definedlist.find("NSISDIR");
-  if (nsisdir)
+  char* searchPath = definedlist.find("PLUGINDIR");
+  if (searchPath)
   {
-    char* searchPath = new char [strlen(nsisdir)+9];
-    if (searchPath)
-    {
-      sprintf(searchPath,"%s" PLATFORM_PATH_SEPARATOR_STR "Plugins",nsisdir);
-      INFO_MSG("Processing plugin dlls: \"%s" PLATFORM_PATH_SEPARATOR_STR "*.dll\"\n",searchPath);
-      m_plugins.FindCommands(searchPath, display_info?true:false);
-      INFO_MSG("\n");
-      delete[] searchPath;
-    }
+    INFO_MSG("Processing plugin dlls: \"%s" PLATFORM_PATH_SEPARATOR_STR "*.dll\"\n",searchPath);
+    m_plugins.FindCommands(searchPath, display_info?true:false);
+    INFO_MSG("\n");
   }
 }
 
Index: Source/makenssi.cpp
===================================================================
RCS file: /cvsroot/nsis/NSIS/Source/makenssi.cpp,v
retrieving revision 1.70
diff -u -r1.70 makenssi.cpp
--- Source/makenssi.cpp	2 Jul 2005 16:49:31 -0000	1.70
+++ Source/makenssi.cpp	29 Oct 2005 18:10:01 -0000
@@ -391,7 +391,13 @@
       {
         g_noconfig=1;
 
+#ifdef NSIS_CONFIG_RUNTIME_PATHS
         string main_conf = get_executable_dir(argv[0]) + PLATFORM_PATH_SEPARATOR_STR + "nsisconf.nsh";
+#else
+        string main_conf = CONST_STR(NSIS_CONF_DIR);
+        main_conf += PLATFORM_PATH_SEPARATOR_STR;
+        main_conf += "nsisconf.nsh";
+#endif
         if (process_config(build, main_conf))
           return 1;
 
