diff --git a/Source/build.h b/Source/build.h index 0cf660c7..fa320792 100644 --- a/Source/build.h +++ b/Source/build.h @@ -118,6 +118,7 @@ class CEXEBuild { Plugins m_plugins; bool plugin_used; bool uninst_plugin_used; + int build_plugin_unload; #endif //NSIS_CONFIG_PLUGIN_SUPPORT // build.cpp functions used mostly within build.cpp diff --git a/Source/script.cpp b/Source/script.cpp index 26d9a943..583f0685 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -1747,6 +1747,13 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char if (build_overwrite==-1) PRINTHELP() SCRIPT_MSG("SetOverwrite: %s\n",line.gettoken_str(1)); return PS_OK; +#ifdef NSIS_CONFIG_PLUGIN_SUPPORT + case TOK_SETPLUGINUNLOAD: + build_plugin_unload=line.gettoken_enum(1,"manual\0alwaysoff\0"); + if (build_plugin_unload==-1) PRINTHELP() + SCRIPT_MSG("SetPluginUnload: %s\n",line.gettoken_str(1)); + return PS_OK; +#endif //NSIS_CONFIG_PLUGIN_SUPPORT case TOK_SETCOMPRESS: build_compress=line.gettoken_enum(1,"off\0auto\0force\0"); if (build_compress==-1) PRINTHELP() @@ -3593,7 +3600,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char ent.offsets[0]=add_string(tempDLL);; ent.offsets[1]=add_string(command); ent.offsets[2]=0; - ent.offsets[3]=nounload; + ent.offsets[3]=nounload|build_plugin_unload; ret=add_entry(&ent); if (ret != PS_OK) return ret; diff --git a/Source/tokens.cpp b/Source/tokens.cpp index 3ae6a71b..7e682c24 100644 --- a/Source/tokens.cpp +++ b/Source/tokens.cpp @@ -139,6 +139,7 @@ static tokenType tokenlist[TOK__LAST] = {TOK_SETFONT,"SetFont",2,0,"font_face_name font_size"}, {TOK_SETOUTPATH,"SetOutPath",1,0,"output_path"}, {TOK_SETOVERWRITE,"SetOverwrite",1,0,"(on|off|try|ifnewer)"}, +{TOK_SETPLUGINUNLOAD,"SetPluginUnload",1,0,"(manual|alwaysoff)"}, {TOK_SETREBOOTFLAG,"SetRebootFlag",1,0,"true|false"}, {TOK_SETSHELLVARCONTEXT,"SetShellVarContext",1,0,"all|current"}, {TOK_SETSTATICBKCOLOR,"SetStaticBkColor",2,0,"hwnd color"}, diff --git a/Source/tokens.h b/Source/tokens.h index c4189734..04ab2890 100644 --- a/Source/tokens.h +++ b/Source/tokens.h @@ -89,6 +89,7 @@ enum // flag setters TOK_SETDATESAVE, TOK_SETOVERWRITE, + TOK_SETPLUGINUNLOAD, TOK_SETCOMPRESS, TOK_DBOPTIMIZE,