Added DirVerify (works in PageEx directory) and GetInstDirError. If `DirVerify leave' is used, the next button will not be disabled if the installation directory is not valid or there is not enough space and a flag will be set instead. You can read that flag using GetInstDirError in the leave function of the directory page. A value of 0 means no error, 1 means invalid installation directory and 2 means not enough space. This allows you to handle those errors on your own.
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3196 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
80eac750fc
commit
b77f339455
6 changed files with 81 additions and 29 deletions
|
@ -1350,6 +1350,26 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
|
|||
SCRIPT_MSG("DirVar: %s\n", line.gettoken_str(1));
|
||||
}
|
||||
return make_sure_not_in_secorfunc(line.gettoken_str(0), 1);
|
||||
case TOK_DIRVERIFY:
|
||||
{
|
||||
if (!cur_page || cur_page_type != PAGE_DIRECTORY) {
|
||||
ERROR_MSG("Error: can't use DirVerify outside of PageEx directory.\n");
|
||||
return PS_ERROR;
|
||||
}
|
||||
cur_page->flags &= ~PF_DIR_NO_BTN_DISABLE;
|
||||
int k = line.gettoken_enum(1,"auto\0leave\0");
|
||||
if (k == -1)
|
||||
PRINTHELP();
|
||||
if (k)
|
||||
cur_page->flags |= PF_DIR_NO_BTN_DISABLE;
|
||||
SCRIPT_MSG("DirVerify: %s\n", line.gettoken_str(1));
|
||||
}
|
||||
return make_sure_not_in_secorfunc(line.gettoken_str(0), 1);
|
||||
case TOK_GETINSTDIRERROR:
|
||||
ent.which = EW_GETFLAG;
|
||||
ent.offsets[0] = GetUserVarIndex(line, 1);
|
||||
ent.offsets[1] = FLAG_OFFSET(instdir_error);
|
||||
return add_entry(&ent);
|
||||
#ifdef NSIS_CONFIG_COMPONENTPAGE
|
||||
case TOK_COMPTEXT:
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue