updated link to docs and buffer overrun prob

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@898 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
rainwater 2002-09-04 00:49:51 +00:00
parent 12f3bc0af7
commit 7f0129654f
6 changed files with 30 additions and 35 deletions

View file

@ -140,6 +140,8 @@ Version History
1.9
- Text always scrolls to bottom (Kickik)
- Updated link to new docs
Copyright Information
---------------------

View file

@ -46,26 +46,26 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, char *cmdParam, int cmd
g_retcode = -1; // return code is always false unless set to true by GetExitCodeProcess
g_warnings = FALSE;
HWND hDialog = CreateDialog(g_hInstance,MAKEINTRESOURCE(DLG_MAIN),0,DialogProc);
if (!hDialog) {
char buf [MAX_STRING];
wsprintf(buf, "Error creating dialog box.\n\nError: %x", GetLastError ());
MessageBox(0, buf, "Error", MB_ICONEXCLAMATION | MB_OK);
return 1;
}
if (!hDialog) {
char buf [MAX_STRING];
wsprintf(buf, "Error creating dialog box.\n\nError: %x", GetLastError ());
MessageBox(0, buf, "Error", MB_ICONEXCLAMATION | MB_OK);
return 1;
}
haccel = LoadAccelerators(g_hInstance, MAKEINTRESOURCE(IDK_ACCEL));
MSG msg;
int status;
while ((status=GetMessage(&msg,0,0,0))!=0) {
if (status==-1) return -1;
MSG msg;
int status;
while ((status=GetMessage(&msg,0,0,0))!=0) {
if (status==-1) return -1;
if (!TranslateAccelerator(hDialog,haccel,&msg)) {
if (!IsDialogMessage(hDialog,&msg)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
}
}
ExitProcess(msg.wParam);
return msg.wParam;
return msg.wParam;
}
BOOL CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
@ -161,7 +161,7 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
GetModuleFileName(NULL,pathf,sizeof(pathf));
path=my_strrchr(pathf,'\\');
if(path!=NULL) *path=0;
lstrcat(pathf,"\\makensis.htm");
lstrcat(pathf,LOCALDOCS);
if ((int)ShellExecute(g_hwnd,"open",pathf,NULL,NULL,SW_SHOWNORMAL)<=32)
ShellExecute(g_hwnd,"open",DOCPATH,NULL,NULL,SW_SHOWNORMAL);
return TRUE;
@ -345,9 +345,8 @@ BOOL CALLBACK AboutProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
SendDlgItemMessage(hwndDlg, IDC_ABOUTCOPY, WM_SETFONT, (WPARAM)rfont, FALSE);
SendDlgItemMessage(hwndDlg, IDC_ABOUTPORTIONS, WM_SETFONT, (WPARAM)rfont, FALSE);
}
char buf[MAX_STRING];
wsprintf(buf,"MakeNSISW %s",NSISW_VERSION);
SetDlgItemText(hwndDlg,IDC_ABOUTVERSION,buf);
//char buf[MAX_STRING];
SetDlgItemText(hwndDlg,IDC_ABOUTVERSION,NSISW_VERSION);
SetDlgItemText(hwndDlg,IDC_ABOUTCOPY,COPYRIGHT);
SetDlgItemText(hwndDlg,IDC_ABOUTPORTIONS,CONTRIBUTOR);
}

View file

@ -32,8 +32,9 @@
#define NSIS_URL "http://sourceforge.net/projects/nsis2k/"
#define USAGE "Usage:\r\n makensisw full_path_of_makensis.exe [options] [script.nsi | - [...]]\r\n"
#define COPYRIGHT "Copyright (c) 2002 Robert Rainwater"
#define CONTRIBUTOR "Portions Copyright (c) 2002 Justin Frankel and Fritz Elfert"
#define DOCPATH "http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/nsis2k/NSIS/makensis.htm?rev=HEAD"
#define CONTRIBUTOR "Portions Copyright (c) 2002 Justin Frankel, Fritz Elfert, and Amir Szekely"
#define DOCPATH "http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/nsis2k/NSIS/docs/index.html?rev=HEAD"
#define LOCALDOCS "\\docs\\index.html"
#define REGSEC HKEY_LOCAL_MACHINE
#define REGKEY "Software\\NSIS"
#define REGLOC "MakeNSISWPlacement"
@ -45,12 +46,12 @@
#define WM_MAKENSIS_PROCESSCOMPLETE (WM_USER+1001)
// Extern Variables
extern const char *NSISW_VERSION;
extern char *g_script;
extern HWND g_hwnd;
extern HANDLE g_hThread;
extern char g_output_exe[1024];
extern char g_input_script[1024];
extern const char *NSISW_VERSION;
extern char *g_script;
extern HWND g_hwnd;
extern HANDLE g_hThread;
extern char g_output_exe[1024];
extern char g_input_script[1024];
// makensisw
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, char *cmdParam, int cmdShow);

View file

@ -32,14 +32,7 @@ void SetTitle(HWND hwnd,char *substr) {
}
void SetBranding(HWND hwnd) {
// buffer overrun occured here, consider changing to a _snprintf style
// function (Rainwater this is your call, I don't want to introduce use of
// a new string function into your code)... if the buffer is overwritten
// it trashes the function post code. For now I've just increased the size
// of the title buffer -- Sunjammer 04 September 2002.
char title[128];
wsprintf(title,"MakeNSISW %s",NSISW_VERSION);
SetDlgItemText(hwnd, IDC_VERSION, title);
SetDlgItemText(hwnd, IDC_VERSION, NSISW_VERSION);
}
void CopyToClipboard(HWND hwnd) {

View file

@ -29,7 +29,7 @@
#define REGKEY "Software\\NSIS"
#define REGLOC "MakeNSISWPlacement"
extern const char *NSISW_VERSION;
extern const char NSISW_VERSION[];
// Methods
void SetTitle(HWND hwnd,char *substr);

View file

@ -24,7 +24,7 @@
#define STR(x) REALSTR(x)
#ifdef RELEASE
const char *NSISW_VERSION = STR(RELEASE);
const char *NSISW_VERSION = "MakeNSISW " STR(RELEASE);
#else
const char *NSISW_VERSION = "Local Build: " __DATE__;
const char *NSISW_VERSION = "MakeNSISW Local Build: " __DATE__;
#endif