Added Toolbar + more
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2588 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
27c60f3fe1
commit
5292145d52
9 changed files with 334 additions and 37 deletions
|
@ -164,13 +164,18 @@ Version History
|
||||||
- Check for Update command
|
- Check for Update command
|
||||||
- Added link to the NSIS Forum under Help menu
|
- Added link to the NSIS Forum under Help menu
|
||||||
- Bunch of other stuff not worth mentioning
|
- Bunch of other stuff not worth mentioning
|
||||||
- Define Symbols menu (Ctrl+D) (iceman_k)
|
- Define Symbols menu (Ctrl+D)
|
||||||
|
|
||||||
|
1.10
|
||||||
|
- Define Symbols is available even if a script is not loaded.
|
||||||
|
- Defined Symbols are saved on exit and reloaded on start.
|
||||||
|
- Added NSIS Update menu.
|
||||||
|
- Added toolbar for commonly used menus.
|
||||||
|
|
||||||
Copyright Information
|
Copyright Information
|
||||||
---------------------
|
---------------------
|
||||||
Copyright (c) 2002 Robert Rainwater
|
Copyright (c) 2002 Robert Rainwater
|
||||||
Contributors: Justin Frankel, Fritz Elfert, and Amir Szekely, iceman_k
|
Contributors: Justin Frankel, Fritz Elfert, Amir Szekely, and Sunil Kamath
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (c) 2002 Robert Rainwater
|
Copyright (c) 2002 Robert Rainwater
|
||||||
Contributors: Justin Frankel, Fritz Elfert, and Amir Szekely
|
Contributors: Justin Frankel, Fritz Elfert, Amir Szekely, and Sunil Kamath
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -23,10 +23,12 @@
|
||||||
#include "makensisw.h"
|
#include "makensisw.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "noclib.h"
|
#include "noclib.h"
|
||||||
|
#include "toolbar.h"
|
||||||
|
|
||||||
NSCRIPTDATA g_sdata;
|
NSCRIPTDATA g_sdata;
|
||||||
NRESIZEDATA g_resize;
|
NRESIZEDATA g_resize;
|
||||||
NFINDREPLACE g_find;
|
NFINDREPLACE g_find;
|
||||||
|
extern NTOOLBAR g_toolbar;
|
||||||
|
|
||||||
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, char *cmdParam, int cmdShow) {
|
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, char *cmdParam, int cmdShow) {
|
||||||
MSG msg;
|
MSG msg;
|
||||||
|
@ -38,6 +40,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, char *cmdParam, int cmd
|
||||||
g_sdata.hInstance=GetModuleHandle(0);
|
g_sdata.hInstance=GetModuleHandle(0);
|
||||||
g_sdata.script_alloced=false;
|
g_sdata.script_alloced=false;
|
||||||
g_sdata.defines = NULL;
|
g_sdata.defines = NULL;
|
||||||
|
RestoreDefines();
|
||||||
g_sdata.script=GetCommandLine();
|
g_sdata.script=GetCommandLine();
|
||||||
if (*g_sdata.script=='"') { g_sdata.script++; while (*g_sdata.script && *g_sdata.script++!='"' ); }
|
if (*g_sdata.script=='"') { g_sdata.script++; while (*g_sdata.script && *g_sdata.script++!='"' ); }
|
||||||
else while (*g_sdata.script!=' ' && *g_sdata.script) g_sdata.script++;
|
else while (*g_sdata.script!=' ' && *g_sdata.script) g_sdata.script++;
|
||||||
|
@ -52,8 +55,8 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, char *cmdParam, int cmd
|
||||||
MessageBox(0,DLGERROR,"Error",MB_ICONEXCLAMATION|MB_OK);
|
MessageBox(0,DLGERROR,"Error",MB_ICONEXCLAMATION|MB_OK);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
haccel = LoadAccelerators(g_sdata.hInstance, MAKEINTRESOURCE(IDK_ACCEL));
|
haccel = LoadAccelerators(g_sdata.hInstance, MAKEINTRESOURCE(IDK_ACCEL));
|
||||||
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 (!IsDialogMessage(g_find.hwndFind, &msg)) {
|
if (!IsDialogMessage(g_find.hwndFind, &msg)) {
|
||||||
if (!TranslateAccelerator(hDialog,haccel,&msg)) {
|
if (!TranslateAccelerator(hDialog,haccel,&msg)) {
|
||||||
|
@ -80,9 +83,13 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||||
SetClassLong(hwndDlg,GCL_HICON,(long)hIcon);
|
SetClassLong(hwndDlg,GCL_HICON,(long)hIcon);
|
||||||
SendMessage(GetDlgItem(hwndDlg,IDC_LOGWIN),EM_SETEVENTMASK,NULL,ENM_SELCHANGE);
|
SendMessage(GetDlgItem(hwndDlg,IDC_LOGWIN),EM_SETEVENTMASK,NULL,ENM_SELCHANGE);
|
||||||
DragAcceptFiles(g_sdata.hwnd,FALSE);
|
DragAcceptFiles(g_sdata.hwnd,FALSE);
|
||||||
InitTooltips(g_sdata.hwnd);
|
|
||||||
g_sdata.menu = GetMenu(g_sdata.hwnd);
|
g_sdata.menu = GetMenu(g_sdata.hwnd);
|
||||||
g_sdata.submenu = GetSubMenu(g_sdata.menu,1);
|
g_sdata.submenu = GetSubMenu(g_sdata.menu,1);
|
||||||
|
CreateToolBar();
|
||||||
|
InitTooltips(g_sdata.hwnd);
|
||||||
|
#ifdef COMPRESSOR_OPTION
|
||||||
|
SetCompressor(IDM_DEFAULT);
|
||||||
|
#endif
|
||||||
SetBranding(g_sdata.hwnd);
|
SetBranding(g_sdata.hwnd);
|
||||||
HFONT hFont = CreateFont(14,0,0,0,FW_NORMAL,0,0,0,DEFAULT_CHARSET,OUT_CHARACTER_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FIXED_PITCH|FF_DONTCARE,"Courier New");
|
HFONT hFont = CreateFont(14,0,0,0,FW_NORMAL,0,0,0,DEFAULT_CHARSET,OUT_CHARACTER_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FIXED_PITCH|FF_DONTCARE,"Courier New");
|
||||||
SendDlgItemMessage(hwndDlg,IDC_LOGWIN,WM_SETFONT,(WPARAM)hFont,0);
|
SendDlgItemMessage(hwndDlg,IDC_LOGWIN,WM_SETFONT,(WPARAM)hFont,0);
|
||||||
|
@ -104,6 +111,7 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||||
}
|
}
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
{
|
{
|
||||||
|
SaveDefines();
|
||||||
SaveWindowPos(g_sdata.hwnd);
|
SaveWindowPos(g_sdata.hwnd);
|
||||||
DestroyTooltips();
|
DestroyTooltips();
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
|
@ -196,10 +204,27 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||||
switch (((NMHDR*)lParam)->code ) {
|
switch (((NMHDR*)lParam)->code ) {
|
||||||
case EN_SELCHANGE:
|
case EN_SELCHANGE:
|
||||||
SendDlgItemMessage(hwndDlg,IDC_LOGWIN, EM_EXGETSEL, 0, (LPARAM) &g_sdata.textrange);
|
SendDlgItemMessage(hwndDlg,IDC_LOGWIN, EM_EXGETSEL, 0, (LPARAM) &g_sdata.textrange);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_COPYSELECTED,(g_sdata.textrange.cpMax-g_sdata.textrange.cpMin<=0?MF_GRAYED:MF_ENABLED));
|
{
|
||||||
break;
|
BOOL enabled = (g_sdata.textrange.cpMax-g_sdata.textrange.cpMin<=0?FALSE:TRUE);
|
||||||
|
EnableMenuItem(g_sdata.menu,IDM_COPYSELECTED,(enabled?MF_ENABLED:MF_GRAYED));
|
||||||
|
EnableToolBarButton(IDM_COPY,enabled);
|
||||||
|
}
|
||||||
|
#ifdef COMPRESSOR_OPTION
|
||||||
|
case TBN_DROPDOWN:
|
||||||
|
{
|
||||||
|
LPNMTOOLBAR pToolBar = (LPNMTOOLBAR) lParam;
|
||||||
|
if(pToolBar->hdr.hwndFrom == g_toolbar.hwnd &&
|
||||||
|
pToolBar->iItem == IDM_COMPRESSOR) {
|
||||||
|
ShowToolbarDropdownMenu();
|
||||||
|
return TBDDRET_DEFAULT;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return TBDDRET_NODEFAULT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
case WM_COPYDATA:
|
case WM_COPYDATA:
|
||||||
{
|
{
|
||||||
PCOPYDATASTRUCT cds = PCOPYDATASTRUCT(lParam);
|
PCOPYDATASTRUCT cds = PCOPYDATASTRUCT(lParam);
|
||||||
|
@ -255,6 +280,21 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||||
ShellExecute(g_sdata.hwnd,"open",NSIS_FOR,NULL,NULL,SW_SHOWNORMAL);
|
ShellExecute(g_sdata.hwnd,"open",NSIS_FOR,NULL,NULL,SW_SHOWNORMAL);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
case IDM_NSISUPDATE:
|
||||||
|
{
|
||||||
|
int rv;
|
||||||
|
rv = MessageBox(g_sdata.hwnd,NSISUPDATEPROMPT,"Question",MB_YESNO|MB_ICONQUESTION);
|
||||||
|
if(rv == IDYES) {
|
||||||
|
char pathf[MAX_PATH],*path;
|
||||||
|
GetModuleFileName(NULL,pathf,sizeof(pathf));
|
||||||
|
path=my_strrchr(pathf,'\\');
|
||||||
|
if(path!=NULL) *path=0;
|
||||||
|
lstrcat(pathf,NSIS_UPDATE);
|
||||||
|
ShellExecute(g_sdata.hwnd,"open",pathf,NULL,NULL,SW_SHOWNORMAL);
|
||||||
|
PostMessage(g_sdata.hwnd,WM_COMMAND, IDM_EXIT, 0);
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
case IDM_SELECTALL:
|
case IDM_SELECTALL:
|
||||||
{
|
{
|
||||||
SendDlgItemMessage(g_sdata.hwnd, IDC_LOGWIN, EM_SETSEL, 0, -1);
|
SendDlgItemMessage(g_sdata.hwnd, IDC_LOGWIN, EM_SETSEL, 0, -1);
|
||||||
|
@ -289,6 +329,23 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
#ifdef COMPRESSOR_OPTION
|
||||||
|
case IDM_COMPRESSOR:
|
||||||
|
{
|
||||||
|
switch(g_sdata.compressor) {
|
||||||
|
case COMPRESSOR_DEFAULT:
|
||||||
|
SetCompressor(IDM_ZLIB);
|
||||||
|
break;
|
||||||
|
case COMPRESSOR_ZLIB:
|
||||||
|
SetCompressor(IDM_GZIP);
|
||||||
|
break;
|
||||||
|
case COMPRESSOR_GZIP:
|
||||||
|
SetCompressor(IDM_DEFAULT);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
case IDM_CLEARLOG:
|
case IDM_CLEARLOG:
|
||||||
{
|
{
|
||||||
if (!g_sdata.thread) {
|
if (!g_sdata.thread) {
|
||||||
|
@ -386,6 +443,12 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||||
g_find.hwndFind = FindText(&g_find.fr);
|
g_find.hwndFind = FindText(&g_find.fr);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
#ifdef COMPRESSOR_OPTION
|
||||||
|
case IDM_DEFAULT:
|
||||||
|
case IDM_ZLIB:
|
||||||
|
case IDM_GZIP:
|
||||||
|
return SetCompressor(LOWORD(wParam));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -563,7 +626,8 @@ BOOL CALLBACK DefinesProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
switch (LOWORD(wParam)) {
|
switch (LOWORD(wParam)) {
|
||||||
case IDOK:
|
case IDOK:
|
||||||
{
|
{
|
||||||
ResetObjects();
|
ResetObjects();
|
||||||
|
ResetDefines();
|
||||||
if(g_sdata.input_script) {
|
if(g_sdata.input_script) {
|
||||||
g_sdata.script_alloced = true;
|
g_sdata.script_alloced = true;
|
||||||
g_sdata.script = (char *)GlobalAlloc(GPTR, (lstrlen(g_sdata.input_script)+3)*sizeof(char));
|
g_sdata.script = (char *)GlobalAlloc(GPTR, (lstrlen(g_sdata.input_script)+3)*sizeof(char));
|
||||||
|
@ -664,4 +728,31 @@ BOOL CALLBACK DefinesProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef COMPRESSOR_OPTION
|
||||||
|
BOOL SetCompressor(WORD command)
|
||||||
|
{
|
||||||
|
switch(command) {
|
||||||
|
case IDM_DEFAULT:
|
||||||
|
g_sdata.compressor = COMPRESSOR_DEFAULT;
|
||||||
|
break;
|
||||||
|
case IDM_ZLIB:
|
||||||
|
g_sdata.compressor = COMPRESSOR_ZLIB;
|
||||||
|
break;
|
||||||
|
case IDM_GZIP:
|
||||||
|
g_sdata.compressor = COMPRESSOR_GZIP;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
UpdateToolBarCompressorButton();
|
||||||
|
CheckMenuItem(g_sdata.menu, IDM_DEFAULT, MF_BYCOMMAND | MF_UNCHECKED);
|
||||||
|
CheckMenuItem(g_sdata.menu, IDM_ZLIB, MF_BYCOMMAND | MF_UNCHECKED);
|
||||||
|
CheckMenuItem(g_sdata.menu, IDM_GZIP, MF_BYCOMMAND | MF_UNCHECKED);
|
||||||
|
|
||||||
|
CheckMenuItem(g_sdata.menu, command, MF_BYCOMMAND | MF_CHECKED);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
#endif
|
|
@ -23,8 +23,8 @@ CFG=makensisw - Win32 Debug
|
||||||
|
|
||||||
# Begin Project
|
# Begin Project
|
||||||
# PROP AllowPerConfigDependencies 0
|
# PROP AllowPerConfigDependencies 0
|
||||||
# PROP Scc_ProjName ""
|
# PROP Scc_ProjName "makensisw"
|
||||||
# PROP Scc_LocalPath ""
|
# PROP Scc_LocalPath ".."
|
||||||
CPP=cl.exe
|
CPP=cl.exe
|
||||||
MTL=midl.exe
|
MTL=midl.exe
|
||||||
RSC=rc.exe
|
RSC=rc.exe
|
||||||
|
@ -101,6 +101,10 @@ SOURCE=.\noclib.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\toolbar.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\utils.cpp
|
SOURCE=.\utils.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
@ -129,6 +133,10 @@ SOURCE=.\resource.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\toolbar.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\utils.h
|
SOURCE=.\utils.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# End Group
|
# End Group
|
||||||
|
@ -155,6 +163,10 @@ SOURCE=.\resource.rc
|
||||||
|
|
||||||
SOURCE=.\shell.ico
|
SOURCE=.\shell.ico
|
||||||
# End Source File
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\toolbar.bmp
|
||||||
|
# End Source File
|
||||||
# End Group
|
# End Group
|
||||||
# Begin Group "Documentation"
|
# Begin Group "Documentation"
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,10 @@ Project: "makensisw"=.\makensisw.dsp - Package Owner=<4>
|
||||||
|
|
||||||
Package=<5>
|
Package=<5>
|
||||||
{{{
|
{{{
|
||||||
|
begin source code control
|
||||||
|
makensisw
|
||||||
|
..
|
||||||
|
end source code control
|
||||||
}}}
|
}}}
|
||||||
|
|
||||||
Package=<4>
|
Package=<4>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (c) 2002 Robert Rainwater
|
Copyright (c) 2002 Robert Rainwater
|
||||||
Contributors: Justin Frankel, Fritz Elfert, and Amir Szekely
|
Contributors: Justin Frankel, Fritz Elfert, Amir Szekely, and Sunil Kamath
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -32,25 +32,26 @@
|
||||||
#define NSIS_DEV "http://nsis.sourceforge.net/"
|
#define NSIS_DEV "http://nsis.sourceforge.net/"
|
||||||
#define NSIS_URL "http://www.nullsoft.com/free/nsis/"
|
#define NSIS_URL "http://www.nullsoft.com/free/nsis/"
|
||||||
#define NSIS_FOR "http://forums.winamp.com/forumdisplay.php?forumid=65"
|
#define NSIS_FOR "http://forums.winamp.com/forumdisplay.php?forumid=65"
|
||||||
|
#define NSIS_UPDATE "\\Bin\\NSISUpdate.exe"
|
||||||
#define USAGE "Usage:\r\n\r\n - File | Load Script...\r\n - Drag the .nsi file into this window\r\n - Right click the .nsi file and choose \"Compile NSI\""
|
#define USAGE "Usage:\r\n\r\n - File | Load Script...\r\n - Drag the .nsi file into this window\r\n - Right click the .nsi file and choose \"Compile NSI\""
|
||||||
#define COPYRIGHT "Copyright © 2002 Robert Rainwater"
|
#define COPYRIGHT "Copyright © 2002 Robert Rainwater"
|
||||||
#define CONTRIB "Fritz Elfert, Justin Frankel, Amir Szekely"
|
#define CONTRIB "Fritz Elfert, Justin Frankel, Amir Szekely, Sunil Kamath"
|
||||||
#define DOCPATH "http://nsis.sourceforge.net/Docs/"
|
#define DOCPATH "http://nsis.sourceforge.net/Docs/"
|
||||||
#define LOCALDOCS "\\docs\\index.html"
|
#define LOCALDOCS "\\docs\\index.html"
|
||||||
#define NSISERROR "Unable to intialize MakeNSIS. Please verify that makensis.exe is in the same directory as makensisw.exe."
|
#define NSISERROR "Unable to intialize MakeNSIS. Please verify that makensis.exe is in the same directory as makensisw.exe."
|
||||||
#define DLGERROR "Unable to intialize MakeNSISW."
|
#define DLGERROR "Unable to intialize MakeNSISW."
|
||||||
#define DEFINESERROR "Symbol cannot contain whitespace characters"
|
#define DEFINESERROR "Symbol cannot contain whitespace characters"
|
||||||
|
#define NSISUPDATEPROMPT "Running NSIS Update will close MakeNSISW.\nContinue?"
|
||||||
#define REGSEC HKEY_LOCAL_MACHINE
|
#define REGSEC HKEY_LOCAL_MACHINE
|
||||||
#define REGKEY "Software\\NSIS"
|
#define REGKEY "Software\\NSIS"
|
||||||
#define REGLOC "MakeNSISWPlacement"
|
#define REGLOC "MakeNSISWPlacement"
|
||||||
|
#define REGDEFSUBKEY "Defines"
|
||||||
|
#define REGDEFCOUNT "MakeNSISWDefinesCount"
|
||||||
#define EXENAME "makensis.exe"
|
#define EXENAME "makensis.exe"
|
||||||
#define MAX_STRING 256
|
#define MAX_STRING 256
|
||||||
#define TIMEOUT 100
|
#define TIMEOUT 100
|
||||||
#define MINWIDTH 350
|
#define MINWIDTH 350
|
||||||
#define MINHEIGHT 180
|
#define MINHEIGHT 180
|
||||||
#define REGSEC HKEY_LOCAL_MACHINE
|
|
||||||
#define REGKEY "Software\\NSIS"
|
|
||||||
#define REGLOC "MakeNSISWPlacement"
|
|
||||||
|
|
||||||
#define WM_MAKENSIS_PROCESSCOMPLETE (WM_USER+1001)
|
#define WM_MAKENSIS_PROCESSCOMPLETE (WM_USER+1001)
|
||||||
|
|
||||||
|
@ -61,6 +62,13 @@ enum {
|
||||||
MAKENSIS_NOTIFY_OUTPUT
|
MAKENSIS_NOTIFY_OUTPUT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef COMPRESSOR_OPTION
|
||||||
|
typedef enum {
|
||||||
|
COMPRESSOR_DEFAULT,
|
||||||
|
COMPRESSOR_ZLIB,
|
||||||
|
COMPRESSOR_GZIP
|
||||||
|
} NCOMPRESSOR;
|
||||||
|
#endif
|
||||||
// Extern Variables
|
// Extern Variables
|
||||||
extern const char* NSISW_VERSION;
|
extern const char* NSISW_VERSION;
|
||||||
|
|
||||||
|
@ -73,6 +81,11 @@ BOOL CALLBACK AboutProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||||
BOOL CALLBACK DefinesProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
BOOL CALLBACK DefinesProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||||
void CompileNSISScript();
|
void CompileNSISScript();
|
||||||
char* BuildDefines();
|
char* BuildDefines();
|
||||||
|
#ifdef COMPRESSOR_OPTION
|
||||||
|
BOOL SetCompressor(WORD);
|
||||||
|
#endif
|
||||||
|
void RestoreDefines();
|
||||||
|
void SaveDefines();
|
||||||
|
|
||||||
typedef struct NSISScriptData {
|
typedef struct NSISScriptData {
|
||||||
bool script_alloced;
|
bool script_alloced;
|
||||||
|
@ -93,6 +106,9 @@ typedef struct NSISScriptData {
|
||||||
HANDLE thread;
|
HANDLE thread;
|
||||||
HWND focused_hwnd;
|
HWND focused_hwnd;
|
||||||
CHARRANGE textrange;
|
CHARRANGE textrange;
|
||||||
|
#ifdef COMPRESSOR_OPTION
|
||||||
|
NCOMPRESSOR compressor;
|
||||||
|
#endif
|
||||||
} NSCRIPTDATA;
|
} NSCRIPTDATA;
|
||||||
|
|
||||||
typedef struct ResizeData {
|
typedef struct ResizeData {
|
||||||
|
|
|
@ -2,6 +2,28 @@
|
||||||
// Microsoft Developer Studio generated include file.
|
// Microsoft Developer Studio generated include file.
|
||||||
// Used by resource.rc
|
// Used by resource.rc
|
||||||
//
|
//
|
||||||
|
#define IDS_LOADSCRIPT 1
|
||||||
|
#define IDS_SAVE 2
|
||||||
|
#define IDS_EXIT 3
|
||||||
|
#define IDS_COPY 4
|
||||||
|
#define IDS_FIND 5
|
||||||
|
#define IDS_RECOMPILE 6
|
||||||
|
#define IDS_DEFINES 7
|
||||||
|
#ifdef COMPRESSOR_OPTION
|
||||||
|
#define IDS_COMPRESSOR 8
|
||||||
|
#endif
|
||||||
|
#define IDS_TEST 9
|
||||||
|
#define IDS_EDITSCRIPT 10
|
||||||
|
#define IDS_BROWSESCR 11
|
||||||
|
#define IDS_CLEARLOG 12
|
||||||
|
#define IDS_NSISHOME 13
|
||||||
|
#define IDS_NSISDEV 14
|
||||||
|
#define IDS_FORUM 15
|
||||||
|
#define IDS_NSISUPDATE 16
|
||||||
|
#define IDS_DOCS 17
|
||||||
|
#define IDS_DEFAULT 18
|
||||||
|
#define IDS_ZLIB 19
|
||||||
|
#define IDS_GZIP 20
|
||||||
#define DLG_MAIN 101
|
#define DLG_MAIN 101
|
||||||
#define IDI_ICON 102
|
#define IDI_ICON 102
|
||||||
#define DLG_ABOUT 103
|
#define DLG_ABOUT 103
|
||||||
|
@ -10,6 +32,8 @@
|
||||||
#define IDI_SHELL 112
|
#define IDI_SHELL 112
|
||||||
#define IDB_LOGO 115
|
#define IDB_LOGO 115
|
||||||
#define DLG_DEFINES 116
|
#define DLG_DEFINES 116
|
||||||
|
#define IDB_BITMAP1 120
|
||||||
|
#define IDB_TOOLBAR 122
|
||||||
#define IDC_LOGWIN 402
|
#define IDC_LOGWIN 402
|
||||||
#define IDC_VERSION 405
|
#define IDC_VERSION 405
|
||||||
#define IDC_CLOSE 406
|
#define IDC_CLOSE 406
|
||||||
|
@ -32,6 +56,9 @@
|
||||||
#define IDRIGHT 1019
|
#define IDRIGHT 1019
|
||||||
#define IDLEFT 1020
|
#define IDLEFT 1020
|
||||||
#define IDC_DEFINES 1021
|
#define IDC_DEFINES 1021
|
||||||
|
#ifdef COMPRESSOR_OPTION
|
||||||
|
#define IDM_COMPRESSOR 40001
|
||||||
|
#endif
|
||||||
#define IDM_TEST 40002
|
#define IDM_TEST 40002
|
||||||
#define IDM_EDITSCRIPT 40003
|
#define IDM_EDITSCRIPT 40003
|
||||||
#define IDM_DOCS 40004
|
#define IDM_DOCS 40004
|
||||||
|
@ -43,13 +70,17 @@
|
||||||
#define IDM_NSISDEV 40014
|
#define IDM_NSISDEV 40014
|
||||||
#define IDM_FORUM 40016
|
#define IDM_FORUM 40016
|
||||||
#define IDM_DEFINES 40017
|
#define IDM_DEFINES 40017
|
||||||
|
#define IDM_NSISUPDATE 40018
|
||||||
|
#define IDM_DEFAULT 40020
|
||||||
|
#define IDM_ZLIB 40021
|
||||||
|
#define IDM_GZIP 40022
|
||||||
|
|
||||||
// Next default values for new objects
|
// Next default values for new objects
|
||||||
//
|
//
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
#define _APS_NEXT_RESOURCE_VALUE 117
|
#define _APS_NEXT_RESOURCE_VALUE 124
|
||||||
#define _APS_NEXT_COMMAND_VALUE 40018
|
#define _APS_NEXT_COMMAND_VALUE 40023
|
||||||
#define _APS_NEXT_CONTROL_VALUE 1023
|
#define _APS_NEXT_CONTROL_VALUE 1023
|
||||||
#define _APS_NEXT_SYMED_VALUE 101
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -83,7 +83,15 @@ BEGIN
|
||||||
POPUP "&Tools"
|
POPUP "&Tools"
|
||||||
BEGIN
|
BEGIN
|
||||||
MENUITEM "&Recompile\tCtrl+R", IDM_RECOMPILE
|
MENUITEM "&Recompile\tCtrl+R", IDM_RECOMPILE
|
||||||
MENUITEM "&Define Symbols\tCtrl+D", IDM_DEFINES
|
MENUITEM "&Define Symbols...\tCtrl+D", IDM_DEFINES
|
||||||
|
#ifdef COMPRESSOR_OPTION
|
||||||
|
POPUP "&Set Compressor"
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "Defa&ult", IDM_DEFAULT
|
||||||
|
MENUITEM "&zlib", IDM_ZLIB
|
||||||
|
MENUITEM "&gzip", IDM_GZIP
|
||||||
|
END
|
||||||
|
#endif
|
||||||
MENUITEM "Test &Installer\tCtrl+T", IDM_TEST
|
MENUITEM "Test &Installer\tCtrl+T", IDM_TEST
|
||||||
MENUITEM "Edit Script\tCtrl+E", IDM_EDITSCRIPT
|
MENUITEM "Edit Script\tCtrl+E", IDM_EDITSCRIPT
|
||||||
MENUITEM "Browse Script\tCtrl+B", IDM_BROWSESCR
|
MENUITEM "Browse Script\tCtrl+B", IDM_BROWSESCR
|
||||||
|
@ -94,6 +102,7 @@ BEGIN
|
||||||
MENUITEM "NSIS Homepage", IDM_NSISHOME
|
MENUITEM "NSIS Homepage", IDM_NSISHOME
|
||||||
MENUITEM "NSIS Developer Site", IDM_NSISDEV
|
MENUITEM "NSIS Developer Site", IDM_NSISDEV
|
||||||
MENUITEM "NSIS Forum", IDM_FORUM
|
MENUITEM "NSIS Forum", IDM_FORUM
|
||||||
|
MENUITEM "NSIS Update", IDM_NSISUPDATE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Documentation\tF1", IDM_DOCS
|
MENUITEM "Documentation\tF1", IDM_DOCS
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
|
@ -115,12 +124,15 @@ BEGIN
|
||||||
"D", IDM_DEFINES, VIRTKEY, CONTROL, NOINVERT
|
"D", IDM_DEFINES, VIRTKEY, CONTROL, NOINVERT
|
||||||
"E", IDM_EDITSCRIPT, VIRTKEY, CONTROL, NOINVERT
|
"E", IDM_EDITSCRIPT, VIRTKEY, CONTROL, NOINVERT
|
||||||
"F", IDM_FIND, VIRTKEY, CONTROL, NOINVERT
|
"F", IDM_FIND, VIRTKEY, CONTROL, NOINVERT
|
||||||
|
"G", IDM_GZIP, VIRTKEY, CONTROL, NOINVERT
|
||||||
"L", IDM_LOADSCRIPT, VIRTKEY, CONTROL, NOINVERT
|
"L", IDM_LOADSCRIPT, VIRTKEY, CONTROL, NOINVERT
|
||||||
"R", IDM_RECOMPILE, VIRTKEY, CONTROL, NOINVERT
|
"R", IDM_RECOMPILE, VIRTKEY, CONTROL, NOINVERT
|
||||||
"T", IDM_TEST, VIRTKEY, CONTROL, NOINVERT
|
"T", IDM_TEST, VIRTKEY, CONTROL, NOINVERT
|
||||||
|
"U", IDM_DEFAULT, VIRTKEY, CONTROL, NOINVERT
|
||||||
VK_F1, IDM_DOCS, VIRTKEY, NOINVERT
|
VK_F1, IDM_DOCS, VIRTKEY, NOINVERT
|
||||||
"W", IDM_CLEARLOG, VIRTKEY, CONTROL, NOINVERT
|
"W", IDM_CLEARLOG, VIRTKEY, CONTROL, NOINVERT
|
||||||
"X", IDM_EXIT, VIRTKEY, ALT, NOINVERT
|
"X", IDM_EXIT, VIRTKEY, ALT, NOINVERT
|
||||||
|
"Z", IDM_ZLIB, VIRTKEY, CONTROL, NOINVERT
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
|
@ -129,7 +141,7 @@ END
|
||||||
// Dialog
|
// Dialog
|
||||||
//
|
//
|
||||||
|
|
||||||
DLG_MAIN DIALOG DISCARDABLE 0, 0, 361, 228
|
DLG_MAIN DIALOG DISCARDABLE 0, 0, 362, 246
|
||||||
STYLE DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX |
|
STYLE DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX |
|
||||||
WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU |
|
WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU |
|
||||||
WS_THICKFRAME
|
WS_THICKFRAME
|
||||||
|
@ -139,11 +151,11 @@ FONT 8, "MS Shell Dlg"
|
||||||
BEGIN
|
BEGIN
|
||||||
CONTROL "",IDC_LOGWIN,"RICHEDIT",ES_MULTILINE | ES_AUTOVSCROLL |
|
CONTROL "",IDC_LOGWIN,"RICHEDIT",ES_MULTILINE | ES_AUTOVSCROLL |
|
||||||
ES_NOHIDESEL | ES_READONLY | ES_NUMBER | WS_BORDER |
|
ES_NOHIDESEL | ES_READONLY | ES_NUMBER | WS_BORDER |
|
||||||
WS_VSCROLL,7,4,345,186
|
WS_VSCROLL,7,22,345,186
|
||||||
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,202,346,1
|
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,220,346,1
|
||||||
LTEXT "",IDC_VERSION,7,212,200,12,WS_DISABLED
|
LTEXT "",IDC_VERSION,7,230,200,12,WS_DISABLED
|
||||||
DEFPUSHBUTTON "Clo&se",IDC_CLOSE,296,208,49,15
|
DEFPUSHBUTTON "Clo&se",IDC_CLOSE,296,226,49,15
|
||||||
PUSHBUTTON "Test &Installer",IDC_TEST,230,208,60,15,WS_DISABLED
|
PUSHBUTTON "Test &Installer",IDC_TEST,230,226,60,15,WS_DISABLED
|
||||||
END
|
END
|
||||||
|
|
||||||
DLG_ABOUT DIALOGEX 0, 0, 233, 126
|
DLG_ABOUT DIALOGEX 0, 0, 233, 126
|
||||||
|
@ -165,7 +177,7 @@ END
|
||||||
DLG_DEFINES DIALOGEX 0, 0, 250, 127
|
DLG_DEFINES DIALOGEX 0, 0, 250, 127
|
||||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
CAPTION "Define Symbols"
|
CAPTION "Define Symbols"
|
||||||
FONT 8, "MS Sans Serif"
|
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
DEFPUSHBUTTON "&OK",IDOK,145,106,48,14
|
DEFPUSHBUTTON "&OK",IDOK,145,106,48,14
|
||||||
PUSHBUTTON "&Cancel",IDCANCEL,195,106,48,14
|
PUSHBUTTON "&Cancel",IDCANCEL,195,106,48,14
|
||||||
|
@ -189,6 +201,12 @@ END
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
GUIDELINES DESIGNINFO DISCARDABLE
|
GUIDELINES DESIGNINFO DISCARDABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
|
DLG_MAIN, DIALOG
|
||||||
|
BEGIN
|
||||||
|
RIGHTMARGIN, 361
|
||||||
|
BOTTOMMARGIN, 228
|
||||||
|
END
|
||||||
|
|
||||||
DLG_ABOUT, DIALOG
|
DLG_ABOUT, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
BOTTOMMARGIN, 121
|
BOTTOMMARGIN, 121
|
||||||
|
@ -218,6 +236,43 @@ END
|
||||||
//
|
//
|
||||||
|
|
||||||
IDB_LOGO BITMAP DISCARDABLE "logo.bmp"
|
IDB_LOGO BITMAP DISCARDABLE "logo.bmp"
|
||||||
|
IDB_TOOLBAR BITMAP DISCARDABLE "toolbar.bmp"
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// String Table
|
||||||
|
//
|
||||||
|
|
||||||
|
STRINGTABLE DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
IDS_LOADSCRIPT "Load Script..."
|
||||||
|
IDS_SAVE "Save Output..."
|
||||||
|
IDS_EXIT "Exit"
|
||||||
|
IDS_COPY "Copy"
|
||||||
|
IDS_FIND "Find..."
|
||||||
|
IDS_RECOMPILE "Recompile"
|
||||||
|
IDS_DEFINES "Define Symbols..."
|
||||||
|
#ifdef COMPRESSOR_OPTION
|
||||||
|
IDS_COMPRESSOR "Set Compressor"
|
||||||
|
#endif
|
||||||
|
IDS_TEST "Test Installer"
|
||||||
|
IDS_EDITSCRIPT "Edit Script"
|
||||||
|
IDS_BROWSESCR "Browse Script"
|
||||||
|
IDS_CLEARLOG "Clear Log Window"
|
||||||
|
IDS_NSISHOME "NSIS Homepage"
|
||||||
|
IDS_NSISDEV "NSIS Developer Site"
|
||||||
|
IDS_FORUM "NSIS Forum"
|
||||||
|
END
|
||||||
|
|
||||||
|
STRINGTABLE DISCARDABLE
|
||||||
|
BEGIN
|
||||||
|
IDS_NSISUPDATE "NSIS Update"
|
||||||
|
IDS_DOCS "Documentation"
|
||||||
|
IDS_DEFAULT "Default"
|
||||||
|
IDS_ZLIB "zlib"
|
||||||
|
IDS_GZIP "gzip"
|
||||||
|
END
|
||||||
|
|
||||||
#endif // English (U.S.) resources
|
#endif // English (U.S.) resources
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
Copyright (c) 2002 Robert Rainwater
|
Copyright (c) 2002 Robert Rainwater
|
||||||
Contributors: Justin Frankel, Fritz Elfert, and Amir Szekely
|
Contributors: Justin Frankel, Fritz Elfert, Amir Szekely, and Sunil Kamath
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -22,6 +22,7 @@
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "makensisw.h"
|
#include "makensisw.h"
|
||||||
|
#include "toolbar.h"
|
||||||
#include "noclib.h"
|
#include "noclib.h"
|
||||||
|
|
||||||
NTOOLTIP g_tip;
|
NTOOLTIP g_tip;
|
||||||
|
@ -83,13 +84,22 @@ void DisableItems(HWND hwnd) {
|
||||||
EnableMenuItem(g_sdata.menu,IDM_EXIT,MF_GRAYED);
|
EnableMenuItem(g_sdata.menu,IDM_EXIT,MF_GRAYED);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_LOADSCRIPT,MF_GRAYED);
|
EnableMenuItem(g_sdata.menu,IDM_LOADSCRIPT,MF_GRAYED);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_RECOMPILE,MF_GRAYED);
|
EnableMenuItem(g_sdata.menu,IDM_RECOMPILE,MF_GRAYED);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_DEFINES,MF_GRAYED);
|
|
||||||
EnableMenuItem(g_sdata.menu,IDM_COPY,MF_GRAYED);
|
EnableMenuItem(g_sdata.menu,IDM_COPY,MF_GRAYED);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_COPYSELECTED,MF_GRAYED);
|
EnableMenuItem(g_sdata.menu,IDM_COPYSELECTED,MF_GRAYED);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_EDITSCRIPT,MF_GRAYED);
|
EnableMenuItem(g_sdata.menu,IDM_EDITSCRIPT,MF_GRAYED);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_CLEARLOG,MF_GRAYED);
|
EnableMenuItem(g_sdata.menu,IDM_CLEARLOG,MF_GRAYED);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_BROWSESCR,MF_GRAYED);
|
EnableMenuItem(g_sdata.menu,IDM_BROWSESCR,MF_GRAYED);
|
||||||
|
|
||||||
|
EnableToolBarButton(IDM_SAVE,FALSE);
|
||||||
|
EnableToolBarButton(IDM_TEST,FALSE);
|
||||||
|
EnableToolBarButton(IDM_EXIT,FALSE);
|
||||||
|
EnableToolBarButton(IDM_LOADSCRIPT,FALSE);
|
||||||
|
EnableToolBarButton(IDM_RECOMPILE,FALSE);
|
||||||
|
EnableToolBarButton(IDM_COPY,FALSE);
|
||||||
|
EnableToolBarButton(IDM_EDITSCRIPT,FALSE);
|
||||||
|
EnableToolBarButton(IDM_CLEARLOG,FALSE);
|
||||||
|
EnableToolBarButton(IDM_BROWSESCR,FALSE);
|
||||||
|
|
||||||
if (!IsWindowEnabled(g_sdata.focused_hwnd))
|
if (!IsWindowEnabled(g_sdata.focused_hwnd))
|
||||||
SetFocus(GetDlgItem(hwnd,IDC_LOGWIN));
|
SetFocus(GetDlgItem(hwnd,IDC_LOGWIN));
|
||||||
}
|
}
|
||||||
|
@ -98,18 +108,27 @@ void EnableItems(HWND hwnd) {
|
||||||
if (g_sdata.output_exe && !g_sdata.retcode) {
|
if (g_sdata.output_exe && !g_sdata.retcode) {
|
||||||
EnableWindow(GetDlgItem(hwnd,IDC_TEST),1);
|
EnableWindow(GetDlgItem(hwnd,IDC_TEST),1);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_TEST,MF_ENABLED);
|
EnableMenuItem(g_sdata.menu,IDM_TEST,MF_ENABLED);
|
||||||
|
EnableToolBarButton(IDM_TEST,TRUE);
|
||||||
}
|
}
|
||||||
EnableWindow(GetDlgItem(hwnd,IDC_CLOSE),1);
|
EnableWindow(GetDlgItem(hwnd,IDC_CLOSE),1);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_SAVE,MF_ENABLED);
|
EnableMenuItem(g_sdata.menu,IDM_SAVE,MF_ENABLED);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_EXIT,MF_ENABLED);
|
EnableMenuItem(g_sdata.menu,IDM_EXIT,MF_ENABLED);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_LOADSCRIPT,MF_ENABLED);
|
EnableMenuItem(g_sdata.menu,IDM_LOADSCRIPT,MF_ENABLED);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_RECOMPILE,MF_ENABLED);
|
EnableMenuItem(g_sdata.menu,IDM_RECOMPILE,MF_ENABLED);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_DEFINES,MF_ENABLED);
|
|
||||||
EnableMenuItem(g_sdata.menu,IDM_COPY,MF_ENABLED);
|
EnableMenuItem(g_sdata.menu,IDM_COPY,MF_ENABLED);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_COPYSELECTED,MF_ENABLED);
|
EnableMenuItem(g_sdata.menu,IDM_COPYSELECTED,MF_ENABLED);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_EDITSCRIPT,MF_ENABLED);
|
EnableMenuItem(g_sdata.menu,IDM_EDITSCRIPT,MF_ENABLED);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_CLEARLOG,MF_ENABLED);
|
EnableMenuItem(g_sdata.menu,IDM_CLEARLOG,MF_ENABLED);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_BROWSESCR,MF_ENABLED);
|
EnableMenuItem(g_sdata.menu,IDM_BROWSESCR,MF_ENABLED);
|
||||||
|
|
||||||
|
EnableToolBarButton(IDM_SAVE,TRUE);
|
||||||
|
EnableToolBarButton(IDM_EXIT,TRUE);
|
||||||
|
EnableToolBarButton(IDM_LOADSCRIPT,TRUE);
|
||||||
|
EnableToolBarButton(IDM_RECOMPILE,TRUE);
|
||||||
|
EnableToolBarButton(IDM_COPY,TRUE);
|
||||||
|
EnableToolBarButton(IDM_EDITSCRIPT,TRUE);
|
||||||
|
EnableToolBarButton(IDM_CLEARLOG,TRUE);
|
||||||
|
EnableToolBarButton(IDM_BROWSESCR,TRUE);
|
||||||
|
|
||||||
SetFocus(g_sdata.focused_hwnd);
|
SetFocus(g_sdata.focused_hwnd);
|
||||||
}
|
}
|
||||||
|
@ -122,10 +141,14 @@ void CompileNSISScript() {
|
||||||
if (lstrlen(g_sdata.script)==0) {
|
if (lstrlen(g_sdata.script)==0) {
|
||||||
LogMessage(g_sdata.hwnd,USAGE);
|
LogMessage(g_sdata.hwnd,USAGE);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_RECOMPILE,MF_GRAYED);
|
EnableMenuItem(g_sdata.menu,IDM_RECOMPILE,MF_GRAYED);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_DEFINES,MF_GRAYED);
|
|
||||||
EnableMenuItem(g_sdata.menu,IDM_EDITSCRIPT,MF_GRAYED);
|
EnableMenuItem(g_sdata.menu,IDM_EDITSCRIPT,MF_GRAYED);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_TEST,MF_GRAYED);
|
EnableMenuItem(g_sdata.menu,IDM_TEST,MF_GRAYED);
|
||||||
EnableMenuItem(g_sdata.menu,IDM_BROWSESCR,MF_GRAYED);
|
EnableMenuItem(g_sdata.menu,IDM_BROWSESCR,MF_GRAYED);
|
||||||
|
EnableToolBarButton(IDM_RECOMPILE,FALSE);
|
||||||
|
EnableToolBarButton(IDM_EDITSCRIPT,FALSE);
|
||||||
|
EnableToolBarButton(IDM_TEST,FALSE);
|
||||||
|
EnableToolBarButton(IDM_BROWSESCR,FALSE);
|
||||||
|
|
||||||
EnableWindow(GetDlgItem(g_sdata.hwnd,IDC_TEST),0);
|
EnableWindow(GetDlgItem(g_sdata.hwnd,IDC_TEST),0);
|
||||||
DragAcceptFiles(g_sdata.hwnd,TRUE);
|
DragAcceptFiles(g_sdata.hwnd,TRUE);
|
||||||
return;
|
return;
|
||||||
|
@ -178,7 +201,68 @@ void SaveWindowPos(HWND hwnd) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RestoreDefines()
|
||||||
|
{
|
||||||
|
HKEY hKey;
|
||||||
|
HKEY hSubKey;
|
||||||
|
if (RegOpenKeyEx(REGSEC,REGKEY,0,KEY_READ,&hKey) == ERROR_SUCCESS) {
|
||||||
|
int n = 0;
|
||||||
|
DWORD l = sizeof(n);
|
||||||
|
DWORD t;
|
||||||
|
if ((RegQueryValueEx(hKey,REGDEFCOUNT,NULL,&t,(unsigned char*)&n,&l)==ERROR_SUCCESS)&&(t == REG_DWORD)&&(l==sizeof(n))) {
|
||||||
|
if(n > 0) {
|
||||||
|
if (RegCreateKey(hKey,REGDEFSUBKEY,&hSubKey) == ERROR_SUCCESS) {
|
||||||
|
char buf[8];
|
||||||
|
g_sdata.defines = (char **)GlobalAlloc(GPTR, (n+1)*sizeof(char *));
|
||||||
|
for(int i=0; i<n; i++) {
|
||||||
|
wsprintf(buf,"%d",i);
|
||||||
|
l = 0;
|
||||||
|
if ((RegQueryValueEx(hSubKey,buf,NULL,&t,NULL,&l)==ERROR_SUCCESS)&&(t == REG_SZ)) {
|
||||||
|
l++;
|
||||||
|
g_sdata.defines[i] = (char *)GlobalAlloc(GPTR, l*sizeof(char));
|
||||||
|
RegQueryValueEx(hSubKey,buf,NULL,&t,(unsigned char*)g_sdata.defines[i],&l);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
g_sdata.defines[n] = NULL;
|
||||||
|
RegCloseKey(hSubKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RegCloseKey(hKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SaveDefines()
|
||||||
|
{
|
||||||
|
HKEY hKey;
|
||||||
|
HKEY hSubKey;
|
||||||
|
int n = 0;
|
||||||
|
if (RegCreateKey(REGSEC,REGKEY,&hKey) == ERROR_SUCCESS) {
|
||||||
|
RegDeleteKey(hKey,REGDEFSUBKEY);
|
||||||
|
if(g_sdata.defines) {
|
||||||
|
if (RegCreateKey(hKey,REGDEFSUBKEY,&hSubKey) == ERROR_SUCCESS) {
|
||||||
|
char buf[8];
|
||||||
|
while(g_sdata.defines[n]) {
|
||||||
|
wsprintf(buf,"%d",n);
|
||||||
|
RegSetValueEx(hSubKey,buf,0,REG_SZ,(CONST BYTE *)g_sdata.defines[n],lstrlen(g_sdata.defines[n]));
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
RegCloseKey(hSubKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RegSetValueEx(hKey,REGDEFCOUNT,0,REG_DWORD,(CONST BYTE *)&n,sizeof(n));
|
||||||
|
RegCloseKey(hKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ResetObjects() {
|
void ResetObjects() {
|
||||||
|
g_sdata.appended = FALSE;
|
||||||
|
g_sdata.warnings = FALSE;
|
||||||
|
g_sdata.retcode = -1;
|
||||||
|
g_sdata.thread = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResetDefines() {
|
||||||
if(g_sdata.defines) {
|
if(g_sdata.defines) {
|
||||||
int i=0;
|
int i=0;
|
||||||
while(g_sdata.defines[i]) {
|
while(g_sdata.defines[i]) {
|
||||||
|
@ -188,10 +272,6 @@ void ResetObjects() {
|
||||||
GlobalFree(g_sdata.defines);
|
GlobalFree(g_sdata.defines);
|
||||||
g_sdata.defines = NULL;
|
g_sdata.defines = NULL;
|
||||||
}
|
}
|
||||||
g_sdata.appended = FALSE;
|
|
||||||
g_sdata.warnings = FALSE;
|
|
||||||
g_sdata.retcode = -1;
|
|
||||||
g_sdata.thread = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int InitBranding() {
|
int InitBranding() {
|
||||||
|
@ -260,6 +340,7 @@ void InitTooltips(HWND h) {
|
||||||
g_tip.hook = SetWindowsHookEx(WH_GETMESSAGE,TipHookProc,NULL, GetCurrentThreadId());
|
g_tip.hook = SetWindowsHookEx(WH_GETMESSAGE,TipHookProc,NULL, GetCurrentThreadId());
|
||||||
AddTip(GetDlgItem(h,IDC_CLOSE),TEXT("Close MakeNSISW"));
|
AddTip(GetDlgItem(h,IDC_CLOSE),TEXT("Close MakeNSISW"));
|
||||||
AddTip(GetDlgItem(h,IDC_TEST),TEXT("Test the installer generated by MakeNSISW"));
|
AddTip(GetDlgItem(h,IDC_TEST),TEXT("Test the installer generated by MakeNSISW"));
|
||||||
|
AddToolBarTooltips();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DestroyTooltips() {
|
void DestroyTooltips() {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Copyright (c) 2002 Robert Rainwater
|
Copyright (c) 2002 Robert Rainwater
|
||||||
Portions Copyright (c) 2002 Justin Frankel and Fritz Elfert
|
Copyright (c) 2002 Robert Rainwater
|
||||||
|
Contributors: Justin Frankel, Fritz Elfert, and Sunil Kamath
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
@ -33,6 +34,7 @@ void EnableItems(HWND hwnd);
|
||||||
void RestoreWindowPos(HWND hwnd);
|
void RestoreWindowPos(HWND hwnd);
|
||||||
void SaveWindowPos(HWND hwnd);
|
void SaveWindowPos(HWND hwnd);
|
||||||
void ResetObjects();
|
void ResetObjects();
|
||||||
|
void ResetDefines();
|
||||||
int InitBranding();
|
int InitBranding();
|
||||||
void InitTooltips(HWND h);
|
void InitTooltips(HWND h);
|
||||||
void DestroyTooltips();
|
void DestroyTooltips();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue