applied patch #1334155 - zip2exe: checkbox for solid compression

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4336 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2005-10-21 13:53:27 +00:00
parent d6145f7e0f
commit a9c8f27cb3
4 changed files with 33 additions and 17 deletions

View file

@ -5,12 +5,19 @@ OutFile "${ZIP2EXE_OUTFILE}"
AllowRootDirInstall true
!ifdef ZIP2EXE_COMPRESSOR_SOLID
!define SETCOMPRESSOR_SWITCH /SOLID
!else
!define SETCOMPRESSOR_SWITCH
!endif
!ifdef ZIP2EXE_COMPRESSOR_ZLIB
SetCompressor zlib
SetCompressor ${SETCOMPRESSOR_SWITCH} zlib
!else ifdef ZIP2EXE_COMPRESSOR_BZIP2
SetCompressor bzip2
SetCompressor ${SETCOMPRESSOR_SWITCH} bzip2
!else ifdef ZIP2EXE_COMPRESSOR_LZMA
SetCompressor lzma
SetCompressor ${SETCOMPRESSOR_SWITCH} lzma
!endif
!ifdef ZIP2EXE_INSTALLDIR

View file

@ -37,6 +37,7 @@ HANDLE g_hThread;
char g_cmdline[1024];
int g_extracting;
int g_compressor;
int g_compressor_solid;
int g_mui;
int g_zipfile_size;
@ -463,6 +464,8 @@ void makeEXE(HWND hwndDlg)
fprintf(fp,"!define ZIP2EXE_COMPRESSOR_BZIP2\n");
if (g_compressor == 3)
fprintf(fp,"!define ZIP2EXE_COMPRESSOR_LZMA\n");
if (g_compressor_solid == 1)
fprintf(fp,"!define ZIP2EXE_COMPRESSOR_SOLID\n");
GetDlgItemText(hwndDlg,IDC_INSTPATH,buf,sizeof(buf));
char *outpath = "$INSTDIR";
int iswinamp=0;
@ -557,7 +560,7 @@ void makeEXE(HWND hwndDlg)
BOOL CALLBACK DlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
static int ids[]={IDC_INFO,IDC_NSISICON,IDC_SZIPFRAME,IDC_BROWSE,IDC_ZIPFILE,IDC_ZIPINFO_SUMMARY,IDC_ZIPINFO_FILES,IDC_OFRAME,IDC_INAMEST,
IDC_INSTNAME,IDC_INSTPATH,IDC_OEFST,IDC_OUTFILE,IDC_BROWSE2,IDC_COMPRESSOR,IDC_ZLIB,IDC_BZIP2,IDC_LZMA,IDC_INTERFACE,IDC_MODERNUI,IDC_CLASSICUI};
IDC_INSTNAME,IDC_INSTPATH,IDC_OEFST,IDC_OUTFILE,IDC_BROWSE2,IDC_COMPRESSOR,IDC_ZLIB,IDC_BZIP2,IDC_LZMA,IDC_SOLID,IDC_INTERFACE,IDC_MODERNUI,IDC_CLASSICUI};
static HICON hIcon;
static HFONT hFont;
if (uMsg == WM_DESTROY) { if (hIcon) DeleteObject(hIcon); hIcon=0; if (hFont) DeleteObject(hFont); hFont=0; }
@ -709,6 +712,10 @@ BOOL CALLBACK DlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
g_compressor = 2;
if (IsDlgButtonChecked(hwndDlg,IDC_LZMA))
g_compressor = 3;
if (IsDlgButtonChecked(hwndDlg,IDC_SOLID))
g_compressor_solid = 1;
else
g_compressor_solid = 0;
g_mui=!IsDlgButtonChecked(hwndDlg,IDC_CLASSICUI);
SetDlgItemText(g_hwnd, IDC_OUTPUTTEXT, "");
int x;

View file

@ -62,6 +62,8 @@ BEGIN
10
CONTROL "ZLib",IDC_ZLIB,"Button",BS_AUTORADIOBUTTON,186,228,30,
10
CONTROL "Solid",IDC_SOLID,"Button",BS_AUTOCHECKBOX,240,228,30,
10
DEFPUSHBUTTON "&Generate",IDOK,306,252,48,14,WS_DISABLED
PUSHBUTTON "&Test",IDC_TEST,246,252,49,14,NOT WS_VISIBLE
PUSHBUTTON "< &Back",IDC_BACK,6,252,48,14,NOT WS_VISIBLE

View file

@ -30,8 +30,8 @@
#define IDC_CLASSICUI 1025
#define IDC_INFO 1026
#define IDC_NSISICON 1027
#define IDC_BZIP3 1028
#define IDC_LZMA 1028
#define IDC_SOLID 1029
// Next default values for new objects
//
@ -39,7 +39,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 103
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1028
#define _APS_NEXT_CONTROL_VALUE 1030
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif