renamed SubSection to SectionGroup

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3852 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2005-01-10 12:43:52 +00:00
parent fe03bb3d47
commit f2cba8c2cb
15 changed files with 66 additions and 57 deletions

View file

@ -282,7 +282,7 @@ Released on February 7th, 2004
\b New and improved utilities: \L{../Contrib/Makensisw/Readme.txt}{MakeNSISw}, NSIS Menu (NSIS.exe), NSIS Update (Bin\\NSIS Update.exe) and zip2exe (Bin\\zip2exe.exe)
\b New commands: \R{addplugindir}{!addplugindir}, \R{echo}{!echo}, \R{ifmacrodef}{!ifmacrodef}, \R{ifmacrondef}{!ifmacrondef}, \R{verbose}{!verbose}, \R{aaddbrandingimage}{AddBrandingImage}, \R{asetallowskipfiles}{AllowSkipFiles}, \R{achangeui}{ChangeUI}, \R{acheckbitmap}{CheckBitmap}, \R{createfont}{CreateFont}, \R{adirvar}{DirVar}, \R{adirverify}{DirVerify}, \R{enablewindow}{EnableWindow}, \R{afilebufsize}{FileBufSize}, \R{flushini}{FlushINI}, \R{sgetcurinsttype}{GetCurInstType}, \R{getdlgitem}{GetDlgItem}, \R{getinstdirerror}{GetInstDirError}, \R{ifabort}{IfAbort}, \R{ifsilent}{IfSilent}, \R{initpluginsdir}{InitPluginsDir}, \R{sinsttypegettext}{InstTypeGetText}, \R{sinsttypesettext}{InstTypeSetText}, \R{langstring}{LangString}, \R{alicensebkcolor}{LicenseBkColor}, \R{alicenseforceselection}{LicenseForceSelection}, \R{licenselangstring}{LicenseLangString}, \R{loadlanguagefile}{LoadLanguageFile}, LockWindow, \R{page}{Page}, \R{pageex}{PageEx}, \R{reservefile}{ReserveFile}, \R{sectiongetinsttypes}{SectionGetInstTypes}, \R{ssectiongetsize}{SectionGetSize}, \R{sectionsetinsttypes}{SectionSetInstTypes}, \R{ssectionsetsize}{SectionSetSize}, \R{setbrandingimage}{SetBrandingImage}, SetCompressionLevel, \R{asetcompressor}{SetCompressor}, \R{asetcompressordictsize}{SetCompressorDictSize}, \R{setctlcolors}{SetCtlColors}, \R{ssetcurinsttype}{SetCurInstType}, \R{setpluginunload}{SetPluginUnload}, \R{setsilent}{SetSilent}, \R{showwindow}{ShowWindow}, \R{ssubsection}{SubSection}, \R{ssubsectionend}{SubSectionEnd}, \R{var}{Var}, \R{viaddversionkey}{VIAddVersionKey}, \R{viproductversion}{VIProductVersion} and \R{axpstyle}{XPStyle}
\b New commands: \R{addplugindir}{!addplugindir}, \R{echo}{!echo}, \R{ifmacrodef}{!ifmacrodef}, \R{ifmacrondef}{!ifmacrondef}, \R{verbose}{!verbose}, \R{aaddbrandingimage}{AddBrandingImage}, \R{asetallowskipfiles}{AllowSkipFiles}, \R{achangeui}{ChangeUI}, \R{acheckbitmap}{CheckBitmap}, \R{createfont}{CreateFont}, \R{adirvar}{DirVar}, \R{adirverify}{DirVerify}, \R{enablewindow}{EnableWindow}, \R{afilebufsize}{FileBufSize}, \R{flushini}{FlushINI}, \R{sgetcurinsttype}{GetCurInstType}, \R{getdlgitem}{GetDlgItem}, \R{getinstdirerror}{GetInstDirError}, \R{ifabort}{IfAbort}, \R{ifsilent}{IfSilent}, \R{initpluginsdir}{InitPluginsDir}, \R{sinsttypegettext}{InstTypeGetText}, \R{sinsttypesettext}{InstTypeSetText}, \R{langstring}{LangString}, \R{alicensebkcolor}{LicenseBkColor}, \R{alicenseforceselection}{LicenseForceSelection}, \R{licenselangstring}{LicenseLangString}, \R{loadlanguagefile}{LoadLanguageFile}, LockWindow, \R{page}{Page}, \R{pageex}{PageEx}, \R{reservefile}{ReserveFile}, \R{sectiongetinsttypes}{SectionGetInstTypes}, \R{ssectiongetsize}{SectionGetSize}, \R{sectionsetinsttypes}{SectionSetInstTypes}, \R{ssectionsetsize}{SectionSetSize}, \R{setbrandingimage}{SetBrandingImage}, SetCompressionLevel, \R{asetcompressor}{SetCompressor}, \R{asetcompressordictsize}{SetCompressorDictSize}, \R{setctlcolors}{SetCtlColors}, \R{ssetcurinsttype}{SetCurInstType}, \R{setpluginunload}{SetPluginUnload}, \R{setsilent}{SetSilent}, \R{showwindow}{ShowWindow}, SubSection (replaced by \R{ssectiongroup}{SectionGroup}), SubSectionEnd (replaced by \R{ssectiongroupend}{SectionGroupEnd}), \R{var}{Var}, \R{viaddversionkey}{VIAddVersionKey}, \R{viproductversion}{VIProductVersion} and \R{axpstyle}{XPStyle}
\b Removed commands: DirShow, DisabledBitmap, EnabledBitmap and SectionDivider

View file

@ -2,7 +2,7 @@
Unlike labels, relative jumps are, as the name suggests, relative to the place they are called from. You can use relative jumps wherever you can use labels. Relative jumps are marked by numbers. +1 jumps to the next instruction (the default advancement), +2 will skip one instruction and go to the second instruction from the current instruction, -2 will jump two instructions backward, and +10 will skip 9 instructions, jumping to the tenth instruction from the current instruction.
An instruction is every command that is executed at run-time, when the installer is running. \R{messagebox}{MessageBox}, \R{goto}{Goto}, \R{getdllversion}{GetDLLVersion}, \R{FileRead}{FileRead}, \R{setshellvarcontext}{SetShellVarContext} are all instructions. \R{saddsize}{AddSize}, \R{ssection}{Section}, \R{ssubsection}{SubSection}, \R{ssectionend}{SectionEnd}, \R{asetoverwrite}{SetOverwrite} (and everything under \R{flags}{Compiler Flags}), \R{aname}{Name}, \R{asetfont}{SetFont}, \R{langstring}{LangString}, are not instructions because they are executed at compile time.
An instruction is every command that is executed at run-time, when the installer is running. \R{messagebox}{MessageBox}, \R{goto}{Goto}, \R{getdllversion}{GetDLLVersion}, \R{FileRead}{FileRead}, \R{setshellvarcontext}{SetShellVarContext} are all instructions. \R{saddsize}{AddSize}, \R{ssection}{Section}, \R{ssectiongroup}{SectionGroup}, \R{ssectionend}{SectionEnd}, \R{asetoverwrite}{SetOverwrite} (and everything under \R{flags}{Compiler Flags}), \R{aname}{Name}, \R{asetfont}{SetFont}, \R{langstring}{LangString}, are not instructions because they are executed at compile time.
Examples:

View file

