This commit was generated by cvs2svn to compensate for changes in r2,
which included commits to RCS files with non-trunk default branches. git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@625 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
9b3b220a13
commit
3e9e73ec59
177 changed files with 37677 additions and 0 deletions
18
Contrib/Makensisw/License.txt
Normal file
18
Contrib/Makensisw/License.txt
Normal file
|
@ -0,0 +1,18 @@
|
|||
Copyright (c) 2002 Robert Rainwter <rrainwater@yahoo.com>
|
||||
-- this version was slightly modified by Justin Frankel --
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
152
Contrib/Makensisw/Readme.txt
Normal file
152
Contrib/Makensisw/Readme.txt
Normal file
|
@ -0,0 +1,152 @@
|
|||
----------------------------------------------------
|
||||
MakeNSISW - MakeNSIS Windows Wrapper
|
||||
----------------------------------------------------
|
||||
|
||||
|
||||
About MakeNSISW
|
||||
---------------
|
||||
MakeNSISW is a wrapper for the MakeNSIS that is distributed with
|
||||
NSIS (http://www.nullsoft.com/free/nsis/). MakeNSISW allows you
|
||||
to compile NSIS scripts using a Windows GUI interface. To install
|
||||
MakeNSISW, compile the source using Visual C++ or Mingw.
|
||||
|
||||
|
||||
Requirements
|
||||
------------
|
||||
MakeNSISW requires NSIS be installed on your system. The default
|
||||
directory for this installation is $PROGRAMFILES\NSIS\Contrib\MakeNSISW.
|
||||
|
||||
|
||||
Usage:
|
||||
------
|
||||
If you installed the Shell Extensions option during the installation, then
|
||||
all that is required is that you choose 'Compile NSI' from the right-
|
||||
click menu on a NSIS script. This will invoke MakeNSISW.
|
||||
|
||||
The format of the parameters when calling MakeNSISW from the commandline is:
|
||||
makensisw full_path_of_makensis.exe [options] [script.nsi | - [...]]
|
||||
|
||||
Where full_path_of_makensis.exe is the full name including the path of the
|
||||
compiler. For the options, please see the MakeNSIS documentation.
|
||||
|
||||
|
||||
Shortcut Keys
|
||||
-------------
|
||||
Ctrl+R: Recompiles the script
|
||||
Ctrl+X: Exits the application
|
||||
Ctrl+T: Tests the installer
|
||||
Ctrl+E: Edits the script
|
||||
|
||||
|
||||
Version History
|
||||
---------------
|
||||
0.1
|
||||
- Initial Release
|
||||
|
||||
0.2
|
||||
- Added ability to save output and copy output
|
||||
|
||||
0.3
|
||||
- Added option to recompile script (F2 or File|Recompile)
|
||||
- Added Help Menu
|
||||
- Return code is now always set
|
||||
- Added Accelerator key support for Exit and Recompile
|
||||
- No longer uses NSIS's version string
|
||||
- Made clearer status message in title bar
|
||||
- Disabled menu/accelerator functions during compile
|
||||
|
||||
0.4
|
||||
- Fixed Copy Selected bug
|
||||
|
||||
0.5
|
||||
- Minor Makefile changes (mingw)
|
||||
- Moved strings into global strings to make editing easier
|
||||
- Added Clear Log Command under Edit menu
|
||||
- Recompile no longer clears the log window (use F5)
|
||||
- Close is now the default button when you hit enter
|
||||
- added VC++ project, updated resources to work with VC++
|
||||
- rearranged directory structure
|
||||
- makefiles now target ../../makensisw.exe
|
||||
- removed makensisw home link in help menu (hope this is ok,
|
||||
doesn't really seem needed to me)
|
||||
- made display use a fixed width font (Some people may not like
|
||||
this, but I do)
|
||||
- added 'test' button (peeks output for 'Output' line)
|
||||
- made it so that the log shows the most recent 32k.
|
||||
- made it so that the log always clears on a recompile.
|
||||
- compiled with VC++ so no longer needs msvcrt.dll
|
||||
- made the compiler name be a full path (for more flexibility)
|
||||
|
||||
0.6
|
||||
- print correct usage if unable to execute compiler
|
||||
- removed mingw warnings
|
||||
- set title/branding before errors
|
||||
- some docs changes
|
||||
- Added Edit|Edit Script function
|
||||
|
||||
0.7
|
||||
- Edit Script should now work for output>32k
|
||||
- Added resize support (thanks to felfert)
|
||||
- Added window position saving (thanks to felfert)
|
||||
- Disable some items when exec of makensis failed
|
||||
|
||||
0.8
|
||||
- Added window size constraints (thanks to bcheck)
|
||||
- Cleaned up the resource file
|
||||
|
||||
0.9
|
||||
- Removed global strings (moved into #defines)
|
||||
- Some GUI changes
|
||||
- No longer focused Close button (its default anyways)
|
||||
- Fixed resize bug on minimize/restore (thanks to felfert)
|
||||
- Made window placement stored in HKLM instead of HKCU, cause
|
||||
I hate things that get littered in HKCU.
|
||||
|
||||
1.0
|
||||
- Fixed bug with large output causing crash
|
||||
|
||||
1.1
|
||||
- Crash may actually be fixed
|
||||
|
||||
1.2
|
||||
- XP visual style support
|
||||
|
||||
1.3
|
||||
- Added Documentation menu item
|
||||
- Fix GUI problem with About dialog
|
||||
|
||||
1.4
|
||||
- Edit Script command will now work with or without file associations
|
||||
- Added default filename for save dialog
|
||||
- Use standard fonts
|
||||
- Documentation menuitem caused recompile
|
||||
|
||||
1.5
|
||||
- Fixed Copy All function
|
||||
|
||||
1.6
|
||||
- Reduced size from 44k to 12k (kickik)
|
||||
- Editbox not limited to 32k (now using richedit control)
|
||||
- Made the log window font-size smaller.
|
||||
|
||||
|
||||
Copyright Information
|
||||
---------------------
|
||||
Copyright (c) 2002 Robert Rainwater
|
||||
Portions Copyright (c) 2002 Justin Frankel and Fritz Elfert
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
5
Contrib/Makensisw/afxres.h
Normal file
5
Contrib/Makensisw/afxres.h
Normal file
|
@ -0,0 +1,5 @@
|
|||
#include <windows.h>
|
||||
|
||||
#ifndef IDC_STATIC
|
||||
#define IDC_STATIC -1
|
||||
#endif
|
363
Contrib/Makensisw/makensisw.cpp
Normal file
363
Contrib/Makensisw/makensisw.cpp
Normal file
|
@ -0,0 +1,363 @@
|
|||
/*
|
||||
Copyright (c) 2002 Robert Rainwater
|
||||
Portions Copyright (c) 2002 Justin Frankel and Fritz Elfert
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
*/
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "makensisw.h"
|
||||
#include "resource.h"
|
||||
#include "noclib.h"
|
||||
|
||||
char *g_script;
|
||||
int g_retcode;
|
||||
|
||||
static RECT resizeRect;
|
||||
static int dx;
|
||||
static int dy;
|
||||
|
||||
HINSTANCE g_hInstance;
|
||||
HWND g_hwnd;
|
||||
HANDLE g_hThread;
|
||||
|
||||
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, char *cmdParam, int cmdShow) {
|
||||
HACCEL haccel;
|
||||
g_hInstance=GetModuleHandle(0);
|
||||
g_script=GetCommandLine(); // set commandline global string
|
||||
if (*g_script++=='"') while (*g_script++!='"');
|
||||
else while (*g_script++!=' ');
|
||||
while (*g_script==' ') g_script++;
|
||||
g_retcode = -1; // return code is always false unless set to true by GetExitCodeProcess
|
||||
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;
|
||||
}
|
||||
haccel = LoadAccelerators(g_hInstance, MAKEINTRESOURCE(IDK_ACCEL));
|
||||
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;
|
||||
}
|
||||
|
||||
BOOL CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||
static HINSTANCE hRichEditDLL = 0;
|
||||
if (!hRichEditDLL) hRichEditDLL= LoadLibrary("RichEd32.dll");
|
||||
switch (msg) {
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
g_hwnd=hwndDlg;
|
||||
HICON hIcon = LoadIcon(g_hInstance,MAKEINTRESOURCE(IDI_ICON));
|
||||
SetClassLong(hwndDlg,GCL_HICON,(long)hIcon);
|
||||
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,EM_SETBKGNDCOLOR,0,GetSysColor(COLOR_BTNFACE));
|
||||
RestoreWindowPos(g_hwnd);
|
||||
CompileNSISScript();
|
||||
return TRUE;
|
||||
}
|
||||
case WM_DESTROY:
|
||||
{
|
||||
SaveWindowPos(g_hwnd);
|
||||
PostQuitMessage(0);
|
||||
return TRUE;
|
||||
}
|
||||
case WM_CLOSE:
|
||||
{
|
||||
if (!g_hThread) {
|
||||
DestroyWindow(hwndDlg);
|
||||
FreeLibrary(hRichEditDLL);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
case WM_GETMINMAXINFO:
|
||||
{
|
||||
((MINMAXINFO*)lParam)->ptMinTrackSize.x=MINWIDTH;
|
||||
((MINMAXINFO*)lParam)->ptMinTrackSize.y=MINHEIGHT;
|
||||
}
|
||||
case WM_ENTERSIZEMOVE:
|
||||
{
|
||||
|
||||
GetClientRect(g_hwnd, &resizeRect);
|
||||
return TRUE;
|
||||
}
|
||||
case WM_SIZE:
|
||||
{
|
||||
if ((wParam == SIZE_MAXHIDE)||(wParam == SIZE_MAXSHOW)) return TRUE;
|
||||
}
|
||||
case WM_SIZING:
|
||||
{
|
||||
RECT rSize;
|
||||
if (hwndDlg == g_hwnd) {
|
||||
GetClientRect(g_hwnd, &rSize);
|
||||
if (((rSize.right==0)&&(rSize.bottom==0))||((resizeRect.right==0)&&(resizeRect.bottom==0)))
|
||||
return TRUE;
|
||||
dx = rSize.right - resizeRect.right;
|
||||
dy = rSize.bottom - resizeRect.bottom;
|
||||
EnumChildWindows(g_hwnd, DialogResize, (LPARAM)0);
|
||||
resizeRect = rSize;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
case WM_MAKENSIS_PROCESSCOMPLETE:
|
||||
{
|
||||
if (g_hThread) {
|
||||
CloseHandle(g_hThread);
|
||||
g_hThread=0;
|
||||
}
|
||||
if (g_retcode==0) SetTitle(g_hwnd,"Finished Sucessfully");
|
||||
else SetTitle(g_hwnd,"Compile Error: See Log for Details");
|
||||
EnableItems(g_hwnd);
|
||||
return TRUE;
|
||||
}
|
||||
case WM_COMMAND:
|
||||
{
|
||||
switch (LOWORD(wParam)) {
|
||||
case IDM_ABOUT:
|
||||
{
|
||||
DialogBox(g_hInstance,MAKEINTRESOURCE(DLG_ABOUT),g_hwnd,(DLGPROC)AboutProc);
|
||||
return TRUE;
|
||||
}
|
||||
case IDM_NSISHOME:
|
||||
{
|
||||
ShellExecute(g_hwnd,"open",NSIS_URL,NULL,NULL,SW_SHOWNORMAL);
|
||||
return TRUE;
|
||||
}
|
||||
case IDM_DOCS:
|
||||
{
|
||||
char pathf[MAX_PATH],*path;
|
||||
GetModuleFileName(NULL,pathf,sizeof(pathf));
|
||||
path=my_strrchr(pathf,'\\');
|
||||
if(path!=NULL) *path=0;
|
||||
lstrcat(pathf,"\\makensis.htm");
|
||||
if ((int)ShellExecute(g_hwnd,"open",pathf,NULL,NULL,SW_SHOWNORMAL)<=32)
|
||||
ShellExecute(g_hwnd,"open",DOCPATH,NULL,NULL,SW_SHOWNORMAL);
|
||||
return TRUE;
|
||||
}
|
||||
case IDM_RECOMPILE:
|
||||
{
|
||||
CompileNSISScript();
|
||||
return TRUE;
|
||||
}
|
||||
case IDM_TEST:
|
||||
case IDC_TEST:
|
||||
{
|
||||
if (g_output_exe[0]) {
|
||||
ShellExecute(g_hwnd,"open",g_output_exe,NULL,NULL,SW_SHOWNORMAL);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
case IDM_EDITSCRIPT:
|
||||
{
|
||||
if (g_input_script[0]) {
|
||||
if ((int)ShellExecute(g_hwnd,"open",g_input_script,NULL,NULL,SW_SHOWNORMAL)<=32) {
|
||||
char path[MAX_PATH];
|
||||
if (GetWindowsDirectory(path,sizeof(path))) {
|
||||
lstrcat(path,"\\notepad.exe");
|
||||
ShellExecute(g_hwnd,"open",path,g_input_script,NULL,SW_SHOWNORMAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
case IDC_CLOSE:
|
||||
case IDM_EXIT:
|
||||
{
|
||||
if (!g_hThread) {
|
||||
DestroyWindow(hwndDlg);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
case IDM_COPY:
|
||||
{
|
||||
CopyToClipboard(g_hwnd);
|
||||
return TRUE;
|
||||
}
|
||||
case IDM_COPYSELECTED:
|
||||
{
|
||||
SendMessage(GetDlgItem(g_hwnd,IDC_LOGWIN), WM_COPY, 0, 0);
|
||||
return TRUE;
|
||||
}
|
||||
case IDM_SAVE:
|
||||
{
|
||||
OPENFILENAME l={sizeof(l),};
|
||||
char buf[MAX_STRING];
|
||||
l.hwndOwner = hwndDlg;
|
||||
l.lpstrFilter = "Log Files (*.log)\0Text Files (*.txt)\0*.txt\0All Files (*.*)\0*.*\0";
|
||||
l.lpstrFile = buf;
|
||||
l.nMaxFile = 1023;
|
||||
l.lpstrTitle = "Save Output";
|
||||
l.lpstrDefExt = "log";
|
||||
l.lpstrInitialDir = NULL;
|
||||
l.Flags = OFN_HIDEREADONLY|OFN_EXPLORER|OFN_PATHMUSTEXIST;
|
||||
lstrcpy(buf,"output.log");
|
||||
if (GetSaveFileName(&l)) {
|
||||
HANDLE hFile = CreateFile(buf,GENERIC_WRITE,0,0,CREATE_ALWAYS,0,0);
|
||||
if (hFile) {
|
||||
int len=SendDlgItemMessage(g_hwnd,IDC_LOGWIN,WM_GETTEXTLENGTH,0,0);
|
||||
char *existing_text=(char*)GlobalAlloc(GPTR,len);
|
||||
existing_text[0]=0;
|
||||
GetDlgItemText(g_hwnd, IDC_LOGWIN, existing_text, len);
|
||||
DWORD dwWritten = 0;
|
||||
WriteFile(hFile,existing_text,len,&dwWritten,0);
|
||||
CloseHandle(hFile);
|
||||
GlobalFree(existing_text);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
DWORD WINAPI MakeNSISProc(LPVOID p) {
|
||||
char buf[1024];
|
||||
STARTUPINFO si={sizeof(si),};
|
||||
SECURITY_ATTRIBUTES sa={sizeof(sa),};
|
||||
SECURITY_DESCRIPTOR sd={0,};
|
||||
PROCESS_INFORMATION pi={0,};
|
||||
HANDLE newstdout=0,read_stdout=0;
|
||||
|
||||
OSVERSIONINFO osv={sizeof(osv)};
|
||||
GetVersionEx(&osv);
|
||||
if (osv.dwPlatformId == VER_PLATFORM_WIN32_NT) {
|
||||
InitializeSecurityDescriptor(&sd,SECURITY_DESCRIPTOR_REVISION);
|
||||
SetSecurityDescriptorDacl(&sd,true,NULL,false);
|
||||
sa.lpSecurityDescriptor = &sd;
|
||||
}
|
||||
else sa.lpSecurityDescriptor = NULL;
|
||||
sa.bInheritHandle = true;
|
||||
if (!CreatePipe(&read_stdout,&newstdout,&sa,0)) {
|
||||
ErrorMessage(g_hwnd,"There was an error creating the pipe.");
|
||||
PostMessage(g_hwnd,WM_MAKENSIS_PROCESSCOMPLETE,0,0);
|
||||
return 1;
|
||||
}
|
||||
GetStartupInfo(&si);
|
||||
si.dwFlags = STARTF_USESTDHANDLES|STARTF_USESHOWWINDOW;
|
||||
si.wShowWindow = SW_HIDE;
|
||||
si.hStdOutput = newstdout;
|
||||
si.hStdError = newstdout;
|
||||
if (!CreateProcess(NULL,g_script,NULL,NULL,TRUE,CREATE_NEW_CONSOLE,NULL,NULL,&si,&pi)) {
|
||||
char buf[MAX_STRING];
|
||||
wsprintf(buf,"Could not execute:\r\n %s.",g_script);
|
||||
ErrorMessage(g_hwnd,buf);
|
||||
CloseHandle(newstdout);
|
||||
CloseHandle(read_stdout);
|
||||
PostMessage(g_hwnd,WM_MAKENSIS_PROCESSCOMPLETE,0,0);
|
||||
return 1;
|
||||
}
|
||||
unsigned long exit=0,read,avail;
|
||||
my_memset(buf,0,sizeof(buf));
|
||||
while(1) {
|
||||
PeekNamedPipe(read_stdout,buf,sizeof(buf)-1,&read,&avail,NULL);
|
||||
if (read != 0) {
|
||||
my_memset(buf,0,sizeof(buf));
|
||||
if (avail > sizeof(buf)-1) {
|
||||
while (read >= sizeof(buf)-1) {
|
||||
ReadFile(read_stdout,buf,sizeof(buf)-1,&read,NULL);
|
||||
LogMessage(g_hwnd,buf);
|
||||
my_memset(buf,0,sizeof(buf));
|
||||
}
|
||||
}
|
||||
else {
|
||||
ReadFile(read_stdout,buf,sizeof(buf),&read,NULL);
|
||||
LogMessage(g_hwnd,buf);
|
||||
}
|
||||
}
|
||||
GetExitCodeProcess(pi.hProcess,&exit);
|
||||
if (exit != STILL_ACTIVE) break;
|
||||
Sleep(TIMEOUT);
|
||||
}
|
||||
g_retcode = exit;
|
||||
CloseHandle(pi.hThread);
|
||||
CloseHandle(pi.hProcess);
|
||||
CloseHandle(newstdout);
|
||||
CloseHandle(read_stdout);
|
||||
PostMessage(g_hwnd,WM_MAKENSIS_PROCESSCOMPLETE,0,0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL CALLBACK DialogResize(HWND hWnd, LPARAM /* unused */)
|
||||
{
|
||||
RECT r;
|
||||
GetWindowRect(hWnd, &r);
|
||||
ScreenToClient(g_hwnd, (LPPOINT)&r);
|
||||
ScreenToClient(g_hwnd, ((LPPOINT)&r)+1);
|
||||
switch (GetDlgCtrlID(hWnd)) {
|
||||
case IDC_LOGWIN:
|
||||
SetWindowPos(hWnd, 0, r.left, r.top,r.right - r.left + dx, r.bottom - r.top + dy, SWP_NOZORDER|SWP_NOMOVE);
|
||||
break;
|
||||
case IDC_TEST:
|
||||
case IDC_CLOSE:
|
||||
SetWindowPos(hWnd, 0, r.left + dx, r.top + dy, 0, 0, SWP_NOZORDER|SWP_NOSIZE);
|
||||
break;
|
||||
default:
|
||||
SetWindowPos(hWnd, 0, r.left, r.top + dy, r.right - r.left + dx, r.bottom - r.top, SWP_NOZORDER);
|
||||
break;
|
||||
}
|
||||
RedrawWindow(hWnd,NULL,NULL,RDW_INVALIDATE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CALLBACK AboutProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||
switch(msg) {
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
HFONT bfont = CreateFont(14,0,0,0,FW_BOLD,FALSE,FALSE,FALSE,DEFAULT_CHARSET,
|
||||
OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
|
||||
FIXED_PITCH|FF_DONTCARE, "MS Shell Dlg");
|
||||
HFONT rfont = CreateFont(12,0,0,0,FW_NORMAL,FALSE,FALSE,FALSE,DEFAULT_CHARSET,
|
||||
OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
|
||||
FIXED_PITCH|FF_DONTCARE, "MS Shell Dlg");
|
||||
if (bfont) SendDlgItemMessage(hwndDlg, IDC_ABOUTVERSION, WM_SETFONT, (WPARAM)bfont, FALSE);
|
||||
if (rfont) {
|
||||
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);
|
||||
SetDlgItemText(hwndDlg,IDC_ABOUTCOPY,COPYRIGHT);
|
||||
SetDlgItemText(hwndDlg,IDC_ABOUTPORTIONS,CONTRIBUTOR);
|
||||
}
|
||||
case WM_COMMAND:
|
||||
{
|
||||
switch (LOWORD(wParam)) {
|
||||
case IDOK: {
|
||||
EndDialog(hwndDlg, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
160
Contrib/Makensisw/makensisw.dsp
Normal file
160
Contrib/Makensisw/makensisw.dsp
Normal file
|
@ -0,0 +1,160 @@
|
|||
# Microsoft Developer Studio Project File - Name="makensisw" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=makensisw - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "makensisw.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "makensisw.mak" CFG="makensisw - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "makensisw - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "makensisw - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "makensisw - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D RELEASE=1.6 /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /entry:"WinMain" /subsystem:windows /machine:I386 /nodefaultlib /out:"../../makensisw.exe" /opt:nowin98
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "makensisw - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "makensisw - Win32 Release"
|
||||
# Name "makensisw - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\makensisw.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\noclib.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\utils.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\version.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\afxres.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\makensisw.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\noclib.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Source\default1.bin
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\source\icon.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\resource.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\Source\rt_manif.bin
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Documentation"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Readme.txt
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\makensisw.xml
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
29
Contrib/Makensisw/makensisw.dsw
Normal file
29
Contrib/Makensisw/makensisw.dsw
Normal file
|
@ -0,0 +1,29 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "makensisw"=.\makensisw.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
74
Contrib/Makensisw/makensisw.h
Normal file
74
Contrib/Makensisw/makensisw.h
Normal file
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
Copyright (c) 2002 Robert Rainwater
|
||||
Portions Copyright (c) 2002 Justin Frankel and Fritz Elfert
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
*/
|
||||
#ifndef MAKENSIS_H
|
||||
#define MAKENSIS_H
|
||||
|
||||
#include <commctrl.h>
|
||||
|
||||
#define _RICHEDIT_VER 0x0200
|
||||
#include <RichEdit.h>
|
||||
#undef _RICHEDIT_VER
|
||||
|
||||
// Defines
|
||||
#define NSIS_URL "http://www.nullsoft.com/free/nsis/"
|
||||
#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://firehose.net/free/nsis/makensis.htm"
|
||||
#define REGSEC HKEY_LOCAL_MACHINE
|
||||
#define REGKEY "Software\\NSIS"
|
||||
#define REGLOC "MakeNSISWPlacement"
|
||||
#define MAX_STRING 256
|
||||
#define TIMEOUT 200
|
||||
#define MINWIDTH 350
|
||||
#define MINHEIGHT 180
|
||||
|
||||
#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];
|
||||
|
||||
// makensisw
|
||||
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, char *cmdParam, int cmdShow);
|
||||
static BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
DWORD WINAPI MakeNSISProc(LPVOID p);
|
||||
BOOL CALLBACK DialogResize(HWND hWnd, LPARAM /* unused*/);
|
||||
BOOL CALLBACK AboutProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
void CompileNSISScript();
|
||||
|
||||
// utils
|
||||
void SetTitle(HWND hwnd,char *substr);
|
||||
void SetBranding(HWND hwnd);
|
||||
void CopyToClipboard(HWND hwnd);
|
||||
void ClearLog(HWND hwnd);
|
||||
void LogMessage(HWND hwnd,const char *str);
|
||||
void ErrorMessage(HWND hwnd,const char *str);
|
||||
void DisableItems(HWND hwnd);
|
||||
void EnableItems(HWND hwnd);
|
||||
void RestoreWindowPos(HWND hwnd);
|
||||
void SaveWindowPos(HWND hwnd);
|
||||
#endif
|
10
Contrib/Makensisw/makensisw.xml
Normal file
10
Contrib/Makensisw/makensisw.xml
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="Nullsoft.NSIS.makensisw" type="win32"/>
|
||||
<description>MakeNSIS Wrapper</description>
|
||||
<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" />
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
</assembly>
|
52
Contrib/Makensisw/noclib.cpp
Normal file
52
Contrib/Makensisw/noclib.cpp
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
Copyright (c) 2002 Robert Rainwater
|
||||
Portions Copyright (c) 2002 Justin Frankel and Fritz Elfert
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
*/
|
||||
/*
|
||||
Contribution by kickik
|
||||
*/
|
||||
#include <windows.h>
|
||||
#include "noclib.h"
|
||||
|
||||
char *my_strrchr(const char *string, int c) {
|
||||
for (int i = lstrlen(string); i >= 0; i--)
|
||||
if (string[i] == c)
|
||||
return (char*)&string[i];
|
||||
return 0;
|
||||
}
|
||||
|
||||
void *my_memset(void *dest, int c, size_t count) {
|
||||
for (size_t i = 0; i < count; i++) ((char*)dest)[i]=c;
|
||||
return dest;
|
||||
}
|
||||
|
||||
char *my_strstr(const char *string, const char *strCharSet) {
|
||||
if (!*strCharSet) return (char*)string;
|
||||
size_t chklen=lstrlen(string)-lstrlen(strCharSet);
|
||||
char *s1, *s2;
|
||||
for (size_t i = 0; i < chklen; i++) {
|
||||
s1=&((char*)string)[i];
|
||||
s2=(char*)strCharSet;
|
||||
while (*s1++ == *s2++)
|
||||
if (!*s2)
|
||||
return &((char*)string)[i];
|
||||
}
|
||||
return 0;
|
||||
}
|
32
Contrib/Makensisw/noclib.h
Normal file
32
Contrib/Makensisw/noclib.h
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
Copyright (c) 2002 Robert Rainwater
|
||||
Portions Copyright (c) 2002 Justin Frankel and Fritz Elfert
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
*/
|
||||
/*
|
||||
Contribution by kickik
|
||||
*/
|
||||
#ifndef NOCLIB_H
|
||||
#define NOCLIB_H
|
||||
|
||||
char *my_strrchr(const char *string, int c);
|
||||
void *my_memset(void *dest, int c, size_t count);
|
||||
char *my_strstr(const char *string, const char *strCharSet);
|
||||
|
||||
#endif
|
38
Contrib/Makensisw/resource.h
Normal file
38
Contrib/Makensisw/resource.h
Normal file
|
@ -0,0 +1,38 @@
|
|||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by resource.rc
|
||||
//
|
||||
#define DLG_MAIN 101
|
||||
#define IDI_ICON 102
|
||||
#define DLG_ABOUT 103
|
||||
#define IDM_MENU 104
|
||||
#define IDK_ACCEL 105
|
||||
#define IDR_DEFAULT1 108
|
||||
#define IDC_LOGWIN 402
|
||||
#define IDC_VERSION 405
|
||||
#define IDC_CLOSE 406
|
||||
#define IDM_ABOUT 501
|
||||
#define IDM_EXIT 502
|
||||
#define IDM_SAVE 503
|
||||
#define IDM_COPY 504
|
||||
#define IDM_COPYSELECTED 505
|
||||
#define IDM_RECOMPILE 506
|
||||
#define IDM_NSISHOME 507
|
||||
#define IDC_TEST 1000
|
||||
#define IDC_ABOUTVERSION 1001
|
||||
#define IDC_ABOUTCOPY 1003
|
||||
#define IDC_ABOUTPORTIONS 1005
|
||||
#define IDM_TEST 40002
|
||||
#define IDM_EDITSCRIPT 40003
|
||||
#define IDM_DOCS 40004
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 109
|
||||
#define _APS_NEXT_COMMAND_VALUE 40005
|
||||
#define _APS_NEXT_CONTROL_VALUE 1009
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
179
Contrib/Makensisw/resource.rc
Normal file
179
Contrib/Makensisw/resource.rc
Normal file
|
@ -0,0 +1,179 @@
|
|||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_ICON ICON DISCARDABLE "..\\..\\source\\icon.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
IDM_MENU MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "&File"
|
||||
BEGIN
|
||||
MENUITEM "&Recompile\tCtrl+R", IDM_RECOMPILE
|
||||
MENUITEM "&Test\tCtrl+T", IDM_TEST
|
||||
MENUITEM "&Save Output...", IDM_SAVE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "E&xit\tCtrl+X", IDM_EXIT
|
||||
END
|
||||
POPUP "&Edit"
|
||||
BEGIN
|
||||
MENUITEM "Edit Script\tCtrl+E", IDM_EDITSCRIPT
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "Copy &All", IDM_COPY
|
||||
MENUITEM "Copy &Selected", IDM_COPYSELECTED
|
||||
END
|
||||
POPUP "&Help"
|
||||
BEGIN
|
||||
MENUITEM "NSIS Home", IDM_NSISHOME
|
||||
MENUITEM "Documentation", IDM_DOCS
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&About", IDM_ABOUT
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Accelerator
|
||||
//
|
||||
|
||||
IDK_ACCEL ACCELERATORS PRELOAD MOVEABLE PURE
|
||||
BEGIN
|
||||
"E", IDM_EDITSCRIPT, VIRTKEY, CONTROL, NOINVERT
|
||||
"R", IDM_RECOMPILE, VIRTKEY, CONTROL, NOINVERT
|
||||
"T", IDM_TEST, VIRTKEY, CONTROL, NOINVERT
|
||||
"X", IDM_EXIT, VIRTKEY, CONTROL, NOINVERT
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
DLG_MAIN DIALOG DISCARDABLE 0, 0, 361, 228
|
||||
STYLE DS_3DLOOK | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP |
|
||||
WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
|
||||
CAPTION "MakeNSIS"
|
||||
MENU IDM_MENU
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
CONTROL "",IDC_LOGWIN,"RICHEDIT",ES_MULTILINE | ES_AUTOVSCROLL |
|
||||
ES_READONLY | WS_BORDER | WS_VSCROLL,7,4,345,186
|
||||
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,202,346,1
|
||||
LTEXT "",IDC_VERSION,7,212,200,12,WS_DISABLED
|
||||
DEFPUSHBUTTON "Clo&se",IDC_CLOSE,303,209,49,14
|
||||
PUSHBUTTON "&Test",IDC_TEST,247,209,50,14,WS_DISABLED
|
||||
END
|
||||
|
||||
DLG_ABOUT DIALOG DISCARDABLE 0, 0, 235, 86
|
||||
STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CAPTION "About MakeNSISW"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
ICON IDI_ICON,IDC_STATIC,7,4,20,20
|
||||
DEFPUSHBUTTON "Clo&se",IDOK,185,64,43,15
|
||||
LTEXT "MakeNSISW",IDC_ABOUTVERSION,44,4,184,8
|
||||
LTEXT "Copyright",IDC_ABOUTCOPY,44,18,184,8
|
||||
CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,45,55,183,1
|
||||
LTEXT "Portions Copyright",IDC_ABOUTPORTIONS,44,30,184,20
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
DLG_ABOUT, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 228
|
||||
TOPMARGIN, 4
|
||||
BOTTOMMARGIN, 79
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 24
|
||||
//
|
||||
|
||||
1 24 MOVEABLE PURE "makensisw.xml"
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
185
Contrib/Makensisw/utils.cpp
Normal file
185
Contrib/Makensisw/utils.cpp
Normal file
|
@ -0,0 +1,185 @@
|
|||
/*
|
||||
Copyright (c) 2002 Robert Rainwater
|
||||
Portions Copyright (c) 2002 Justin Frankel and Fritz Elfert
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
*/
|
||||
#include <windows.h>
|
||||
#include "resource.h"
|
||||
#include "makensisw.h"
|
||||
#include "noclib.h"
|
||||
|
||||
void SetTitle(HWND hwnd,char *substr) {
|
||||
char title[64];
|
||||
if (substr==NULL) wsprintf(title,"MakeNSISW");
|
||||
else wsprintf(title,"MakeNSISW - %s",substr);
|
||||
SetWindowText(hwnd,title);
|
||||
}
|
||||
|
||||
void SetBranding(HWND hwnd) {
|
||||
char title[64];
|
||||
wsprintf(title,"MakeNSISW %s",NSISW_VERSION);
|
||||
SetDlgItemText(hwnd, IDC_VERSION, title);
|
||||
}
|
||||
|
||||
void CopyToClipboard(HWND hwnd) {
|
||||
int len=SendDlgItemMessage(hwnd,IDC_LOGWIN,WM_GETTEXTLENGTH,0,0);
|
||||
char *existing_text=(char*)GlobalAlloc(GPTR,len);
|
||||
if (!hwnd||!OpenClipboard(hwnd)||!existing_text) return;
|
||||
EmptyClipboard();
|
||||
existing_text[0]=0;
|
||||
GetDlgItemText(hwnd, IDC_LOGWIN, existing_text, len);
|
||||
SetClipboardData(CF_TEXT,existing_text);
|
||||
CloseClipboard();
|
||||
}
|
||||
|
||||
|
||||
void ClearLog(HWND hwnd) {
|
||||
SetDlgItemText(hwnd, IDC_LOGWIN, "");
|
||||
}
|
||||
|
||||
char g_output_exe[1024];
|
||||
char g_input_script[1024];
|
||||
BOOL g_input_found;
|
||||
void LogMessage(HWND hwnd,const char *str) {
|
||||
if (!str || !*str) return;
|
||||
int len=SendDlgItemMessage(hwnd,IDC_LOGWIN,WM_GETTEXTLENGTH,0,0);
|
||||
char *existing_text=(char*)GlobalAlloc(GPTR,len+lstrlen(str)+3);//3=\r\n\0
|
||||
if (!existing_text) return;
|
||||
existing_text[0]=0;
|
||||
GETTEXTEX gt={0};
|
||||
gt.cb = len;
|
||||
gt.codepage = CP_ACP;
|
||||
gt.flags = GT_DEFAULT;
|
||||
SendDlgItemMessage(hwnd,IDC_LOGWIN,EM_GETTEXTEX,(WPARAM)>,(LPARAM)existing_text);
|
||||
lstrcat(existing_text,str);
|
||||
if (!g_input_found) {
|
||||
char *p1=my_strstr(existing_text,"\r\nProcessing script file: \"");
|
||||
if (p1) {
|
||||
while (*p1++ != '"');
|
||||
char *p2=my_strstr(p1,"\r\n");
|
||||
lstrcpyn(g_input_script,p1,p2-p1);
|
||||
g_input_found=TRUE;
|
||||
}
|
||||
}
|
||||
SetDlgItemText(hwnd, IDC_LOGWIN, existing_text);
|
||||
SendDlgItemMessage(hwnd, IDC_LOGWIN,EM_SETSEL,lstrlen(existing_text),lstrlen(existing_text));
|
||||
SendDlgItemMessage(hwnd, IDC_LOGWIN,EM_SCROLLCARET,0,0);
|
||||
GlobalFree(existing_text);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ErrorMessage(HWND hwnd,const char *str) {
|
||||
if (!str) return;
|
||||
char buf[1028];
|
||||
wsprintf(buf,"Error - %s\r\n",str);
|
||||
LogMessage(hwnd,buf);
|
||||
}
|
||||
|
||||
void DisableItems(HWND hwnd) {
|
||||
g_output_exe[0]=0;
|
||||
g_input_script[0]=0;
|
||||
g_input_found=FALSE;
|
||||
EnableWindow(GetDlgItem(hwnd,IDC_CLOSE),0);
|
||||
EnableWindow(GetDlgItem(hwnd,IDC_TEST),0);
|
||||
HMENU m = GetMenu(hwnd);
|
||||
EnableMenuItem(m,IDM_SAVE,MF_GRAYED);
|
||||
EnableMenuItem(m,IDM_TEST,MF_GRAYED);
|
||||
EnableMenuItem(m,IDM_EXIT,MF_GRAYED);
|
||||
EnableMenuItem(m,IDM_RECOMPILE,MF_GRAYED);
|
||||
EnableMenuItem(m,IDM_COPY,MF_GRAYED);
|
||||
EnableMenuItem(m,IDM_COPYSELECTED,MF_GRAYED);
|
||||
EnableMenuItem(m,IDM_EDITSCRIPT,MF_GRAYED);
|
||||
}
|
||||
|
||||
void EnableItems(HWND hwnd) {
|
||||
int len=SendDlgItemMessage(hwnd,IDC_LOGWIN,WM_GETTEXTLENGTH,0,0);
|
||||
char *existing_text=(char*)GlobalAlloc(GPTR,len);
|
||||
if (!existing_text) return;
|
||||
existing_text[0]=0;
|
||||
GetDlgItemText(hwnd, IDC_LOGWIN, existing_text, len);
|
||||
char *p=existing_text;
|
||||
char *p2;
|
||||
char *p3;
|
||||
if ((p2=my_strstr(p,"\r\nOutput: \""))) {
|
||||
while (*p2 != '\"') p2++;
|
||||
p2++;
|
||||
if ((p3=my_strstr(p2,"\"\r\n")) && p3 < my_strstr(p2,"\r\n")) {
|
||||
*p3=0;
|
||||
lstrcpy(g_output_exe,p2);
|
||||
}
|
||||
}
|
||||
|
||||
HMENU m = GetMenu(hwnd);
|
||||
if (g_output_exe[0]) {
|
||||
EnableWindow(GetDlgItem(hwnd,IDC_TEST),1);
|
||||
EnableMenuItem(m,IDM_TEST,MF_ENABLED);
|
||||
}
|
||||
EnableWindow(GetDlgItem(hwnd,IDC_CLOSE),1);
|
||||
EnableMenuItem(m,IDM_SAVE,MF_ENABLED);
|
||||
EnableMenuItem(m,IDM_EXIT,MF_ENABLED);
|
||||
EnableMenuItem(m,IDM_RECOMPILE,MF_ENABLED);
|
||||
EnableMenuItem(m,IDM_COPY,MF_ENABLED);
|
||||
EnableMenuItem(m,IDM_COPYSELECTED,MF_ENABLED);
|
||||
EnableMenuItem(m,IDM_EDITSCRIPT,MF_ENABLED);
|
||||
}
|
||||
|
||||
void CompileNSISScript() {
|
||||
ClearLog(g_hwnd);
|
||||
SetTitle(g_hwnd,NULL);
|
||||
SetBranding(g_hwnd);
|
||||
if (lstrlen(g_script)==0) {
|
||||
HMENU m = GetMenu(g_hwnd);
|
||||
LogMessage(g_hwnd,USAGE);
|
||||
EnableMenuItem(m,IDM_RECOMPILE,MF_GRAYED);
|
||||
EnableMenuItem(m,IDM_EDITSCRIPT,MF_GRAYED);
|
||||
EnableMenuItem(m,IDM_TEST,MF_GRAYED);
|
||||
EnableWindow(GetDlgItem(g_hwnd,IDC_TEST),0);
|
||||
return;
|
||||
}
|
||||
// Disable buttons during compile
|
||||
DisableItems(g_hwnd);
|
||||
DWORD id;
|
||||
g_hThread=CreateThread(NULL,0,MakeNSISProc,0,0,&id);
|
||||
}
|
||||
|
||||
void RestoreWindowPos(HWND hwnd) {
|
||||
HKEY hKey;
|
||||
WINDOWPLACEMENT p;
|
||||
if (RegOpenKeyEx(REGSEC,REGKEY,0,KEY_READ,&hKey) == ERROR_SUCCESS) {
|
||||
DWORD l = sizeof(p);
|
||||
DWORD t;
|
||||
if ((RegQueryValueEx(hKey,REGLOC,NULL,&t,(unsigned char*)&p,&l)==ERROR_SUCCESS)&&(t == REG_BINARY)&&(l==sizeof(p))) {
|
||||
p.length = sizeof(p);
|
||||
SetWindowPlacement(hwnd, &p);
|
||||
}
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
}
|
||||
|
||||
void SaveWindowPos(HWND hwnd) {
|
||||
HKEY hKey;
|
||||
WINDOWPLACEMENT p;
|
||||
p.length = sizeof(p);
|
||||
GetWindowPlacement(hwnd, &p);
|
||||
if (RegCreateKey(REGSEC,REGKEY,&hKey) == ERROR_SUCCESS) {
|
||||
RegSetValueEx(hKey,REGLOC,0,REG_BINARY,(unsigned char*)&p,sizeof(p));
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
}
|
46
Contrib/Makensisw/utils.h
Normal file
46
Contrib/Makensisw/utils.h
Normal file
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
Copyright (c) 2002 Robert Rainwater
|
||||
Portions Copyright (c) 2002 Justin Frankel and Fritz Elfert
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
*/
|
||||
#ifndef UTILS_H
|
||||
#define UTILS_H
|
||||
|
||||
#define REGSEC HKEY_LOCAL_MACHINE // JF> modified this to HKLM so that
|
||||
// nsis uninstaller would remove. this means
|
||||
// window placement is shared across users, but
|
||||
// bfd.
|
||||
#define REGKEY "Software\\NSIS"
|
||||
#define REGLOC "MakeNSISWPlacement"
|
||||
|
||||
extern const char *NSISW_VERSION;
|
||||
|
||||
// Methods
|
||||
void SetTitle(HWND hwnd,char *substr);
|
||||
void SetBranding(HWND hwnd);
|
||||
void CopyToClipboard(HWND hwnd);
|
||||
void ClearLog(HWND hwnd);
|
||||
void LogMessage(HWND hwnd,const char *str);
|
||||
void ErrorMessage(HWND hwnd,const char *str);
|
||||
void DisableItems(HWND hwnd);
|
||||
void EnableItems(HWND hwnd);
|
||||
void RestoreWindowPos(HWND hwnd);
|
||||
void SaveWindowPos(HWND hwnd);
|
||||
|
||||
#endif
|
30
Contrib/Makensisw/version.cpp
Normal file
30
Contrib/Makensisw/version.cpp
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
Copyright (c) 2002 Robert Rainwater
|
||||
Portions Copyright (c) 2002 Justin Frankel and Fritz Elfert
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
*/
|
||||
// Turns a define into a string
|
||||
#define REALSTR(x) #x
|
||||
#define STR(x) REALSTR(x)
|
||||
|
||||
#ifdef RELEASE
|
||||
const char *NSISW_VERSION = STR(RELEASE);
|
||||
#else
|
||||
const char *NSISW_VERSION = "Local Build: " __DATE__;
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue