diff --git a/Docs/src/history.but b/Docs/src/history.but index 29c12458..1c177ee3 100644 --- a/Docs/src/history.but +++ b/Docs/src/history.but @@ -36,6 +36,8 @@ \b WriteINIStr with empty value works again +\b Added FlushINI + \e{v2.0b2} \b NSIS Menu: links to all NSIS utitlies, documentation and websites diff --git a/Docs/src/registry.but b/Docs/src/registry.but index 781e85db..1b2d6d00 100644 --- a/Docs/src/registry.but +++ b/Docs/src/registry.but @@ -42,6 +42,12 @@ Set user variable $x with the name of the 'index'th registry value in root_key\\ Expands environment variables in "string" into the user variable $x. If error, the variable is set to empty, and the error flag is set. +\S2{flushini} FlushINI + +\c ini_filename + +Flushes the INI file's buffers. Windows 9x keeps all changes to the INI file in memory. This command causes the changes to be written to the disk immediately. Use it if you edit the INI manually, delete it, move it or copy it right after you change it with \R{writeinistr}{WriteINIStr}, \R{deleteinisec}{DeleteINISec} or \R{deleteinistr}{DeleteINStr}. + \S2{readenvstr} ReadEnvStr \c user_var(output) name diff --git a/Source/script.cpp b/Source/script.cpp index e71f4848..056bc97f 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -3265,6 +3265,11 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char line.gettoken_str(2),vname,space,line.gettoken_str(1)); } return add_entry(&ent); + case TOK_FLUSHINI: + ent.which=EW_WRITEINI; + ent.offsets[3]=add_string(line.gettoken_str(1)); + SCRIPT_MSG("FlushINI: %s\n",line.gettoken_str(1)); + return add_entry(&ent); case TOK_WRITEINISTR: ent.which=EW_WRITEINI; ent.offsets[0]=add_string(line.gettoken_str(2)); @@ -3287,6 +3292,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char #else//!NSIS_SUPPORT_INIFILES case TOK_DELETEINISEC: case TOK_DELETEINISTR: + case TOK_FLUSHINI: case TOK_WRITEINISTR: case TOK_READINISTR: ERROR_MSG("Error: %s specified, NSIS_SUPPORT_INIFILES not defined.\n", line.gettoken_str(0)); diff --git a/Source/tokens.cpp b/Source/tokens.cpp index 06c59fc2..b8c975a7 100644 --- a/Source/tokens.cpp +++ b/Source/tokens.cpp @@ -62,6 +62,7 @@ static tokenType tokenlist[TOK__LAST] = {TOK_FINDFIRST,"FindFirst",3,0,"$(user_var: handle output) $(user_var: filename output) filespec"}, {TOK_FINDNEXT,"FindNext",2,0,"$(user_var: handle input) $(user_var: filename output)"}, {TOK_FILE,"File",1,-1,"[/nonfatal] [/a] ([/r] filespec [...]|/oname=outfile one_file_only)"}, +{TOK_FLUSHINI,"FlushINI",1,0,"ini_file"}, {TOK_RESERVEFILE,"ReserveFile",1,-1,"[/nonfatal] [/r] file [file...]"}, {TOK_FILECLOSE,"FileClose",1,0,"$(user_var: handle input)"}, {TOK_FILEERRORTEXT,"FileErrorText",0,2,"[/LANG=lang_id] [text (can contain $0)]"}, diff --git a/Source/tokens.h b/Source/tokens.h index 890a3cdd..ba977049 100644 --- a/Source/tokens.h +++ b/Source/tokens.h @@ -122,6 +122,7 @@ enum TOK_WRITEREGDWORD, TOK_DELETEINISEC, TOK_DELETEINISTR, + TOK_FLUSHINI, TOK_WRITEINISTR, TOK_CREATESHORTCUT, TOK_FINDWINDOW,