- SetCompressor: added /FINAL switch
- SetOverwrite: added lastusd option - Greek MUI translation v1.66 git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2835 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
5fb8fd227b
commit
9e5ccb9a32
8 changed files with 67 additions and 34 deletions
|
@ -243,6 +243,7 @@ CEXEBuild::CEXEBuild()
|
|||
compressor = &zlib_compressor;
|
||||
#endif
|
||||
build_compressor_set = false;
|
||||
build_compressor_final = false;
|
||||
#ifdef NSIS_ZLIB_COMPRESS_WHOLE
|
||||
build_compress_whole = true;
|
||||
#else
|
||||
|
@ -276,7 +277,7 @@ CEXEBuild::CEXEBuild()
|
|||
version_product_v[0]=0;
|
||||
#endif
|
||||
|
||||
build_overwrite=0;
|
||||
build_overwrite=build_last_overwrite=0;
|
||||
build_compress=1;
|
||||
build_crcchk=1;
|
||||
build_datesave=1;
|
||||
|
|
|
@ -263,6 +263,7 @@ class CEXEBuild {
|
|||
CBzip2 bzip2_compressor;
|
||||
#endif
|
||||
bool build_compressor_set;
|
||||
bool build_compressor_final;
|
||||
bool build_compress_whole;
|
||||
|
||||
bool no_space_texts;
|
||||
|
@ -270,9 +271,9 @@ class CEXEBuild {
|
|||
int has_called_write_output;
|
||||
|
||||
char build_packname[1024], build_packcmd[1024];
|
||||
int build_overwrite, build_compress, build_crcchk,
|
||||
build_datesave, build_optimize_datablock,
|
||||
build_allowskipfiles; // Added by ramon 23 May 2003
|
||||
int build_overwrite, build_last_overwrite, build_compress,
|
||||
build_crcchk, build_datesave, build_optimize_datablock,
|
||||
build_allowskipfiles; // Added by ramon 23 May 2003
|
||||
|
||||
header build_header, build_uninst, *cur_header;
|
||||
int uninstall_mode;
|
||||
|
|
|
@ -2254,12 +2254,25 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
// Ability to change compression methods from within the script
|
||||
case TOK_SETCOMPRESSOR:
|
||||
#ifdef NSIS_CONFIG_COMPRESSION_SUPPORT
|
||||
{
|
||||
if (build_compressor_set) {
|
||||
ERROR_MSG("Error: can't change compressor after data already got compressed or header already changed!\n");
|
||||
return PS_ERROR;
|
||||
}
|
||||
if (!build_compressor_final)
|
||||
{
|
||||
if (build_compressor_set) {
|
||||
ERROR_MSG("Error: can't change compressor after data already got compressed or header already changed!\n");
|
||||
return PS_ERROR;
|
||||
int a = 1;
|
||||
if (!strcmpi(line.gettoken_str(1),"/FINAL"))
|
||||
{
|
||||
build_compressor_final = true;
|
||||
a++;
|
||||
}
|
||||
int k=line.gettoken_enum(1,"zlib\0bzip2\0");
|
||||
else if (line.getnumtokens() == 3)
|
||||
{
|
||||
ERROR_MSG("%s expects 2 parameters, got 3.\n",line.gettoken_str(0));
|
||||
PRINTHELP();
|
||||
}
|
||||
int k=line.gettoken_enum(a,"zlib\0bzip2\0");
|
||||
switch (k) {
|
||||
case 0: // JF> should handle the state of going from bzip2 back to zlib:
|
||||
compressor = &zlib_compressor;
|
||||
|
@ -2275,11 +2288,11 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
}
|
||||
|
||||
memcpy(header_data_new,zlib_header_data,zlib_exeheader_size);
|
||||
#ifdef NSIS_ZLIB_COMPRESS_WHOLE
|
||||
#ifdef NSIS_ZLIB_COMPRESS_WHOLE
|
||||
build_compress_whole=true;
|
||||
#else
|
||||
#else
|
||||
build_compress_whole=false;
|
||||
#endif
|
||||
#endif
|
||||
break;
|
||||
case 1:
|
||||
compressor=&bzip2_compressor;
|
||||
|
@ -2295,17 +2308,22 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
}
|
||||
|
||||
memcpy(header_data_new,bzip2_header_data,bzip2_exeheader_size);
|
||||
#ifdef NSIS_BZIP2_COMPRESS_WHOLE
|
||||
#ifdef NSIS_BZIP2_COMPRESS_WHOLE
|
||||
build_compress_whole=true;
|
||||
#else
|
||||
#else
|
||||
build_compress_whole=false;
|
||||
#endif
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
PRINTHELP();
|
||||
}
|
||||
SCRIPT_MSG("SetCompressor: %s\n", line.gettoken_str(1));
|
||||
SCRIPT_MSG("SetCompressor: %s%s\n", build_compressor_final? "/FINAL " : "", line.gettoken_str(a));
|
||||
}
|
||||
else
|
||||
{
|
||||
warning_fl("SetCompressor ignored due to previous call with the /FINAL switch");
|
||||
}
|
||||
}
|
||||
return make_sure_not_in_secorfunc(line.gettoken_str(0));
|
||||
#else//NSIS_CONFIG_COMPRESSION_SUPPORT
|
||||
ERROR_MSG("Error: %s specified, NSIS_CONFIG_COMPRESSION_SUPPORT not defined.\n", line.gettoken_str(0));
|
||||
|
@ -2764,9 +2782,23 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
SCRIPT_MSG("SetDateSave: %s\n",line.gettoken_str(1));
|
||||
return PS_OK;
|
||||
case TOK_SETOVERWRITE:
|
||||
build_overwrite=line.gettoken_enum(1,"on\0off\0try\0ifnewer\0");
|
||||
if (build_overwrite==-1) PRINTHELP()
|
||||
{
|
||||
int k=line.gettoken_enum(1,"on\0off\0try\0ifnewer\0lastused\0");
|
||||
if (k==-1) PRINTHELP()
|
||||
if (k==4)
|
||||
{
|
||||
k=build_overwrite;
|
||||
build_overwrite=build_last_overwrite;
|
||||
build_last_overwrite=k;
|
||||
}
|
||||
else
|
||||
{
|
||||
build_last_overwrite=build_overwrite;
|
||||
build_overwrite=k;
|
||||
}
|
||||
SCRIPT_MSG("overwrite = %d, last_overwrite = %d\n", build_overwrite, build_last_overwrite);
|
||||
SCRIPT_MSG("SetOverwrite: %s\n",line.gettoken_str(1));
|
||||
}
|
||||
return PS_OK;
|
||||
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
|
||||
case TOK_SETPLUGINUNLOAD:
|
||||
|
|
|
@ -155,7 +155,7 @@ static tokenType tokenlist[TOK__LAST] =
|
|||
{TOK_SETCTLCOLORS,"SetCtlColors",2,1,"hwnd (branding | (text_color (transparent|bg_color)))"},
|
||||
{TOK_SETBRANDINGIMAGE,"SetBrandingImage",1,2,"[/IMGID=image_item_id_in_dialog] [/RESIZETOFIT] bitmap.bmp"},
|
||||
{TOK_SETCOMPRESS,"SetCompress",1,0,"(off|auto|force)"},
|
||||
{TOK_SETCOMPRESSOR,"SetCompressor",1,0,"(zlib|bzip2)"},
|
||||
{TOK_SETCOMPRESSOR,"SetCompressor",1,1,"[/FINAL] (zlib|bzip2)"},
|
||||
{TOK_SETDATESAVE,"SetDateSave",1,0,"(off|on)"},
|
||||
{TOK_SETDETAILSVIEW,"SetDetailsView",1,0,"(hide|show)"},
|
||||
{TOK_SETDETAILSPRINT,"SetDetailsPrint",1,0,"(none|listonly|textonly|both)"},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue