Added IfRtlLanguage and GetRegView
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7153 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
5887d6c60d
commit
1f355d992c
8 changed files with 45 additions and 19 deletions
|
@ -167,6 +167,16 @@ Checks the silent flag, and jumps to jump_if_silent if the installer is silent,
|
|||
|
||||
Checks if \R{setshellvarcontext}{SetShellVarContext} is set to \e{all}.
|
||||
|
||||
\S2{ifrtllanguage} IfRtlLanguage
|
||||
|
||||
\c jump_if_true [jump_if_false]
|
||||
|
||||
Checks if active language is a RTL language.
|
||||
|
||||
\NsisWarnBlockContainerBegin
|
||||
\\<b\\>Warning:\\</b\\> Do not call this in [un].onInit because the language file has not been fully initialized.
|
||||
\NsisWarnBlockContainerEnd
|
||||
|
||||
\S2{intcmp} IntCmp
|
||||
|
||||
\c val1 val2 jump_if_equal [jump_if_val1_less] [jump_if_val1_more]
|
||||
|
|
|
@ -14,9 +14,9 @@ Released on ? ?th, 2020
|
|||
|
||||
\S2{} Minor Changes
|
||||
|
||||
\b Added \R{ifshellvarcontextall} IfShellVarContextAll}
|
||||
\b Added \R{ifshellvarcontextall}{IfShellVarContextAll} and \R{ifrtllanguage}{IfRtlLanguage}
|
||||
|
||||
\# Undocumented: \b Added GetShellVarContext | Documenting this would require documenting the all/current to number mapping
|
||||
\# Undocumented: \b Added GetShellVarContext, IfAltRegView and GetRegView | Documenting these would require documenting the parameter name to number mapping
|
||||
|
||||
\H{v3.05} 3.05
|
||||
|
||||
|
|
|
@ -221,11 +221,4 @@ Does not affect \R{ainstalldirregkey}{InstallDirRegKey}. Instead, the registry m
|
|||
\c ReadRegStr $0 HKLM Software\Microsoft\Windows\CurrentVersion ProgramFilesDir
|
||||
\c DetailPrint $0 # prints C:\Program Files
|
||||
\c ${EndIf}
|
||||
|
||||
\c Function .onInit
|
||||
\c ${If} ${RunningX64}
|
||||
\c SetRegView 64
|
||||
\c ReadRegStr $INSTDIR HKLM Software\NSIS ""
|
||||
\c SetRegView Default
|
||||
\c ${EndIf}
|
||||
\c FunctionEnd
|
||||
\c SetRegView Default
|
||||
|
|
|
@ -57,7 +57,8 @@
|
|||
; size_t integer tests
|
||||
; a Z= b; a Z<> b; a Z< b; a Z>= b; a Z> b; a Z<= b
|
||||
; Built-in NSIS flag tests:
|
||||
; ${Abort}; ${Errors}; ${RebootFlag}; ${Silent}
|
||||
; ${Abort}; ${Errors}; ${RebootFlag}; ${Silent}; ${RtlLanguage};
|
||||
; ${ShellVarContextAll}
|
||||
; Built-in NSIS other tests:
|
||||
; ${FileExists} a
|
||||
; Any conditional NSIS instruction test:
|
||||
|
@ -340,6 +341,16 @@
|
|||
!macroend
|
||||
!define ShellVarContextAll `"" ShellVarContextAll ""`
|
||||
|
||||
!macro _RtlLanguage _a _b _t _f
|
||||
IfRtlLanguage `${_t}` `${_f}`
|
||||
!macroend
|
||||
!define RtlLanguage `"" RtlLanguage ""`
|
||||
|
||||
!macro _AltRegView _a _b _t _f
|
||||
IfAltRegView `${_t}` `${_f}`
|
||||
!macroend
|
||||
!define AltRegView `"" AltRegView ""`
|
||||
|
||||
; "Any instruction" test
|
||||
!macro _Cmd _a _b _t _f
|
||||
!define _t=${_t}
|
||||
|
|
|
@ -42,15 +42,15 @@ typedef struct
|
|||
{
|
||||
int autoclose; // SetAutoClose
|
||||
int all_user_var; // SetShellVarContext: User context = 0, Machine context = 1
|
||||
int exec_error; // IfErrors
|
||||
int exec_error; // IfErrors/ClearErrors/SetErrors
|
||||
int abort; // IfAbort
|
||||
int exec_reboot; // IfRebootFlag (NSIS_SUPPORT_REBOOT)
|
||||
int exec_reboot; // IfRebootFlag/SetRebootFlag (NSIS_SUPPORT_REBOOT)
|
||||
int reboot_called; // NSIS_SUPPORT_REBOOT
|
||||
int XXX_cur_insttype; // Deprecated
|
||||
int plugin_api_version; // Plug-in ABI. See NSISPIAPIVER_CURR (Note: used to be XXX_insttype_changed)
|
||||
int silent; // IfSilent (NSIS_CONFIG_SILENT_SUPPORT)
|
||||
int silent; // IfSilent/SetSilent (NSIS_CONFIG_SILENT_SUPPORT)
|
||||
int instdir_error; // GetInstDirError
|
||||
int rtl; // 1 if $LANGUAGE is a RTL language
|
||||
int rtl; // IfRtlLanguage: 1 if $LANGUAGE is a RTL language
|
||||
int errlvl; // SetErrorLevel
|
||||
int alter_reg_view; // SetRegView: Default View = 0, Alternative View = (sizeof(void*) > 4 ? KEY_WOW64_32KEY : KEY_WOW64_64KEY)
|
||||
int status_update; // SetDetailsPrint
|
||||
|
|
|
@ -920,18 +920,18 @@ int CEXEBuild::add_flag_instruction_entry(int which_token, int opcode, LineParse
|
|||
case EW_SETFLAG:
|
||||
ent.offsets[0] = offset;
|
||||
ent.offsets[1] = data;
|
||||
SCRIPT_MSG(_T("%") NPRIs _T(": %") NPRIs _T("\n"), get_commandtoken_name(which_token), line.gettoken_str(1));
|
||||
if (display_script) SCRIPT_MSG(_T("%") NPRIs _T(": %") NPRIs _T("\n"), get_commandtoken_name(which_token), line.gettoken_str(1));
|
||||
return add_entry(&ent);
|
||||
case EW_IFFLAG:
|
||||
if (process_jump(line, 1, &ent.offsets[0]) || process_jump(line, 2, &ent.offsets[1])) PRINTHELP()
|
||||
ent.offsets[2]=offset;
|
||||
ent.offsets[3]=data;
|
||||
SCRIPT_MSG(_T("%") NPRIs _T(" ?%") NPRIs _T(":%") NPRIs _T("\n"), get_commandtoken_name(which_token), line.gettoken_str(1), line.gettoken_str(2));
|
||||
if (display_script) SCRIPT_MSG(_T("%") NPRIs _T(" ?%") NPRIs _T(":%") NPRIs _T("\n"), get_commandtoken_name(which_token), line.gettoken_str(1), line.gettoken_str(2));
|
||||
return add_entry(&ent);
|
||||
case EW_GETFLAG:
|
||||
if ((ent.offsets[0] = GetUserVarIndex(line, 1)) < 0) PRINTHELP();
|
||||
ent.offsets[1] = offset;
|
||||
SCRIPT_MSG(_T("%") NPRIs _T(": %") NPRIs _T("\n"), get_commandtoken_name(which_token), line.gettoken_str(1));
|
||||
if (display_script) SCRIPT_MSG(_T("%") NPRIs _T(": %") NPRIs _T("\n"), get_commandtoken_name(which_token), line.gettoken_str(1));
|
||||
return add_entry(&ent);
|
||||
}
|
||||
return PS_ERROR;
|
||||
|
@ -1717,6 +1717,8 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_CONFIG_SILENT_SUPPORT not defined.\n"), line.gettoken_str(0));
|
||||
return PS_ERROR;
|
||||
#endif //~ NSIS_CONFIG_SILENT_SUPPORT
|
||||
case TOK_IFRTLLANG:
|
||||
return add_flag_instruction_entry(which_token, EW_IFFLAG, line, FLAG_OFFSET(rtl), ~0); //new value mask - keep flag
|
||||
case TOK_OUTFILE:
|
||||
my_strncpy(build_output_filename,line.gettoken_str(1),COUNTOF(build_output_filename));
|
||||
SCRIPT_MSG(_T("OutFile: \"%") NPRIs _T("\"\n"),build_output_filename);
|
||||
|
@ -3012,19 +3014,23 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
if (process_jump(line,1,&ent.offsets[0])) PRINTHELP()
|
||||
SCRIPT_MSG(_T("Goto: %") NPRIs _T("\n"),line.gettoken_str(1));
|
||||
return add_entry(&ent);
|
||||
case TOK_GETREGVIEW:
|
||||
return add_flag_instruction_entry(which_token, EW_GETFLAG, line, FLAG_OFFSET(alter_reg_view));
|
||||
case TOK_SETREGVIEW:
|
||||
{
|
||||
ent.which=EW_SETFLAG;
|
||||
ent.offsets[0]=FLAG_OFFSET(alter_reg_view);
|
||||
int k=line.gettoken_enum(1,_T("32\0") _T("64\0default\0lastused\0"));
|
||||
if (k == 0) ent.offsets[1]=add_intstring(is_target_64bit() ? KEY_WOW64_32KEY : 0); // 32
|
||||
else if (k == 1) ent.offsets[1]=add_intstring(KEY_WOW64_64KEY); // 64
|
||||
else if (k == 1) ent.offsets[1]=add_intstring(is_target_64bit() ? 0 : KEY_WOW64_64KEY); // 64
|
||||
else if (k == 2) ent.offsets[1]=add_intstring(0); // default
|
||||
else if (k == 3) ent.offsets[2]=1; // last used
|
||||
else PRINTHELP()
|
||||
SCRIPT_MSG(_T("SetRegView: %") NPRIs _T("\n"),line.gettoken_str(1));
|
||||
}
|
||||
return add_entry(&ent);
|
||||
case TOK_IFALTREGVIEW:
|
||||
return add_flag_instruction_entry(which_token, EW_IFFLAG, line, FLAG_OFFSET(alter_reg_view), ~0); //new value mask - keep flag
|
||||
case TOK_GETSHELLVARCONTEXT:
|
||||
return add_flag_instruction_entry(which_token, EW_GETFLAG, line, FLAG_OFFSET(all_user_var));
|
||||
case TOK_SETSHELLVARCONTEXT:
|
||||
|
|
|
@ -117,6 +117,7 @@ static tokenType tokenlist[TOK__LAST] =
|
|||
{TOK_IFFILEEXISTS,_T("IfFileExists"),2,1,_T("filename label_to_goto_if_file_exists [label_to_goto_otherwise]"),TP_CODE},
|
||||
{TOK_IFREBOOTFLAG,_T("IfRebootFlag"),1,1,_T("jump_if_set [jump_if_not_set]"),TP_CODE},
|
||||
{TOK_IFSILENT,_T("IfSilent"),1,1,_T("jump_if_silent [jump_if_not_silent]"),TP_CODE},
|
||||
{TOK_IFRTLLANG,_T("IfRtlLanguage"),1,1,_T("goto_true [goto_false]"),TP_CODE},
|
||||
{TOK_INSTALLDIRREGKEY,_T("InstallDirRegKey"),3,0,_T("root_key subkey entry_name\n root_key=(HKCR|HKLM|HKCU|HKU|HKCC|HKDD|HKPD)"),TP_GLOBAL},
|
||||
{TOK_INSTCOLORS,_T("InstallColors"),1,1,_T("(/windows | (foreground_color background_color))"),TP_GLOBAL},
|
||||
{TOK_INSTDIR,_T("InstallDir"),1,0,_T("default_install_directory"),TP_GLOBAL},
|
||||
|
@ -211,7 +212,9 @@ static tokenType tokenlist[TOK__LAST] =
|
|||
{TOK_SETOVERWRITE,_T("SetOverwrite"),1,0,_T("on|off|try|ifnewer|ifdiff"),TP_ALL},
|
||||
{TOK_SETPLUGINUNLOAD,_T("SetPluginUnload"),1,0,_T("deprecated - plug-ins should handle this on their own"),TP_ALL},
|
||||
{TOK_SETREBOOTFLAG,_T("SetRebootFlag"),1,0,_T("true|false"),TP_CODE},
|
||||
{TOK_GETREGVIEW,_T("GetRegView"),1,0,_T("$(user_var: output)"),TP_CODE},
|
||||
{TOK_SETREGVIEW,_T("SetRegView"),1,0,_T("32|64|default|lastused"),TP_CODE},
|
||||
{TOK_IFALTREGVIEW,_T("IfAltRegView"),1,1,_T("goto_true [goto_false]"),TP_CODE},
|
||||
{TOK_GETSHELLVARCONTEXT,_T("GetShellVarContext"),1,0,_T("$(user_var: output)"),TP_CODE},
|
||||
{TOK_SETSHELLVARCONTEXT,_T("SetShellVarContext"),1,0,_T("all|current"),TP_CODE},
|
||||
{TOK_IFSHELLVARCONTEXTALL,_T("IfShellVarContextAll"),1,1,_T("goto_true [goto_false]"),TP_CODE},
|
||||
|
|
|
@ -300,7 +300,9 @@ enum
|
|||
TOK_INSTTYPEGETTEXT,
|
||||
TOK_GETCURINSTTYPE,
|
||||
TOK_SETCURINSTTYPE,
|
||||
TOK_GETREGVIEW,
|
||||
TOK_SETREGVIEW,
|
||||
TOK_IFALTREGVIEW,
|
||||
TOK_GETSHELLVARCONTEXT,
|
||||
TOK_SETSHELLVARCONTEXT,
|
||||
TOK_IFSHELLVARCONTEXTALL,
|
||||
|
@ -313,6 +315,7 @@ enum
|
|||
TOK_IFSILENT,
|
||||
TOK_SETERRORLEVEL,
|
||||
TOK_GETERRORLEVEL,
|
||||
TOK_IFRTLLANG,
|
||||
TOK_LOCKWINDOW,
|
||||
|
||||
TOK__LAST,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue