CHM documentation generates using Halibut. Thanks Nike!

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3090 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2003-11-03 09:10:19 +00:00
parent 43bd7d565f
commit 2cb320edb5
24 changed files with 268 additions and 57 deletions

Binary file not shown.

View file

@ -76,6 +76,8 @@ typedef struct {
wchar_t *author, *description;
wchar_t *head_end, *body, *body_start, *body_end, *address_start,
*address_end, *nav_attrs;
wchar_t *rlink_prefix, *rlink_suffix;
wchar_t *chm_toc_file, *chm_ind_file;
int suppress_address;
xhtmlheadfmt fchapter, *fsect;
int nfsect;
@ -101,6 +103,8 @@ static void xhtml_para(FILE *, word *);
static void xhtml_codepara(FILE *, word *);
static void xhtml_heading(FILE *, paragraph *);
static void chm_doheader(FILE *, word *);
static void chm_dofooter(FILE *);
/* File-global variables are much easier than passing these things
* all over the place. Evil, but easier. We can replace this with a single
* structure at some point.
@ -115,6 +119,9 @@ static xhtmlfile *lastfile;
static xhtmlfile *xhtml_last_file = NULL;
static int last_level = -1;
static xhtmlsection *currentsection;
static FILE* chm_toc = NULL;
static FILE* chm_ind = NULL;
static xhtmlconfig xhtml_configure(paragraph * source)
{
@ -143,7 +150,10 @@ static xhtmlconfig xhtml_configure(paragraph * source)
ret.address_end = NULL;
ret.nav_attrs = NULL;
ret.suppress_address = FALSE;
ret.chm_toc_file = NULL;
ret.chm_ind_file = NULL;
chm_toc = NULL;
chm_ind = NULL;
ret.fchapter.just_numbers = FALSE;
ret.fchapter.number_suffix = ustrdup(L": ");
ret.nfsect = 2;
@ -152,6 +162,8 @@ static xhtmlconfig xhtml_configure(paragraph * source)
ret.fsect[0].number_suffix = ustrdup(L": ");
ret.fsect[1].just_numbers = TRUE;
ret.fsect[1].number_suffix = ustrdup(L" ");
ret.rlink_prefix = NULL;
ret.rlink_suffix = NULL;
for (; source; source = source->next)
{
@ -195,6 +207,12 @@ static xhtmlconfig xhtml_configure(paragraph * source)
} else if (!ustricmp(source->keyword, L"xhtml-author"))
{
ret.author = uadv(source->keyword);
} else if (!ustricmp(source->keyword, L"chm-toc-file"))
{
ret.chm_toc_file = uadv(source->keyword);
} else if (!ustricmp(source->keyword, L"chm-ind-file"))
{
ret.chm_ind_file = uadv(source->keyword);
} else if (!ustricmp(source->keyword, L"xhtml-description"))
{
ret.description = uadv(source->keyword);
@ -226,6 +244,12 @@ static xhtmlconfig xhtml_configure(paragraph * source)
} else if (!ustricmp(source->keyword, L"xhtml-chapter-suffix"))
{
ret.fchapter.number_suffix = ustrdup(uadv(source->keyword));
} else if (!ustricmp(source->keyword, L"xhtml-rlink-prefix"))
{
ret.rlink_prefix = uadv(source->keyword);
} else if (!ustricmp(source->keyword, L"xhtml-rlink-suffix"))
{
ret.rlink_suffix = uadv(source->keyword);
} else if (!ustricmp(source->keyword, L"xhtml-section-numeric"))
{
wchar_t *p = uadv(source->keyword);
@ -646,11 +670,8 @@ static void xhtml_do_file(xhtmlfile * file);
static void xhtml_do_top_file(xhtmlfile * file, paragraph * sourceform);
static void xhtml_do_paras(FILE * fp, paragraph * p);
static int xhtml_do_contents_limit(FILE * fp, xhtmlfile * file, int limit);
static int xhtml_do_contents_section_limit(FILE * fp,
xhtmlsection * section,
int limit);
static int xhtml_add_contents_entry(FILE * fp, xhtmlsection * section,
int limit);
static int xhtml_do_contents_section_limit(FILE * fp, xhtmlsection * section, int limit);
static int xhtml_add_contents_entry(FILE * fp, xhtmlsection * section, int limit);
static int xhtml_do_contents(FILE * fp, xhtmlfile * file);
static int xhtml_do_naked_contents(FILE * fp, xhtmlfile * file);
static void xhtml_do_sections(FILE * fp, xhtmlsection * sections);
@ -945,17 +966,39 @@ static void xhtml_do_file(xhtmlfile * file)
static void xhtml_do_top_file(xhtmlfile * file, paragraph * sourceform)
{
paragraph *p;
char fname[_MAX_PATH];
int done = FALSE;
FILE *fp = fopen(file->filename, "w");
ustrtoa(conf.chm_toc_file, fname, _MAX_PATH);
if(*fname)
{
chm_toc = fopen(fname, "w");
if (chm_toc == NULL)
fatal(err_cantopenw, fname);
}
else
chm_toc = NULL;
ustrtoa(conf.chm_ind_file, fname, _MAX_PATH);
if(*fname){
chm_ind = fopen(fname, "w");
if (chm_ind == NULL)
fatal(err_cantopenw, fname);
}
else
chm_ind = NULL;
if (fp == NULL)
fatal(err_cantopenw, file->filename);
/* Do the title -- only one allowed */
for (p = sourceform; p && !done; p = p->next)
{
if (p->type == para_Title)
{
xhtml_doheader(fp, p->words);
if(chm_toc)chm_doheader(chm_toc, p->words);
if(chm_ind)chm_doheader(chm_ind, p->words);
done = TRUE;
}
}
@ -1008,7 +1051,11 @@ static void xhtml_do_top_file(xhtmlfile * file, paragraph * sourceform)
}
xhtml_dofooter(fp);
if(chm_toc)chm_dofooter(chm_toc);
if(chm_ind)chm_dofooter(chm_ind);
fclose(fp);
if(chm_toc)fclose(chm_toc);
if(chm_ind)fclose(chm_ind);
}
/* Convert a Unicode string to an ASCII one. '?' is
@ -1053,6 +1100,7 @@ static int xhtml_do_contents(FILE * fp, xhtmlfile * file)
{
last_level--;
fprintf(fp, "</ul>\n");
if(chm_toc)fprintf(chm_toc, "</ul>\n");
}
}
return count;
@ -1077,6 +1125,7 @@ static int xhtml_do_naked_contents(FILE * fp, xhtmlfile * file)
{
last_level--;
fprintf(fp, "</ul>\n");
if(chm_toc)fprintf(chm_toc, "</ul>\n");
}
}
return count;
@ -1125,8 +1174,7 @@ xhtml_do_contents_section_deep_limit(FILE * fp, xhtmlsection * section,
* limit contents depth.
*/
static int
xhtml_do_contents_section_limit(FILE * fp, xhtmlsection * section,
int limit)
xhtml_do_contents_section_limit(FILE * fp, xhtmlsection * section, int limit)
{
int count = 0;
if (!section)
@ -1156,19 +1204,26 @@ xhtml_add_contents_entry(FILE * fp, xhtmlsection * section, int limit)
{
last_level--;
fprintf(fp, "</ul>\n");
if(chm_toc)fprintf(chm_toc, "</ul>\n");
}
while (last_level < section->level)
{
last_level++;
fprintf(fp, "<ul>\n");
if(chm_toc)fprintf(chm_toc, "<ul>\n");
}
fprintf(fp, "<li>");
fprintf(fp, "<a %shref=\"%s#%s\">",
(section->para->type == para_Chapter
|| section->para->type ==
para_Appendix) ? "class=\"btitle\" " : "",
(section->para->type == para_Chapter|| section->para->type == para_Appendix) ? "class=\"btitle\" " : "",
section->file->filename,
(section->para->type == para_Chapter) ? "" : section->fragment);
if(chm_toc)fprintf(chm_toc, "<li><OBJECT type=\"text/sitemap\"><param name=\"Local\" value=\"%s#%s\"><param name=\"Name\" value=\"",
section->file->filename,
(section->para->type == para_Chapter) ? "" : section->fragment);
if(chm_ind)fprintf(chm_ind, "<li><OBJECT type=\"text/sitemap\"><param name=\"Local\" value=\"%s#%s\"><param name=\"Name\" value=\"",
section->file->filename,
(section->para->type == para_Chapter) ? "" : section->fragment);
//%s
if (section->para->type == para_Chapter
|| section->para->type == para_Appendix)
fprintf(fp, "<b>");
@ -1178,8 +1233,11 @@ xhtml_add_contents_entry(FILE * fp, xhtmlsection * section, int limit)
words))
{
xhtml_para(fp, section->para->kwtext);
if (section->para->words)
if(chm_toc)xhtml_para(chm_toc, section->para->kwtext);
if (section->para->words){
fprintf(fp, ": ");
if(chm_toc)fprintf(chm_toc, ": ");
}
}
if (section->para->type == para_Chapter
|| section->para->type == para_Appendix)
@ -1187,8 +1245,12 @@ xhtml_add_contents_entry(FILE * fp, xhtmlsection * section, int limit)
if (section->para->words)
{
xhtml_para(fp, section->para->words);
if(chm_toc)xhtml_para(chm_toc, section->para->words);
if(chm_ind)xhtml_para(chm_ind, section->para->words);
}
fprintf(fp, "</a></li>\n");
if(chm_toc)fprintf(chm_toc,"\"></OBJECT></li>\n");
if(chm_ind)fprintf(chm_ind,"\"></OBJECT></li>\n");
return TRUE;
}
@ -1365,6 +1427,13 @@ static void xhtml_doheader(FILE * fp, word * title)
fprintf(fp, "%ls\n", conf.body_start);
}
static void chm_doheader(FILE * fp, word * title)
{
fprintf(fp, "<HTML><BODY><UL><LI><OBJECT type=\"text/sitemap\"><param name=\"Name\" value=\"");
xhtml_para(fp, title);
fprintf(fp,"\"><param name=\"Local\" value=\"Contents.html\"></OBJECT></li>\n");
}
/*
* Output a footer for this XHTML file.
*/
@ -1396,6 +1465,10 @@ static void xhtml_dofooter(FILE * fp)
}
fprintf(fp, "</body>\n\n</html>\n");
}
static void chm_dofooter(FILE * fp)
{
fprintf(fp, "</ul></BODY></HTML>\n");
}
/*
* Output the versionid paragraph. Typically this is a version control
@ -1545,6 +1618,7 @@ static void xhtml_rdaddwc(rdstringc * rs, word * text, word * end)
xhtmlsection *sect;
indextag *itag;
int ti;
wchar_t *s;
for (; text && text != end; text = text->next)
{
@ -1553,7 +1627,32 @@ static void xhtml_rdaddwc(rdstringc * rs, word * text, word * end)
case word_HyperLink:
xhtml_utostr(text->text, &c);
rdaddsc(rs, "<a href=\"");
rdaddsc(rs, c);
if(chm_toc && *c == '.' && *(c+1) == '.')
rdaddsc(rs, c + 1);
else
rdaddsc(rs, c);
rdaddsc(rs, "\">");
sfree(c);
break;
case word_LocalHyperLink:
xhtml_utostr(text->text, &c);
rdaddsc(rs, "<a href=\"");
if (conf.rlink_prefix)
{
char *c2;
xhtml_utostr(conf.rlink_prefix, &c2);
rdaddsc(rs, c2);
sfree(c2);
}
rdaddsc(rs, c);
if (conf.rlink_suffix)
{
char *c2;
xhtml_utostr(conf.rlink_suffix, &c2);
rdaddsc(rs, c2);
sfree(c2);
}
rdaddsc(rs, "\">");
sfree(c);
break;
@ -1698,7 +1797,7 @@ static void xhtml_rdaddwc(rdstringc * rs, word * text, word * end)
{
char buf[2] = " ";
dont_convert = 0;
wchar_t *s = text->text;
s = text->text;
for (; *s; s++)
{
buf[0] = (char) *s;

View file

@ -6,6 +6,7 @@
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <string.h>
#include "halibut.h"
struct numberstate_Tag {

View file

@ -5,6 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include "halibut.h"
/*
@ -20,7 +21,7 @@ static void do_error(int code, va_list ap)
char *sp, *sp2;
wchar_t *wsp;
filepos fpos, fpos2;
int flags;
int flags=0;
switch (code)
{

View file

@ -146,6 +146,7 @@ enum {
word_IndexRef, /* (always an invisible one) */
word_HyperLink, /* (invisible) */
word_HyperEnd, /* (also invisible; no text) */
word_LocalHyperLink, /* (invisible) */
word_FreeTextXref /* \R */
};
/* aux values for attributed words */
@ -396,6 +397,7 @@ void gen_citations(paragraph *, keywordlist *);
* style.c
*/
struct userstyle_Tag {
void* empty;
};
/*

View file

@ -191,6 +191,7 @@ enum {
c_S, /* aux field is 0, 1, 2, ... */
c_U, /* unnumbered-chapter heading */
c_W, /* Web hyperlink */
c_L, /* Relative/local hyperlink */
c_b, /* bulletted list */
c_c, /* code */
c_cfg, /* configuration directive */
@ -245,6 +246,8 @@ static void match_kw(token * tok)
/*
* FIXME. The ids are explicit in here so as to allow long-name
* equivalents to the various very short keywords.
*
* This list must be sorted, it's searched using binary search.
*/
static const struct {
char const *name;
@ -281,6 +284,9 @@ static void match_kw(token * tok)
"K", c_K}
, /* capitalised cross-reference */
{
"L", c_L}
, /* Relative/local hyperlink */
{
"R", c_R}
, /* free text cross-reference */
{
@ -468,13 +474,13 @@ token get_token(input * in)
c == '#' || c == '{' || c == '}')
{
/* single-char command */
rdadd(&rs, c);
rdadd(&rs, (wchar_t)c);
} else if (c == 'u')
{
int len = 0;
do
{
rdadd(&rs, c);
rdadd(&rs, (wchar_t)c);
len++;
c = get(in, &cpos);
}
@ -484,7 +490,7 @@ token get_token(input * in)
{
do
{
rdadd(&rs, c);
rdadd(&rs, (wchar_t)c);
c = get(in, &cpos);
}
while (iscmd(c));
@ -527,7 +533,7 @@ token get_token(input * in)
break;
} else
{
rdadd(&rs, c);
rdadd(&rs, (wchar_t)c);
if (c == '-')
{
ret.aux = TRUE;
@ -583,7 +589,7 @@ token get_codepar_token(input * in)
c = get(in, &cpos);
/* Discard \r just before \n. */
if (c2 != 13 || !isnl(c))
rdadd(&rs, c2);
rdadd(&rs, (wchar_t)c2);
}
unget(in, c, &cpos);
ret.text = ustrdup(rs.text);
@ -653,10 +659,10 @@ static void read_file(paragraph *** ret, input * in, indexdata * idx)
word **idximplicit; /* to restore from \u alternatives */
} *sitem;
stack parsestk;
word *indexword, *uword, *iword;
word *indexword=NULL, *uword=NULL, *iword=NULL;
word *idxwordlist;
rdstring indexstr;
int index_downcase, index_visible, indexing;
int index_downcase=0, index_visible=0, indexing=0;
const rdstring nullrs = { 0, 0, NULL };
wchar_t uchr;
@ -735,7 +741,7 @@ static void read_file(paragraph *** ret, input * in, indexdata * idx)
par.type = para_Normal;
if (t.type == tok_cmd)
{
int needkw;
int needkw=0;
int is_macro = FALSE;
par.fpos = t.pos;
@ -1065,8 +1071,7 @@ static void read_file(paragraph *** ret, input * in, indexdata * idx)
style = word_Normal;
spcstyle = word_WhiteSpace;
}
if (sitem->type & stack_idx)
{
if (sitem->type & stack_idx ) {
indexword->text = ustrdup(indexstr.text);
if (index_downcase)
ustrlow(indexword->text);
@ -1179,6 +1184,7 @@ static void read_file(paragraph *** ret, input * in, indexdata * idx)
case c_k:
case c_R:
case c_W:
case c_L:
case c_date:
/*
* Keyword, hyperlink, or \date. We expect a
@ -1195,6 +1201,8 @@ static void read_file(paragraph *** ret, input * in, indexdata * idx)
wd.type = word_FreeTextXref;
else if (t.cmd == c_W)
wd.type = word_HyperLink;
else if (t.cmd == c_L)
wd.type = word_LocalHyperLink;
else
wd.type = word_Normal;
dtor(t), t = get_token(in);
@ -1252,7 +1260,7 @@ static void read_file(paragraph *** ret, input * in, indexdata * idx)
addword(wd, &idximplicit);
}
sfree(wdtext);
if (wd.type == word_FreeTextXref || wd.type == word_HyperLink)
if (wd.type == word_FreeTextXref || wd.type == word_HyperLink || wd.type == word_LocalHyperLink)
{
/*
* Hyperlinks are different: they then

View file

@ -4,6 +4,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "halibut.h"
static void dbg_prtsource(paragraph * sourceform);
@ -217,6 +218,7 @@ int main(int argc, char **argv)
build_index(idx);
if (debug)
{
index_debug(idx);

View file

@ -2,15 +2,15 @@ OBJS = biblio.o bk_xhtml.o contents.o error.o help.o index.o input.o keywords.o
LIBS =
CC = gcc
RM = del
RM = rm -f
DEFINES = -DVERSION="\"1.0 (NSIS Custom Build)\""
CFLAGS = -Wall -W $(DEFINES)
CFLAGS = -Wall -W $(DEFINES) -mno-cygwin
LFLAGS = -s
all : halibut
halibut : $(OBJS)
$(CC) $(CFLAGS) $(LFLAGS) -o ..\halibut.exe $(OBJS) $(LIBS)
$(CC) $(CFLAGS) $(LFLAGS) -o ../halibut.exe $(OBJS) $(LIBS)
clean ::
$(RM) *.o

View file

@ -4,6 +4,7 @@
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include "halibut.h"
#ifdef LOGALLOC

View file

@ -1,7 +1,7 @@
/*
* misc.c: miscellaneous useful items
*/
#include <string.h>
#include "halibut.h"
struct stackTag {

View file

@ -1329,7 +1329,7 @@ static node234 *split234_internal(tree234 * t, int index)
{
node234 *halves[2], *n, *sib, *sub;
node234 *lparent, *rparent;
int ki, pki, i, half, lcount, rcount;
int ki, pki=0, i, half, lcount, rcount;
n = t->root;
LOG(("splitting tree %p at point %d\n", t, index));

View file

@ -30,7 +30,7 @@ char *ustrtoa(wchar_t * s, char *outbuf, int size)
return outbuf;
}
for (p = outbuf; *s && p < outbuf + size; p++, s++)
*p = *s;
*p = *(char*)s;
if (p < outbuf + size)
*p = '\0';
else

View file

@ -1,11 +1,19 @@
bin\halibut.exe chm_config.but intro.but tutorial.but usage.but script.but var.but labels.but jumps.but pages.but sections.but usection.but functions.but callback.but attributes.but compilerflags.but basic.but registry.but generalpurpose.but flowcontrol.but file.but uninstall.but misc.but string.but stack.but int.but reboot.but log.but sec.but ui.but langs.but plugin.but compiler.but defines.but modernui.but usefulfunc.but usefulinfos.but history.but credits.but license.but
@copy Contents.html IndexPage.html
@copy ..\*.css .
@hhc nsis.hhp
@del /F *.html *.hhc *.hhk *.css
@move nsis.chm ..\..\
bin\halibut.exe config.but intro.but tutorial.but usage.but script.but var.but labels.but jumps.but pages.but sections.but usection.but functions.but callback.but attributes.but compilerflags.but basic.but registry.but generalpurpose.but flowcontrol.but file.but uninstall.but misc.but string.but stack.but int.but reboot.but log.but sec.but ui.but langs.but plugin.but compiler.but defines.but modernui.but usefulfunc.but usefulinfos.but history.but credits.but license.but
@echo off
copy Contents.html index.html > nul
copy index.html IndexPage.html > nul
if "x%OS%x" == "xWindows_NTx" goto nt
copy *.html .. > nul
goto done
@copy Contents.html index.html > nul
@copy index.html IndexPage.html > nul
@if "x%OS%x" == "xWindows_NTx" goto nt
@copy *.html .. > nul
@goto done
:nt
for %%A in (*.html) do (fc "%%A" "..\%%~nxA" || copy "%%A" ..) > nul
@for %%A in (*.html) do (fc "%%A" "..\%%~nxA" || copy "%%A" ..) > nul
:done
del *.html > nul
@del *.html > nul

24
Docs/src/chm_config.but Normal file
View file

@ -0,0 +1,24 @@
\title NSIS Users Manual
\cfg{xhtml-leaf-level}{2}
\cfg{xhtml-leaf-contains-contents}{false}
\cfg{xhtml-contents-depth-0}{5}
\cfg{xhtml-head-end}{<link rel="stylesheet" href="style.css" type='text/css' /><script language="JScript" src="chmlink.js"></script>}
\cfg{xhtml-rlink-prefix}{#" onclick="parser('}
\cfg{xhtml-rlink-suffix}{')}
\cfg{chm-toc-file}{toc.hhc}
\cfg{chm-ind-file}{ind.hhk}
\preamble NSIS is a free scriptable win32 installer/uninstaller system that doesn't suck and isn't huge.
\preamble To get all of the latest information about NSIS development: \W{http://nsis.sourceforge.net/}{NSIS Development Page}.\\<br\\>To talk with others in the NSIS community: \W{http://forums.winamp.com/forumdisplay.php?s=&forumid=65}{NSIS forum}.\\<br\\>For more useful functions, NSIS script editors and other software, example scripts, plug-ins and tutorials: \W{http://nsis.sourceforge.net/archive/}{NSIS Archive}.\\<br\\>This HTML Help was created with help of Nike \W{mailto:nike@sendmail.ru}{nike@sendmail.ru}
\copyright Copyright (C) 1999-2003 Nullsoft, Inc.

44
Docs/src/chmlink.js Normal file
View file

@ -0,0 +1,44 @@
function parser(fn) {
var X, Y, sl, a, ra, link;
ra = /:/;
a = location.href.search(ra);
if (a == 2)
X = 14;
else
X = 7;
sl = "\\";
Y = location.href.lastIndexOf(sl) + 1;
fso = new ActiveXObject("Scripting.FileSystemObject");
lfn = location.href.substring(X, Y) + fn;
re = /%20/g;
lfn = lfn.replace(re, " ");
re = /\//g;
lfn = lfn.replace(re, "\\");
if (fso.FolderExists(lfn))
{
var objShell = new ActiveXObject("Shell.Application");
objShell.Open(lfn);
}
else if (fso.FileExists(lfn))
{
htmlre = /\.html?$/;
txtre = /\.txt$/;
if (lfn.match(htmlre) || lfn.match(txtre))
{
re = /\\/g;
lfn = lfn.replace(re, "/");
re = /\ /g;
lfn = lfn.replace(re, "%20");
location.href = 'file:///' + lfn;
}
}
else if (fn.substring(0, 3) == "../")
{
parser(fn.substring(3));
}
else
{
alert(fn.substring(0, 3));
alert(fn + " doesn't exist");
}
}

View file

@ -9,7 +9,7 @@
\b Added \R{pageex}{PageEx}, \R{pagecallbacks}{PageCallbacks} and \R{adirvar}{DirVar} - it's now a lot easier to add the same page type twice
\b \W{../Contrib/Modern UI/Readme.html}{Modern UI 1.67}: New system & syntax for pages, settings (support for multiple pages of the same type, page specific settings, more customization options etc.), Welcome/Finish pages for uninstaller, \R{alicenseforceselection}{LicenseForceSelection} support, new options for Finish page / language selection dialog, fixes, more
\b \L{../Contrib/Modern UI/Readme.html}{Modern UI 1.67}: New system & syntax for pages, settings (support for multiple pages of the same type, page specific settings, more customization options etc.), Welcome/Finish pages for uninstaller, \R{alicenseforceselection}{LicenseForceSelection} support, new options for Finish page / language selection dialog, fixes, more
\b Full support for RTL languages, including support for LTR and RTL languages in one installer
@ -23,11 +23,11 @@
\b Added \R{asetallowskipfiles}{AllowSkipFiles}: Set whether the user should be able to skip a file when overwriting failed
\b \W{../Contrib/InstallOptions/Readme.html}{InstallOptions 2.2}: Added LINK control, added EXTENDEDSELECT flag for list boxes which replaces MULTISELECT that now acts exactly as the real style flag ([double] click turns on or off selection), fixes
\b \L{../Contrib/InstallOptions/Readme.html}{InstallOptions 2.2}: Added LINK control, added EXTENDEDSELECT flag for list boxes which replaces MULTISELECT that now acts exactly as the real style flag ([double] click turns on or off selection), fixes
\b Added support for standard predefines: $\{__DATE__\}, $\{__TIME__\}, $\{__TIMESTAMP__\}, $\{__FILE__\}, $\{__LINE__\}
\b \W{../Contrib/Makensisw/Readme.txt}{MakeNSISW 2.0}: UI to define symbols, easy access to recent scripts, toolbar, more
\b \L{../Contrib/Makensisw/Readme.txt}{MakeNSISW 2.0}: UI to define symbols, easy access to recent scripts, toolbar, more
\b NLF language files (v6): language specific fonts, RTL and more strings
@ -85,7 +85,7 @@
\\<b\\>Notes:\\</b\\>
\W{../Contrib/Modern UI/Readme.html}{Modern UI 1.67}: Because of the new syntax for pages, remamed of settings and variable names etc., you have to make some changes to your scripts, see the \W{../Contrib/Modern UI/Readme.html}{Modern UI Readme} for details. \\<br\\>
\L{../Contrib/Modern UI/Readme.html}{Modern UI 1.67}: Because of the new syntax for pages, remamed of settings and variable names etc., you have to make some changes to your scripts, see the \L{../Contrib/Modern UI/Readme.html}{Modern UI Readme} for details. \\<br\\>
\R{page}{Custom Pages} now have a leave function. As this parameter is placed before the caption you have to add another "" empty string for the title to work. \\<br\\>
\R{onselchange}{.onSelChange} is no longer called when the components page is created

View file

@ -4,7 +4,7 @@
\c language_file.nlf
Loads a language file for the construction of a language table. All of the language files that come with NSIS are in \W{../Contrib/Language files}{Contrib\\Language Files}
Loads a language file for the construction of a language table. All of the language files that come with NSIS are in \L{../Contrib/Language files}{Contrib\\Language Files}
For ease of use LoadLanguageFile defines $\{LANG_language_file\} as the language id. Use it with \R{langstring}{LangString}, LangDLL and \R{viaddversionkey}{VIAddVersionKey}.
@ -45,9 +45,9 @@ Does the same as \R{langstring}{LangString} only it loads the string from a text
As of version 2 NSIS fully supports multiple languages. An installer can have more than one language. Each string in the installer can be easily translated using \R{langstring}{LangStrings}.
Each installer has one or more language tables which hold references to strings in the strings table. To create a language table all you need to do is use that language. Either use \R{loadlanguagefile}{LoadLanguageFile} or define a \R{langstring}{LangString} and you have built your installer a language table. To make sure all of the inner strings NSIS uses are there you should load a language file using use \R{loadlanguagefile}{LoadLanguageFile}. The strings from the language file will be used as defaults in case you don't define some strings in the script. The language file strings can be used by the script too, not just internally by NSIS. Each string in the language file is assigned to a specific LangString. That LangString's name is listed as a comment just above the string in the English language file for your convenience. The language file is located in \W{../Contrib/Language files}{Contrib\\Language Files}.
Each installer has one or more language tables which hold references to strings in the strings table. To create a language table all you need to do is use that language. Either use \R{loadlanguagefile}{LoadLanguageFile} or define a \R{langstring}{LangString} and you have built your installer a language table. To make sure all of the inner strings NSIS uses are there you should load a language file using use \R{loadlanguagefile}{LoadLanguageFile}. The strings from the language file will be used as defaults in case you don't define some strings in the script. The language file strings can be used by the script too, not just internally by NSIS. Each string in the language file is assigned to a specific LangString. That LangString's name is listed as a comment just above the string in the English language file for your convenience. The language file is located in \L{../Contrib/Language files}{Contrib\\Language Files}.
For an example of usage see \W{../Examples/languages.nsi}{languages.nsi}.
For an example of usage see \L{../Examples/languages.nsi}{languages.nsi}.
\S1{langselection} Language Selection
@ -67,7 +67,7 @@ When the installer starts up it goes through these steps to select the interface
The LangDLL plug-in allows you to give the user an option to choose the language of the installer. Just push the language id ($\{LANG_*\}) and its name for every language in your installer, then the number of languages pushed, the caption, and the text that tells the user to select the language, call the plug-in function named LangDialog, pop the returned value into $LANGUAGE and you're good to go. If the user clicks on the cancel button the return value will be "cancel".
For an example of usage see \W{../Examples/languages.nsi}{languages.nsi}.
For an example of usage see \L{../Examples/languages.nsi}{languages.nsi}.
\S1{rtl} RTL Languages

View file

@ -4,4 +4,4 @@ NSIS 2 makes it is possible to create installers with a custom user interface. T
This new interface also features new pages (Welcome, Finish, Start Menu) and a description area on the components page. The interface and the graphics can be customized using the provided settings.
Using the Modern UI macros and language files, writing scripts with a modern interface is easy.
For more information and documentation see the \W{../Contrib/Modern UI/Readme.html}{Modern UI Readme}.
For more information and documentation see the \L{../Contrib/Modern UI/Readme.html}{Modern UI Readme}.

21
Docs/src/nsis.hhp Normal file
View file

@ -0,0 +1,21 @@
[OPTIONS]
Compatibility=1.1 or later
Compiled file=NSIS.chm
Contents file=toc.hhc
Default Window=Main
Default topic=Contents.html
Display compile progress=Yes
Full-text search=Yes
Index file=ind.hhk
Language=0x409 English (United States)
Title=NSIS Users Manual
[WINDOWS]
Main="NSIS User Manual","toc.hhc","ind.hhk","Contents.html","Contents.html",,,,,0x23520,,0x387e,,0xb0000,,,,,,0
[FILES]
Contents.html
[INFOTYPES]

View file

@ -1,6 +1,6 @@
\H{pages} Pages
Each (non-silent) NSIS installer has a set of pages. Each page can be a NSIS built-in page or a custom page created by a user's function (with \W{../Contrib/InstallOptions/Readme.html}{InstallOptions} for example).
Each (non-silent) NSIS installer has a set of pages. Each page can be a NSIS built-in page or a custom page created by a user's function (with \L{../Contrib/InstallOptions/Readme.html}{InstallOptions} for example).
Using the script you can control the pages' order, appearance, and behavior. You can skip pages, paint them white, force the user to stay in a certain page until a certain condition is met, show a readme page, show custom designed pages for input and more. In this section, you will learn how to control all of the above.

View file

@ -6,7 +6,7 @@
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.
For an example of usage please see the \W{../Examples/one-section.nsi}{one-section.nsi} example.
For an example of usage please see the \L{../Examples/one-section.nsi}{one-section.nsi} example.
\S2{sectiongetflags} SectionGetFlags

View file

@ -183,14 +183,14 @@ Every plug-in's function has its own requirements when it comes to parameters, s
\c InstallOptions::dialog "$PLUGINSDIR\test.ini"
\c NSISdl::download http://download.nullsoft.com/winamp/client/winamp291_lite.exe $R0
The plug-ins that NSIS knows of are listed at the top of the output of the compiler. NSIS searches for plug-ins in the \W{../Plugins/}{Plugins directory} under your NSIS directory and lists all of their available functions. You can use \R{addplugindir}{!addPluginDir} to tell NSIS to search in other directories too.
The plug-ins that NSIS knows of are listed at the top of the output of the compiler. NSIS searches for plug-ins in the \L{../Plugins/}{Plugins directory} under your NSIS directory and lists all of their available functions. You can use \R{addplugindir}{!addPluginDir} to tell NSIS to search in other directories too.
There are several plug-ins that come with the NSIS distribution. \W{../Contrib/InstallOptions/Readme.html}{InstallOptions} is a popular plug-in that allows you to add custom pages to your installer, in combination with the NSIS Page commands (See \R{pages}{Pages}). The \W{../Contrib/StartMenu/Readme.txt}{Startmenu plug-in} provides a page that allows the user to choose a Start Menu folder. There are a lot of plug-ins for different purposes, have a look at the \W{../Contrib/}{Contrib directory} for help files and examples. You can find additional plug-ins at the on-line \W{http://nsis.sf.net/archive/}{NSIS Archive}.
There are several plug-ins that come with the NSIS distribution. \L{../Contrib/InstallOptions/Readme.html}{InstallOptions} is a popular plug-in that allows you to add custom pages to your installer, in combination with the NSIS Page commands (See \R{pages}{Pages}). The \L{../Contrib/StartMenu/Readme.txt}{Startmenu plug-in} provides a page that allows the user to choose a Start Menu folder. There are a lot of plug-ins for different purposes, have a look at the \L{../Contrib/}{Contrib directory} for help files and examples. You can find additional plug-ins at the on-line \W{http://nsis.sf.net/archive/}{NSIS Archive}.
You can also create a plug-in of your own if you know programming. \W{../Contrib/ExDLL}{ExDLL} is the basic plug-in example. As all of the plug-ins packed with NSIS and most of the plug-ins in the archive come with source code you can have a look at the \W{../Contrib/}{Contrib directory} and the on-line \W{http://nsis.sf.net/archive/}{NSIS Archive} for more examples.
You can also create a plug-in of your own if you know programming. \L{../Contrib/ExDLL}{ExDLL} is the basic plug-in example. As all of the plug-ins packed with NSIS and most of the plug-ins in the archive come with source code you can have a look at the \L{../Contrib/}{Contrib directory} and the on-line \W{http://nsis.sf.net/archive/}{NSIS Archive} for more examples.
You can also customize the dialog resources without modifying or recompiling the source code. Use a resource editor to customize one of the \W{../Contrib/UIs/}{UI files} and use the \R{achangeui}{ChangeUI} command to use the customized resources.
You can also customize the dialog resources without modifying or recompiling the source code. Use a resource editor to customize one of the \L{../Contrib/UIs/}{UI files} and use the \R{achangeui}{ChangeUI} command to use the customized resources.
A popular user interface for NSIS is the Modern User Interface, with an interface like the wizards of recent Windows versions. The Modern UI is not only a customized resource file, it has a lots of new interface elements. It features a white header to describe the current step, a description area on the component page, a Finish page that allows you to run the application or reboot the system and more. The Modern UI language files make it easy to create a multilingual installer, because they contain translations for every label in the installer.
The Modern UI has a macro system that inserts the code to handle all the new UI elements, so you only have to insert a few lines of code to use it. For more information, check the \W{../Contrib/Modern UI/Readme.html}{Modern UI Readme} and the \W{../Examples/Modern UI/}{Modern UI Examples}.
The Modern UI has a macro system that inserts the code to handle all the new UI elements, so you only have to insert a few lines of code to use it. For more information, check the \L{../Contrib/Modern UI/Readme.html}{Modern UI Readme} and the \W{../Examples/Modern UI/}{Modern UI Examples}.

View file

@ -104,4 +104,4 @@ Sets the installer
\c hwnd show_state
Sets the visability of a window. Possible show_states are the same as \W{http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/showwindow.asp}{Windows ShowWindow} function. SW_* constants are defined in \W{../Include/WinMessages.nsh}{Include\\WinMessages.nsh}.
Sets the visability of a window. Possible show_states are the same as \W{http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/showwindow.asp}{Windows ShowWindow} function. SW_* constants are defined in \L{../Include/WinMessages.nsh}{Include\\WinMessages.nsh}.

View file

@ -96,7 +96,7 @@ The decimal HWND of the parent window.
\e{$PLUGINSDIR}
The path to a temporary folder created upon the first usage of a plugin or a call to \R{initpluginsdir}{InitPluginsDir}. This folder is automatically deleted when the installer exits. This makes this folder the ideal folder to hold INI files for \W{../Contrib/InstallOptions/Readme.html}{InstallOptions}, bitmaps for the splash plugin, or any other file that a plugin needs to work.
The path to a temporary folder created upon the first usage of a plugin or a call to \R{initpluginsdir}{InitPluginsDir}. This folder is automatically deleted when the installer exits. This makes this folder the ideal folder to hold INI files for \L{../Contrib/InstallOptions/Readme.html}{InstallOptions}, bitmaps for the splash plugin, or any other file that a plugin needs to work.
\S1{varstrings} Variables Used in Strings