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
This commit is contained in:
kichik 2004-08-20 14:14:51 +00:00
parent cd663b221e
commit e1deb281f7

View file

@ -40,6 +40,7 @@
#include "ui.h" #include "ui.h"
#include "lang.h" #include "lang.h"
#include "state.h" #include "state.h"
#include "exec.h"
#if !defined(NSIS_CONFIG_VISIBLE_SUPPORT) && !defined(NSIS_CONFIG_SILENT_SUPPORT) #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. #error One of NSIS_CONFIG_SILENT_SUPPORT or NSIS_CONFIG_VISIBLE_SUPPORT must be defined.
@ -63,8 +64,8 @@ char *ValidateTempDir()
return NULL; return NULL;
addtrailingslash(state_temp_dir); addtrailingslash(state_temp_dir);
CreateDirectory(state_temp_dir, NULL); CreateDirectory(state_temp_dir, NULL);
// g_caption is used as a temp var here // state_command_line is used as a temp var here
return my_GetTempFileName(g_caption, state_temp_dir); return my_GetTempFileName(state_command_line, state_temp_dir);
} }
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam, int nCmdShow) 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 #endif
mystrcpy(g_caption,_LANG_GENERIC_ERROR);
GetTempPath(NSIS_MAX_STRLEN, state_temp_dir); GetTempPath(NSIS_MAX_STRLEN, state_temp_dir);
if (!ValidateTempDir()) if (!ValidateTempDir())
{ {
@ -97,9 +100,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam,
goto end; goto end;
} }
} }
DeleteFile(g_caption); DeleteFile(state_command_line);
mystrcpy(g_caption,_LANG_GENERIC_ERROR);
lstrcpyn(state_command_line, GetCommandLine(), NSIS_MAX_STRLEN); lstrcpyn(state_command_line, GetCommandLine(), NSIS_MAX_STRLEN);