From d01e124228de6133a16b7824ec44f3f723a937ee Mon Sep 17 00:00:00 2001 From: kichik Date: Thu, 25 Jan 2007 22:08:18 +0000 Subject: [PATCH] process command line before setting temporary directory to give the user a chance to use /S git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4903 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/Main.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Source/exehead/Main.c b/Source/exehead/Main.c index 0c052a3a..237eff6a 100644 --- a/Source/exehead/Main.c +++ b/Source/exehead/Main.c @@ -95,18 +95,6 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam, mystrcpy(g_caption,_LANG_GENERIC_ERROR); - GetTempPath(NSIS_MAX_STRLEN, state_temp_dir); - if (!ValidateTempDir()) - { - GetWindowsDirectory(state_temp_dir, NSIS_MAX_STRLEN - 5); // leave space for \Temp - mystrcat(state_temp_dir, "\\Temp"); - if (!ValidateTempDir()) - { - goto end; - } - } - DeleteFile(state_command_line); - mystrcpy(state_command_line, GetCommandLine()); #ifdef NSIS_CONFIG_VISIBLE_SUPPORT @@ -165,6 +153,18 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam, cmdline++; } + GetTempPath(NSIS_MAX_STRLEN, state_temp_dir); + if (!ValidateTempDir()) + { + GetWindowsDirectory(state_temp_dir, NSIS_MAX_STRLEN - 5); // leave space for \Temp + mystrcat(state_temp_dir, "\\Temp"); + if (!ValidateTempDir()) + { + goto end; + } + } + DeleteFile(state_command_line); + m_Err = loadHeaders(cl_flags); if (m_Err) goto end;