Dynamic allocation of needed user variables (exehead grew 512 bytes).

Independed user vars in uninstaller and installer


git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2656 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
ramon18 2003-06-17 23:59:13 +00:00
parent 2ff0e96a38
commit ab91077049
10 changed files with 197 additions and 92 deletions

View file

@ -52,7 +52,17 @@ 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;
@ -60,7 +70,13 @@ 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);