From 8c51026a67c22c999b4468e99a9f3206e3ad689f Mon Sep 17 00:00:00 2001 From: kichik Date: Wed, 5 Jan 2005 13:40:42 +0000 Subject: [PATCH] fixed 1095761 - File /r changes $0 git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3839 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/build.cpp | 1 + Source/script.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/build.cpp b/Source/build.cpp index ebb1f018..a72e7f32 100644 --- a/Source/build.cpp +++ b/Source/build.cpp @@ -440,6 +440,7 @@ definedlist.add("NSIS_SUPPORT_LANG_IN_STRINGS"); m_UserVarNames.add("PLUGINSDIR",-1); // 26 m_UserVarNames.add("HWNDPARENT",-1); // 27 m_UserVarNames.add("_CLICK",-1); // 28 + m_UserVarNames.add("_OUTDIR",1); // 29 m_iBaseVarsNum = m_UserVarNames.getnum(); diff --git a/Source/script.cpp b/Source/script.cpp index f33b4ed1..609e2d1f 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -5629,8 +5629,8 @@ int CEXEBuild::do_add_file(const char *lgss, int attrib, int recurse, int *total dir_created = true; if (recurse) { - // save $OUTDIR into $0 - if (add_entry_direct(EW_ASSIGNVAR, m_UserVarNames.get("0"), add_string("$OUTDIR")) != PS_OK) { + // save $OUTDIR into $_OUTDIR [StrCpy $_OUTDIR $OUTDIR] + if (add_entry_direct(EW_ASSIGNVAR, m_UserVarNames.get("_OUTDIR"), add_string("$OUTDIR")) != PS_OK) { delete dr; return PS_ERROR; } @@ -5705,8 +5705,8 @@ int CEXEBuild::do_add_file(const char *lgss, int attrib, int recurse, int *total if (basedir == "") { SCRIPT_MSG("%sFile: Returning to: \"%s\"\n", generatecode ? "" : "Reserve", dir.c_str()); - // restore $OUTDIR from $0 - if (do_add_file_create_dir(dir, basedir) != PS_OK) { + // restore $OUTDIR from $_OUTDIR [SetOutPath $_OUTDIR] + if (add_entry_direct(EW_CREATEDIR, add_string("$_OUTDIR"), 1) != PS_OK) { delete dr; return PS_ERROR; } @@ -5929,7 +5929,7 @@ int CEXEBuild::add_file(const string& dir, const string& file, int attrib, const } int CEXEBuild::do_add_file_create_dir(const string& local_dir, const string& dir, int attrib) { - string outdir_s = "$0\\" + dir; + string outdir_s = "$_OUTDIR\\" + dir; string::size_type pos = 1; pos = outdir_s.find('$', pos);