From e1deb281f739fbe9cdff1d73e0b11fae7095fba1 Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 20 Aug 2004 14:14:51 +0000 Subject: [PATCH] set NSIS Error title for invalid temporary directory error message git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3633 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/Main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/exehead/Main.c b/Source/exehead/Main.c index 12a67fd0..2012ad09 100644 --- a/Source/exehead/Main.c +++ b/Source/exehead/Main.c @@ -40,6 +40,7 @@ #include "ui.h" #include "lang.h" #include "state.h" +#include "exec.h" #if !defined(NSIS_CONFIG_VISIBLE_SUPPORT) && !defined(NSIS_CONFIG_SILENT_SUPPORT) #error One of NSIS_CONFIG_SILENT_SUPPORT or NSIS_CONFIG_VISIBLE_SUPPORT must be defined. @@ -63,8 +64,8 @@ char *ValidateTempDir() return NULL; addtrailingslash(state_temp_dir); CreateDirectory(state_temp_dir, NULL); - // g_caption is used as a temp var here - return my_GetTempFileName(g_caption, state_temp_dir); + // state_command_line is used as a temp var here + return my_GetTempFileName(state_command_line, state_temp_dir); } int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam, int nCmdShow) @@ -87,6 +88,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam, } #endif + mystrcpy(g_caption,_LANG_GENERIC_ERROR); + GetTempPath(NSIS_MAX_STRLEN, state_temp_dir); if (!ValidateTempDir()) { @@ -97,9 +100,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam, goto end; } } - DeleteFile(g_caption); - - mystrcpy(g_caption,_LANG_GENERIC_ERROR); + DeleteFile(state_command_line); lstrcpyn(state_command_line, GetCommandLine(), NSIS_MAX_STRLEN);