Added /plugin parameter to ReserveFile for our multi-arc. plugin subdirectories.

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6290 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2013-03-07 23:38:25 +00:00
parent dcddf977b2
commit 9b287fc648
11 changed files with 42 additions and 17 deletions

View file

@ -828,7 +828,7 @@ FunctionEnd
the INI files before all sections and functions:</p>
<pre>
ReserveFile &quot;test.ini&quot;
ReserveFile &quot;${NSISDIR}\Plugins\InstallOptions.dll&quot;
ReserveFile /plugin InstallOptions.dll
</pre>
</div>
<h2>

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -185,7 +185,7 @@ Localization
!verbose push
!verbose ${MUI_VERBOSE}
ReserveFile "${NSISDIR}\Plugins\LangDLL.dll"
ReserveFile /plugin LangDLL.dll
!verbose pop

View file

@ -884,7 +884,7 @@ Var PLUGINS_FOLDER
start faster. Include reserve file commands for such files before your sections
and functions:</p>
<pre>
ReserveFile MyPlugin.dll
ReserveFile /plugin MyPlugin.dll
!insertmacro MUI_RESERVEFILE_LANGDLL ;Language selection dialog
...
</pre>

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -4817,10 +4817,15 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
#ifdef NSIS_SUPPORT_FILE
{
set<tstring> 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);

View file

@ -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},