updated with a lot of .data size optimizations.. used eccles' optimization for certain registry settings too (thanks dave).. code size may have gone slightly up,but it let me take a lot of data size off (had to change some of the default error msgs too)

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1039 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
justin1014 2002-09-18 23:19:13 +00:00
parent 5e096c1b2b
commit 88acdf2345
4 changed files with 27 additions and 16 deletions

View file

@ -408,13 +408,22 @@ int NSISCALL ui_doinstall(void)
#ifdef NSIS_CONFIG_LICENSEPAGE
{ // load richedit DLL
WNDCLASS wc={0,};
if (!LoadLibrary("RichEd20.dll")) LoadLibrary("RichEd32.dll");
static char str1[]="RichEd20.dll";
static char str2[]="RichEdit20A";
if (!LoadLibrary(str1))
{
str1[6]='3';
str1[7]='2';
LoadLibrary(str1);
}
// make richedit20a point to RICHEDIT
if (!GetClassInfo(NULL,"RichEdit20A",&wc))
if (!GetClassInfo(NULL,str2,&wc))
{
GetClassInfo(NULL,"RICHEDIT",&wc);
wc.lpszClassName = "RichEdit20A";
str2[8]=0;
GetClassInfo(NULL,str2,&wc);
wc.lpszClassName = str2;
str2[8]='2';
RegisterClass(&wc);
}
}

View file

@ -83,7 +83,7 @@ int NSISCALL loadHeaders(void)
if (GetCompressedDataFromDataBlockToMemory(-1,data,h.length_of_header) != h.length_of_header)
{
my_MessageBox("Error reading installer info block",MB_OK);
my_MessageBox(_LANG_CANTOPENSELF,MB_OK);
GlobalFree((HGLOBAL)data);
return -1;
}

View file

@ -2,23 +2,21 @@
#define _NSIS_LANG_H_
// generic startup strings (these will never be overridable)
#define _LANG_INVALIDCRC "Installer verification failed.\r\n\r\n" \
"This could be the result of an incomplete download,\r\n" \
"a failing disk, or (possibly) corruption from a virus." \
"\r\n\r\nYou can try to force an install using the /NCRC\r\n" \
"command line switch (but it is NOT recommended)"
#define _LANG_INVALIDCRC "Installer corrupted or incomplete.\r\n\r\n" \
"This could be the result of a failed download or corruption from a virus." \
"\r\n\r\nIf desperate, try the /NCRC command line switch (NOT recommended)"
#define _LANG_INVALIDINST "Installer corrupted.\r\n\r\n" \
"This could be the result of an incomplete download"
#define _LANG_UNINSTINITERROR "Error initializing uninstaller"
#define _LANG_UNINSTINITERROR "Error launching installer"
#define _LANG_VERIFYINGINST "verifying installer: %d%%"
#define _LANG_UNPACKING "unpacking data: %d%%"
#define _LANG_CANTOPENSELF "Can't open self"
#define _LANG_CANTOPENSELF "Error launching installer" // same as uninstiniterror for size
#define _LANG_GENERIC_ERROR "NSIS ERROR"

View file

@ -28,7 +28,8 @@ HANDLE g_hInstance;
HANDLE NSISCALL myCreateProcess(char *cmd, char *dir)
{
PROCESS_INFORMATION ProcInfo={0,};
STARTUPINFO StartUp={sizeof(StartUp),};
STARTUPINFO StartUp={0,};
StartUp.cb=sizeof(StartUp);
if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, dir, &StartUp, &ProcInfo))
return NULL;
if (NULL != ProcInfo.hThread) CloseHandle( ProcInfo.hThread );
@ -340,11 +341,14 @@ static void NSISCALL queryShellFolders(const char *name_, char *out)
mystrcpy(name + 7, name_);
{
char f=g_all_user_var_flag;
static char buf[65];
wsprintf(buf,"%s\\Explorer\\Shell Folders","Software\\Microsoft\\Windows\\CurrentVersion");
again:
myRegGetStr(f?HKEY_LOCAL_MACHINE:HKEY_CURRENT_USER,
"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",
name+(f?0:7),out);
buf,
f?name:name_,out);
if (!out[0])
{
if (f)
@ -497,7 +501,7 @@ void NSISCALL process_string(char *out, const char *in)
break;
case VAR_CODES_START + 26: // PROGRAMFILES
myRegGetStr(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion", "ProgramFilesDir", out);
myRegGetStr(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion", "ProgramFilesDir", out);
if (!*out)
mystrcpy(out, "C:\\Program Files");
break;