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

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