Special section of data for user vars, whitch allow compiler to assign the right size and no code needed in exehead for mem allocs. Warnings for unreferenced user vars. (758773) Error, if temp file not available, now directory is created if not exist.

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2673 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
ramon18 2003-06-23 22:40:11 +00:00
parent 2077919dc5
commit 054db45f63
12 changed files with 227 additions and 105 deletions

View file

@ -52,17 +52,7 @@ int NSISCALL isheader(firstheader *h)
#ifdef NSIS_CONFIG_COMPRESSION_SUPPORT
static z_stream g_inflate_stream;
#endif
/*
void DEBUG(const char* Frm, ...)
{
char Buf[1024];
va_list va;
va_start(va, Frm);
wvsprintf(Buf, Frm, va);
MessageBox(0, Buf, 0, 0);
va_end(va);
}
*/
const char * NSISCALL loadHeaders(void)
{
void *data;
@ -70,13 +60,7 @@ const char * NSISCALL loadHeaders(void)
if (!ReadSelfFile((LPVOID)&h,sizeof(h)) || !isheader(&h)) return _LANG_INVALIDCRC;
#ifdef NSIS_SUPPORT_NAMED_USERVARS
//DEBUG("Needed size is : %i", h.length_of_header + h.length_of_uservars);
g_usrvars = (NSIS_STRING*)GlobalReAlloc(g_usrvars, h.length_of_header + h.length_of_uservars, GMEM_MOVEABLE);
data = (void*)(g_usrvars[0]+h.length_of_uservars);
#else
data=(void*)my_GlobalAlloc(h.length_of_header);
#endif
#ifdef NSIS_CONFIG_COMPRESSION_SUPPORT
inflateInit(&g_inflate_stream);
@ -86,7 +70,7 @@ const char * NSISCALL loadHeaders(void)
{
char fno[MAX_PATH];
GetTempFileName(temp_directory,"nst",0,fno);
GetTempFileName(state_temp_dir,"nst",0,fno);
dbd_hFile=CreateFile(fno,GENERIC_WRITE|GENERIC_READ,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_TEMPORARY|FILE_FLAG_DELETE_ON_CLOSE,NULL);
if (dbd_hFile == INVALID_HANDLE_VALUE)
{