diff --git a/Contrib/InstallOptions/Readme.html b/Contrib/InstallOptions/Readme.html
index 5d7e696c..501c825b 100644
--- a/Contrib/InstallOptions/Readme.html
+++ b/Contrib/InstallOptions/Readme.html
@@ -828,7 +828,7 @@ FunctionEnd
the INI files before all sections and functions:
ReserveFile "test.ini"
-ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
+ReserveFile /plugin InstallOptions.dll
diff --git a/Contrib/InstallOptions/test.nsi b/Contrib/InstallOptions/test.nsi
index 53afe9b9..30b15c4b 100644
--- a/Contrib/InstallOptions/test.nsi
+++ b/Contrib/InstallOptions/test.nsi
@@ -17,7 +17,7 @@ ShowInstDetails show
;Only useful for BZIP2 compression
;Use ReserveFile for your own InstallOptions INI files too!
-ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
+ReserveFile /plugin InstallOptions.dll
ReserveFile "test.ini"
;Order of pages
diff --git a/Contrib/InstallOptions/testimgs.nsi b/Contrib/InstallOptions/testimgs.nsi
index 1a832e91..3d0f4ec7 100644
--- a/Contrib/InstallOptions/testimgs.nsi
+++ b/Contrib/InstallOptions/testimgs.nsi
@@ -15,7 +15,7 @@ ShowInstDetails show
;Only useful for BZIP2 compression
;Use ReserveFile for your own InstallOptions INI files too!
-ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
+ReserveFile /plugin InstallOptions.dll
ReserveFile "testimgs.ini"
ReserveFile "${NSISDIR}\Contrib\Graphics\Checks\colorful.bmp"
ReserveFile "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp"
diff --git a/Contrib/InstallOptions/testlink.nsi b/Contrib/InstallOptions/testlink.nsi
index 8b73fc95..90965906 100644
--- a/Contrib/InstallOptions/testlink.nsi
+++ b/Contrib/InstallOptions/testlink.nsi
@@ -19,7 +19,7 @@ ShowInstDetails show
;Only useful for BZIP2 compression
;Use ReserveFile for your own InstallOptions INI files too!
-ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
+ReserveFile /plugin InstallOptions.dll
ReserveFile "testlink.ini"
;Order of pages
diff --git a/Contrib/Modern UI 2/Localization.nsh b/Contrib/Modern UI 2/Localization.nsh
index e40ff547..41934582 100644
--- a/Contrib/Modern UI 2/Localization.nsh
+++ b/Contrib/Modern UI 2/Localization.nsh
@@ -185,7 +185,7 @@ Localization
!verbose push
!verbose ${MUI_VERBOSE}
- ReserveFile "${NSISDIR}\Plugins\LangDLL.dll"
+ ReserveFile /plugin LangDLL.dll
!verbose pop
diff --git a/Contrib/Modern UI 2/Readme.html b/Contrib/Modern UI 2/Readme.html
index e4e75276..d879d4dd 100644
--- a/Contrib/Modern UI 2/Readme.html
+++ b/Contrib/Modern UI 2/Readme.html
@@ -884,7 +884,7 @@ Var PLUGINS_FOLDER
start faster. Include reserve file commands for such files before your sections
and functions:
-ReserveFile MyPlugin.dll
+ReserveFile /plugin MyPlugin.dll
!insertmacro MUI_RESERVEFILE_LANGDLL ;Language selection dialog
...
diff --git a/Contrib/Modern UI/System.nsh b/Contrib/Modern UI/System.nsh
index 003cdae9..3317896e 100644
--- a/Contrib/Modern UI/System.nsh
+++ b/Contrib/Modern UI/System.nsh
@@ -2043,7 +2043,7 @@ Var MUI_TEMP2
!verbose push
!verbose ${MUI_VERBOSE}
- ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
+ ReserveFile /plugin InstallOptions.dll
!verbose pop
@@ -2054,7 +2054,7 @@ Var MUI_TEMP2
!verbose push
!verbose ${MUI_VERBOSE}
- ReserveFile "${NSISDIR}\Plugins\LangDLL.dll"
+ ReserveFile /plugin LangDLL.dll
!verbose pop
diff --git a/Docs/src/basic.but b/Docs/src/basic.but
index f9af9ab9..c6c3dbc7 100644
--- a/Docs/src/basic.but
+++ b/Docs/src/basic.but
@@ -110,10 +110,12 @@ If no absolute path is specified the current folder will be used. The current fo
\S2{reservefile} ReserveFile
-\c [/nonfatal] [/r] [/x file|wildcard [...]] file [file...]
+\c [/nonfatal] [/r] [/x file|wildcard [...]] file [file...] | [/nonfatal] /plugin file.dll
Reserves a file in the data block for later use. Files are added to the compressed data block in the order they appear in the script. Functions, however, are not necessarily called in the order they appear in the script. Therefore, if you add a file in a function called early but put the function at the end of the script, all of the files added earlier will have to be decompressed to get to the required file. This process can take a long time if there a lot of files. \R{oninit}{.onInit} is one such function. It is called at the very beginning, before anything else appears. If you put it at the very end of the script, extract some files in it and have lots of files added before it, the installer might take a very long time to load. This is where this command comes useful, allowing you to speed up the loading process by including the file at the top of the data block instead of letting NSIS seek all the way down to the bottom of the \e{compressed} data block.
+Use /plugin to reserve a plugin in $\{NSISDIR\}\\Plugins\\*.
+
See \R{file}{File} for more information about the parameters.
\S2{rmdir} RMDir
diff --git a/Docs/src/history.but b/Docs/src/history.but
index cea2d9eb..6685cbf3 100644
--- a/Docs/src/history.but
+++ b/Docs/src/history.but
@@ -1,5 +1,15 @@
\A{history} Changelog and Release Notes
+\H{v3.0a0} 3.0 Alpha 0
+
+Released on ?, 2013
+
+\S1{v3.0a0-cl} Changelog
+
+\S2{} Minor Changes
+
+\b Plugins in $\{NSISDIR\}\\Plugins have to be reserved with \c{ReserveFile /plugin}
+
\H{v2.46} 2.46
Released on December 6th, 2009
diff --git a/Source/script.cpp b/Source/script.cpp
index a80d8d1f..f6c973c0 100644
--- a/Source/script.cpp
+++ b/Source/script.cpp
@@ -4817,10 +4817,15 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
#ifdef NSIS_SUPPORT_FILE
{
set excluded;
- int a=1,attrib=0,rec=0,fatal=1;
- if (!_tcsicmp(line.gettoken_str(a),_T("/nonfatal"))) {
- fatal=0;
- a++;
+ int a=1,attrib=0;
+ bool fatal=true,rec=false,reserveplugin=false;
+ if (!_tcsicmp(line.gettoken_str(a),_T("/nonfatal")))
+ {
+ fatal=false, a++;
+ }
+ if (which_token == TOK_RESERVEFILE && !_tcsicmp(line.gettoken_str(a),_T("/plugin")))
+ {
+ reserveplugin=true, a++;
}
if (which_token == TOK_FILE && !_tcsicmp(line.gettoken_str(a),_T("/a")))
{
@@ -4831,10 +4836,9 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
#endif
a++;
}
- if (!_tcsicmp(line.gettoken_str(a),_T("/r")))
+ if (!reserveplugin && !_tcsicmp(line.gettoken_str(a),_T("/r")))
{
- rec=1;
- a++;
+ rec=true, a++;
}
else if (which_token == TOK_FILE && !_tcsnicmp(line.gettoken_str(a),_T("/oname="),7))
{
@@ -4902,6 +4906,15 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
buf[0]=t[0];
t=buf;
}
+ tstring pluginfullpath;
+ if (reserveplugin && get_file_name(t)==t)
+ {
+ pluginfullpath = definedlist.find(_T("NSISDIR"));
+ pluginfullpath += tstring(PLATFORM_PATH_SEPARATOR_STR) + _T("Plugins");
+ pluginfullpath += tstring(PLATFORM_PATH_SEPARATOR_STR) + get_target_suffix();
+ pluginfullpath += tstring(PLATFORM_PATH_SEPARATOR_STR) + t;
+ t = (TCHAR*) pluginfullpath.c_str();
+ }
int tf=0;
TCHAR *fn = my_convert(t);
int v=do_add_file(fn, attrib, rec, &tf, NULL, which_token == TOK_FILE, NULL, excluded);
diff --git a/Source/tokens.cpp b/Source/tokens.cpp
index 68ab167a..fdc25515 100644
--- a/Source/tokens.cpp
+++ b/Source/tokens.cpp
@@ -89,7 +89,7 @@ static tokenType tokenlist[TOK__LAST] =
{TOK_FILE,_T("File"),1,-1,_T("[/nonfatal] [/a] ([/r] [/x filespec [...]] filespec [...] |\n /oname=outfile one_file_only)"),TP_CODE},
{TOK_FILEBUFSIZE,_T("FileBufSize"),1,0,_T("buf_size_mb"),TP_ALL},
{TOK_FLUSHINI,_T("FlushINI"),1,0,_T("ini_file"),TP_CODE},
-{TOK_RESERVEFILE,_T("ReserveFile"),1,-1,_T("[/nonfatal] [/r] [/x filespec [...]] file [file...]"),TP_ALL},
+{TOK_RESERVEFILE,_T("ReserveFile"),1,-1,_T("[/nonfatal] [/r] [/x filespec [...]] file [file...] | [/nonfatal] /plugin file.dll"),TP_ALL},
{TOK_FILECLOSE,_T("FileClose"),1,0,_T("$(user_var: handle input)"),TP_CODE},
{TOK_FILEERRORTEXT,_T("FileErrorText"),0,2,_T("[text (can contain $0)] [text without ignore (can contain $0)]"),TP_GLOBAL},
{TOK_FILEOPEN,_T("FileOpen"),3,0,_T("$(user_var: handle output) filename openmode\n openmode=r|w|a"),TP_CODE},