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:
parent
12f3bc0af7
commit
7f0129654f
6 changed files with 30 additions and 35 deletions
|
@ -140,6 +140,8 @@ Version History
|
||||||
|
|
||||||
1.9
|
1.9
|
||||||
- Text always scrolls to bottom (Kickik)
|
- Text always scrolls to bottom (Kickik)
|
||||||
|
- Updated link to new docs
|
||||||
|
|
||||||
|
|
||||||
Copyright Information
|
Copyright Information
|
||||||
---------------------
|
---------------------
|
||||||
|
|
|
@ -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_retcode = -1; // return code is always false unless set to true by GetExitCodeProcess
|
||||||
g_warnings = FALSE;
|
g_warnings = FALSE;
|
||||||
HWND hDialog = CreateDialog(g_hInstance,MAKEINTRESOURCE(DLG_MAIN),0,DialogProc);
|
HWND hDialog = CreateDialog(g_hInstance,MAKEINTRESOURCE(DLG_MAIN),0,DialogProc);
|
||||||
if (!hDialog) {
|
if (!hDialog) {
|
||||||
char buf [MAX_STRING];
|
char buf [MAX_STRING];
|
||||||
wsprintf(buf, "Error creating dialog box.\n\nError: %x", GetLastError ());
|
wsprintf(buf, "Error creating dialog box.\n\nError: %x", GetLastError ());
|
||||||
MessageBox(0, buf, "Error", MB_ICONEXCLAMATION | MB_OK);
|
MessageBox(0, buf, "Error", MB_ICONEXCLAMATION | MB_OK);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
haccel = LoadAccelerators(g_hInstance, MAKEINTRESOURCE(IDK_ACCEL));
|
haccel = LoadAccelerators(g_hInstance, MAKEINTRESOURCE(IDK_ACCEL));
|
||||||
MSG msg;
|
MSG msg;
|
||||||
int status;
|
int status;
|
||||||
while ((status=GetMessage(&msg,0,0,0))!=0) {
|
while ((status=GetMessage(&msg,0,0,0))!=0) {
|
||||||
if (status==-1) return -1;
|
if (status==-1) return -1;
|
||||||
if (!TranslateAccelerator(hDialog,haccel,&msg)) {
|
if (!TranslateAccelerator(hDialog,haccel,&msg)) {
|
||||||
if (!IsDialogMessage(hDialog,&msg)) {
|
if (!IsDialogMessage(hDialog,&msg)) {
|
||||||
TranslateMessage(&msg);
|
TranslateMessage(&msg);
|
||||||
DispatchMessage(&msg);
|
DispatchMessage(&msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ExitProcess(msg.wParam);
|
ExitProcess(msg.wParam);
|
||||||
return msg.wParam;
|
return msg.wParam;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
|
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));
|
GetModuleFileName(NULL,pathf,sizeof(pathf));
|
||||||
path=my_strrchr(pathf,'\\');
|
path=my_strrchr(pathf,'\\');
|
||||||
if(path!=NULL) *path=0;
|
if(path!=NULL) *path=0;
|
||||||
lstrcat(pathf,"\\makensis.htm");
|
lstrcat(pathf,LOCALDOCS);
|
||||||
if ((int)ShellExecute(g_hwnd,"open",pathf,NULL,NULL,SW_SHOWNORMAL)<=32)
|
if ((int)ShellExecute(g_hwnd,"open",pathf,NULL,NULL,SW_SHOWNORMAL)<=32)
|
||||||
ShellExecute(g_hwnd,"open",DOCPATH,NULL,NULL,SW_SHOWNORMAL);
|
ShellExecute(g_hwnd,"open",DOCPATH,NULL,NULL,SW_SHOWNORMAL);
|
||||||
return TRUE;
|
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_ABOUTCOPY, WM_SETFONT, (WPARAM)rfont, FALSE);
|
||||||
SendDlgItemMessage(hwndDlg, IDC_ABOUTPORTIONS, WM_SETFONT, (WPARAM)rfont, FALSE);
|
SendDlgItemMessage(hwndDlg, IDC_ABOUTPORTIONS, WM_SETFONT, (WPARAM)rfont, FALSE);
|
||||||
}
|
}
|
||||||
char buf[MAX_STRING];
|
//char buf[MAX_STRING];
|
||||||
wsprintf(buf,"MakeNSISW %s",NSISW_VERSION);
|
SetDlgItemText(hwndDlg,IDC_ABOUTVERSION,NSISW_VERSION);
|
||||||
SetDlgItemText(hwndDlg,IDC_ABOUTVERSION,buf);
|
|
||||||
SetDlgItemText(hwndDlg,IDC_ABOUTCOPY,COPYRIGHT);
|
SetDlgItemText(hwndDlg,IDC_ABOUTCOPY,COPYRIGHT);
|
||||||
SetDlgItemText(hwndDlg,IDC_ABOUTPORTIONS,CONTRIBUTOR);
|
SetDlgItemText(hwndDlg,IDC_ABOUTPORTIONS,CONTRIBUTOR);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,8 +32,9 @@
|
||||||
#define NSIS_URL "http://sourceforge.net/projects/nsis2k/"
|
#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 USAGE "Usage:\r\n makensisw full_path_of_makensis.exe [options] [script.nsi | - [...]]\r\n"
|
||||||
#define COPYRIGHT "Copyright (c) 2002 Robert Rainwater"
|
#define COPYRIGHT "Copyright (c) 2002 Robert Rainwater"
|
||||||
#define CONTRIBUTOR "Portions Copyright (c) 2002 Justin Frankel and Fritz Elfert"
|
#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/makensis.htm?rev=HEAD"
|
#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 REGSEC HKEY_LOCAL_MACHINE
|
||||||
#define REGKEY "Software\\NSIS"
|
#define REGKEY "Software\\NSIS"
|
||||||
#define REGLOC "MakeNSISWPlacement"
|
#define REGLOC "MakeNSISWPlacement"
|
||||||
|
@ -45,12 +46,12 @@
|
||||||
#define WM_MAKENSIS_PROCESSCOMPLETE (WM_USER+1001)
|
#define WM_MAKENSIS_PROCESSCOMPLETE (WM_USER+1001)
|
||||||
|
|
||||||
// Extern Variables
|
// Extern Variables
|
||||||
extern const char *NSISW_VERSION;
|
extern const char *NSISW_VERSION;
|
||||||
extern char *g_script;
|
extern char *g_script;
|
||||||
extern HWND g_hwnd;
|
extern HWND g_hwnd;
|
||||||
extern HANDLE g_hThread;
|
extern HANDLE g_hThread;
|
||||||
extern char g_output_exe[1024];
|
extern char g_output_exe[1024];
|
||||||
extern char g_input_script[1024];
|
extern char g_input_script[1024];
|
||||||
|
|
||||||
// makensisw
|
// makensisw
|
||||||
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, char *cmdParam, int cmdShow);
|
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, char *cmdParam, int cmdShow);
|
||||||
|
|
|
@ -32,14 +32,7 @@ void SetTitle(HWND hwnd,char *substr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetBranding(HWND hwnd) {
|
void SetBranding(HWND hwnd) {
|
||||||
// buffer overrun occured here, consider changing to a _snprintf style
|
SetDlgItemText(hwnd, IDC_VERSION, NSISW_VERSION);
|
||||||
// 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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CopyToClipboard(HWND hwnd) {
|
void CopyToClipboard(HWND hwnd) {
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#define REGKEY "Software\\NSIS"
|
#define REGKEY "Software\\NSIS"
|
||||||
#define REGLOC "MakeNSISWPlacement"
|
#define REGLOC "MakeNSISWPlacement"
|
||||||
|
|
||||||
extern const char *NSISW_VERSION;
|
extern const char NSISW_VERSION[];
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
void SetTitle(HWND hwnd,char *substr);
|
void SetTitle(HWND hwnd,char *substr);
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#define STR(x) REALSTR(x)
|
#define STR(x) REALSTR(x)
|
||||||
|
|
||||||
#ifdef RELEASE
|
#ifdef RELEASE
|
||||||
const char *NSISW_VERSION = STR(RELEASE);
|
const char *NSISW_VERSION = "MakeNSISW " STR(RELEASE);
|
||||||
#else
|
#else
|
||||||
const char *NSISW_VERSION = "Local Build: " __DATE__;
|
const char *NSISW_VERSION = "MakeNSISW Local Build: " __DATE__;
|
||||||
#endif
|
#endif
|
Loading…
Add table
Add a link
Reference in a new issue