@ -4,7 +4,7 @@
\c section_index section_flags
Sets the section's flags. The flag is a 32 bit integer. The first bit (lowest) represents whether the section is currently enabled, the second bit represents whether the section is a subsection (don't modify this unless you really know what you are doing), the third bit represents whether the section is a subsection end (again, don't modify), the fourth bit represents whether the section is shown in bold or not, the fifth bit represents whether the section is read-only and the sixth bit represents whether the sub-section is to be automatically expanded. The error flag will be set if an out of range section is specified.
Sets the section's flags. The flag is a 32 bit integer. The first bit (lowest) represents whether the section is currently enabled, the second bit represents whether the section is a section group (don't modify this unless you really know what you are doing), the third bit represents whether the section is a section group end (again, don't modify), the fourth bit represents whether the section is shown in bold or not, the fifth bit represents whether the section is read-only and the sixth bit represents whether the section group is to be automatically expanded. The error flag will be set if an out of range section is specified.
For an example of usage please see the \L{../Examples/one-section.nsi}{one-section.nsi} example.
@ -18,7 +18,7 @@ Retrieves the section's flags. See above for a description of the flag. The erro
\c section_index section_text
Sets the description for the section section_index. To set a subsection, you must use - at the beginning of the text. If the Text is set to "" than the section will be hidden. The error flag will be set if an out of range section is specified.
Sets the description for the section section_index. If the text is set to "" then the section will be hidden. The error flag will be set if an out of range section is specified.
\S2{sectiongettext} SectionGetText

View file

@ -62,20 +62,19 @@ This command specifies which install types (see \R{ainsttype}{InstType}) the cur
\c SectionIn 1
\c SectionEnd
\S2{ssubsection} SubSection
\S2{ssectiongroup} SectionGroup
\c [/e] Caption [subsection_name index output]
\c [/e] Caption [section_group_name index output]
This command inserts a subsection. The subsection must be closed with SubSectionEnd, and should contain 1 or more Sections. If the subsection name begins with a !, the subsection will be displayed as bold. If /e is present, the sub sections of the sub section will be expanded by default. If section index output is specified, the parameter will be !defined with the section index (that can be used for SectionSetText etc). If the name is prefixed with 'un.' the subsection is an uninstaller subsection.
This command inserts a section group. The section group must be closed with \R{ssectiongroupend}{SectionGroupEnd}, and should contain 1 or more sections. If the section group name begins with a !, its name will be displayed with a bold font. If /e is present, the section group will be expanded by default. If section index output is specified, the parameter will be !defined with the section index (that can be used for \R{sectionsettext}{SectionSetText} etc). If the name is prefixed with 'un.' the section group is an uninstaller section group.
\c SubSection "some stuff"
\c SectionGroup "some stuff"
\c Section "a section"
\c SectionEnd
\c Section "another section"
\c SectionEnd
\c SubSectionEnd
\c SectionGroupEnd
\S2{ssubsectionend} SubSectionEnd
Closes a subsection opened with SubSection.
\S2{ssectiongroupend} SectionGroupEnd
Closes a section group opened with \R{ssectiongroup}{SectionGroup}.

View file

@ -98,7 +98,7 @@ SectionIn 1 2 3
SectionEnd
SubSection /e SubSection1
SectionGroup /e SectionGroup1
Section "Test Registry/INI functions"
@ -144,7 +144,7 @@ Section "Test CreateShortCut"
SectionEnd
SubSection Sub2
SectionGroup Group2
Section "Test Branching"
@ -192,7 +192,7 @@ Section "Test Branching"
SectionEnd
SubSectionEnd
SectionGroupEnd
Section "Test CopyFiles"
@ -203,7 +203,7 @@ Section "Test CopyFiles"
SectionEnd
SubSectionEnd
SectionGroupEnd
Section "Test Exec functions" CRAPIDX

View file

@ -257,7 +257,7 @@ Section "Desktop Shortcut" SecShortcuts
SectionEnd
SubSection "User Interfaces" SecInterfaces
SectionGroup "User Interfaces" SecInterfaces
Section "Modern User Interface" SecInterfacesModernUI
@ -330,7 +330,7 @@ Section "Tiny User Interface" SecInterfacesTinyUI
SectionEnd
SubSectionEnd
SectionGroupEnd
Section "Graphics" SecGraphics
@ -370,7 +370,7 @@ Section "Language Files" SecLangFiles
SectionEnd
SubSection "Tools" SecTools
SectionGroup "Tools" SecTools
Section "NSIS Update" SecToolsUpdate
@ -406,9 +406,9 @@ Section "Zip2Exe" SecToolsZ2E
SectionEnd
SubSectionEnd
SectionGroupEnd
SubSection "Plug-ins" SecPluginsPlugins
SectionGroup "Plug-ins" SecPluginsPlugins
Section "Banner" SecPluginsBanner
@ -631,9 +631,9 @@ Section "VPatch" SecPluginsVPatch
File ..\Contrib\VPatch\patch.pat
SectionEnd
SubSectionEnd
SectionGroupEnd
SubSection "Source code" SecSrc
SectionGroup "Source code" SecSrc
Section "NSIS Source Code" SecSrcNSIS
@ -740,7 +740,7 @@ Section "Zip2Exe Source" SecToolsZ2ES
File ..\Contrib\zip2exe\zlib\*.*
SectionEnd
SubSection "Tools" SecToolsS
SectionGroup "Tools" SecToolsS
Section "MakeNSISW Source" SecSrcMNW
@ -779,9 +779,9 @@ Section "UI Holder Source" SecSrcUIHolder
File "..\Contrib\UIs\UI Holder\*.dsp"
SectionEnd
SubSectionEnd
SectionGroupEnd
SubSection "Plug-ins" SecPluginsPluginsS
SectionGroup "Plug-ins" SecPluginsPluginsS
Section "Banner Source" SecPluginsBannerS
@ -1004,9 +1004,9 @@ Section "VPatch Source" SecPluginsVPatchS
SectionEnd
SubSectionEnd ; plugins
SectionGroupEnd ; plugins
SubSectionEnd
SectionGroupEnd
Section -post

View file

@ -60,8 +60,8 @@
; Any conditional NSIS instruction test:
; ${Cmd} a
; Section flag tests:
; ${SectionIsSelected} a; ${SectionIsSubSection} a;
; ${SectionIsSubSectionEnd} a; ${SectionIsBold} a;
; ${SectionIsSelected} a; ${SectionIsSectionGroup} a;
; ${SectionIsSectionGroupEnd} a; ${SectionIsBold} a;
; ${SectionIsReadOnly} a; ${SectionIsExpanded} a;
; ${SectionIsPartiallySelected} a
; - Requires a !define LOGICLIB_SECTIONCMP above !include LogicLib.nsh
@ -320,6 +320,8 @@
!define SectionIsSelected `${SF_SELECTED} SectionFlagIsSet`
!define SectionIsSubSection `${SF_SUBSEC} SectionFlagIsSet`
!define SectionIsSubSectionEnd `${SF_SUBSECEND} SectionFlagIsSet`
!define SectionIsSectionGroup `${SF_SECGRP} SectionFlagIsSet`
!define SectionIsSectionGroupEnd `${SF_SECGRPEND} SectionFlagIsSet`
!define SectionIsBold `${SF_BOLD} SectionFlagIsSet`
!define SectionIsReadOnly `${SF_RO} SectionFlagIsSet`
!define SectionIsExpanded `${SF_EXPAND} SectionFlagIsSet`

View file

@ -16,8 +16,10 @@
; Generic section defines
!define SF_SELECTED 1
!define SF_SUBSEC 2
!define SF_SUBSECEND 4
!define SF_SECGRP 2
!define SF_SUBSEC 2 # deprecated
!define SF_SECGRPEND 4
!define SF_SUBSECEND 4 # deprecated
!define SF_BOLD 8
!define SF_RO 16
!define SF_EXPAND 32

View file

@ -289,7 +289,7 @@ definedlist.add("NSIS_SUPPORT_LANG_IN_STRINGS");
build_filebuflen=32<<20; // 32mb
subsection_open_cnt=0;
sectiongroup_open_cnt=0;
build_cursection_isfunc=0;
build_cursection=NULL;
// init public data.
@ -1125,7 +1125,7 @@ int CEXEBuild::section_end()
add_entry_direct(EW_RET);
build_cursection->code_size--;
build_cursection=NULL;
if (!subsection_open_cnt)
if (!sectiongroup_open_cnt)
set_uninstall_mode(0);
return PS_OK;
}
@ -1159,11 +1159,11 @@ int CEXEBuild::add_section(const char *secname, const char *defname, int expand/
{
if (secname[1])
{
new_section.flags |= SF_SUBSEC;
new_section.flags |= SF_SECGRP;
name++;
}
else
new_section.flags |= SF_SUBSECEND;
new_section.flags |= SF_SECGRPEND;
}
if (name[0] == '!')
@ -1187,16 +1187,16 @@ int CEXEBuild::add_section(const char *secname, const char *defname, int expand/
set_uninstall_mode(1);
}
if ((new_section.flags & SF_SUBSECEND) && subsection_open_cnt && old_uninstall_mode)
if ((new_section.flags & SF_SECGRPEND) && sectiongroup_open_cnt && old_uninstall_mode)
{
set_uninstall_mode(1);
}
if (subsection_open_cnt)
if (sectiongroup_open_cnt)
{
if (uninstall_mode != old_uninstall_mode)
{
ERROR_MSG("Error: Can't create %s section in %s subsection (use SubSectionEnd first)\n", uninstall_mode ? "uninstaller" : "installer", old_uninstall_mode ? "uninstaller" : "installer");
ERROR_MSG("Error: Can't create %s section in %s section group (use SectionGroupEnd first)\n", uninstall_mode ? "uninstaller" : "installer", old_uninstall_mode ? "uninstaller" : "installer");
return PS_ERROR;
}
}
@ -1226,28 +1226,28 @@ int CEXEBuild::add_section(const char *secname, const char *defname, int expand/
cur_header->blocks[NB_SECTIONS].num++;
if (new_section.flags & (SF_SUBSEC | SF_SUBSECEND))
if (new_section.flags & (SF_SECGRP | SF_SECGRPEND))
{
add_entry_direct(EW_RET);
build_cursection->code_size = 0;
build_cursection = 0;
if (new_section.flags & SF_SUBSECEND)
if (new_section.flags & SF_SECGRPEND)
{
subsection_open_cnt--;
if (subsection_open_cnt < 0)
sectiongroup_open_cnt--;
if (sectiongroup_open_cnt < 0)
{
ERROR_MSG("SubSectionEnd: no SubSections are open\n");
ERROR_MSG("SectionGroupEnd: no SectionGroups are open\n");
return PS_ERROR;
}
if (!subsection_open_cnt)
if (!sectiongroup_open_cnt)
{
set_uninstall_mode(0);
}
}
else
subsection_open_cnt++;
sectiongroup_open_cnt++;
}
return PS_OK;
@ -2223,9 +2223,9 @@ int CEXEBuild::check_write_output_errors() const
return PS_ERROR;
}
if (subsection_open_cnt)
if (sectiongroup_open_cnt)
{
ERROR_MSG("Error: SubSection left open at EOF\n");
ERROR_MSG("Error: SectionGroup left open at EOF\n");
return PS_ERROR;
}

View file

@ -318,7 +318,7 @@ class CEXEBuild {
char version_product_v[1024];
#endif
int subsection_open_cnt;
int sectiongroup_open_cnt;
FastStringList m_warnings;
GrowBuf m_macros;

View file

@ -1190,7 +1190,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
tv.item.state|=(sec->flags&SF_BOLD)<<1;
}
if (sec->flags&SF_SUBSEC)
if (sec->flags&SF_SECGRP)
{
tv.item.mask|=TVIF_CHILDREN;
tv.item.cChildren=1;
@ -1200,7 +1200,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
Par = hTreeItems[x] = TreeView_InsertItem(hwndTree1,&tv);
doLines=1;
}
else if (sec->flags&SF_SUBSECEND)
else if (sec->flags&SF_SECGRPEND)
{
SetParentState(hwndTree1,hTreeItems[lastGoodX]);
Par=TreeView_GetParent(hwndTree1,Par);
@ -1420,7 +1420,7 @@ static BOOL CALLBACK SelProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
while (x--)
{
if (*ht && !(t->flags&(SF_SUBSEC|SF_SUBSECEND)))
if (*ht && !(t->flags&(SF_SECGRP|SF_SECGRPEND)))
{
TVITEM tvItem;
tvItem.hItem=*ht;

View file

@ -336,8 +336,8 @@ enum
// used for section->flags
#define SF_SELECTED 1
#define SF_SUBSEC 2
#define SF_SUBSECEND 4
#define SF_SECGRP 2
#define SF_SECGRPEND 4
#define SF_BOLD 8
#define SF_RO 16
#define SF_EXPAND 32

View file

@ -2979,7 +2979,9 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
SCRIPT_MSG("\n");
}
return PS_OK;
case TOK_SECTIONGROUPEND:
case TOK_SUBSECTIONEND:
case TOK_SECTIONGROUP:
case TOK_SUBSECTION:
{
char buf[1024];
@ -2990,7 +2992,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
a++;
}
wsprintf(buf,"-%s",line.gettoken_str(a));
if (which_token == TOK_SUBSECTION)
if (which_token == TOK_SECTIONGROUP || which_token == TOK_SUBSECTION)
{
char *s = line.gettoken_str(a);
if (!s[0] || (!strcmpi(s, "un.") && !s[3]))

View file

@ -150,8 +150,10 @@ static tokenType tokenlist[TOK__LAST] =
{TOK_SECTION,"Section",0,3,"[/0] [-][un.][section_name] [section index output]",TP_GLOBAL},
{TOK_SECTIONEND,"SectionEnd",0,0,"",TP_SEC},
{TOK_SECTIONIN,"SectionIn",1,-1,"InstTypeIdx [InstTypeIdx [...]]",TP_SEC},
{TOK_SUBSECTION,"SubSection",1,2,"[/e] [un.]subsection_name [section index output]",TP_GLOBAL},
{TOK_SUBSECTIONEND,"SubSectionEnd",0,0,"",TP_GLOBAL},
{TOK_SUBSECTION,"SubSection",1,2,"deprecated - use SectionGroup",TP_GLOBAL},
{TOK_SECTIONGROUP,"SectionGroup",1,2,"[/e] [un.]section_group_name [section index output]",TP_GLOBAL},
{TOK_SUBSECTIONEND,"SubSectionEnd",0,0,"deprecated - use SectionGroupEnd",TP_GLOBAL},
{TOK_SECTIONGROUPEND,"SectionGroupEnd",0,0,"",TP_GLOBAL},
{TOK_SEARCHPATH,"SearchPath",2,0,"$(user_var: result) filename",TP_CODE},
{TOK_SECTIONSETFLAGS,"SectionSetFlags",2,0,"section_index flags",TP_CODE},
{TOK_SECTIONGETFLAGS,"SectionGetFlags",2,0,"section_index $(user_var: output flags)",TP_CODE},

View file

@ -99,6 +99,8 @@ enum
TOK_SECTION,
TOK_SECTIONEND,
TOK_SECTIONIN,
TOK_SECTIONGROUP,
TOK_SECTIONGROUPEND,
TOK_SUBSECTION,
TOK_SUBSECTIONEND,
TOK_FUNCTION,