Added \s command from upstream and custom \bold and \html commands

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7325 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2021-09-15 01:41:55 +00:00
parent c06f69163d
commit a0d25ea7ed
16 changed files with 143 additions and 171 deletions

View file

@ -306,11 +306,12 @@ See \W{http://msdn.microsoft.com/en-us/library/dd464660}{MSDN} for more informat
Declare that the installer can handle paths longer than MAX_PATH. Only supported on Windows 10 Anniversary Update and later.
\NsisWarnBlockContainerBegin
\\<b\\>Note: \\</b\\> Instructions like CopyFiles and CreateShortcut do not support long paths!
\NsisBlockHeaderNote
Instructions like CopyFiles and CreateShortcut do not support long paths!
\NsisWarnBlockContainerEnd
\NsisWarnBlockContainerBegin
\\<b\\>Note: \\</b\\> Has no effect if the "Enable Win32 long paths" policy is not enabled.
\NsisBlockHeaderNote Has no effect if the "Enable Win32 long paths" policy is not enabled.
\NsisWarnBlockContainerEnd
\S2{amanifestsupportedos} ManifestSupportedOS

View file

@ -13,7 +13,7 @@ Delete file (which can be a file or wildcard, but should be specified with a ful
\c Delete $INSTDIR\somefile.dat
\NsisWarnBlockContainerBegin
\\<b\\>Warning:\\</b\\> The /REBOOTOK switch requires administrator rights on Windows NT and later.
\NsisBlockHeaderWarning The /REBOOTOK switch requires administrator rights on Windows NT and later.
\NsisWarnBlockContainerEnd
\S2{exec} Exec
@ -86,7 +86,7 @@ Adds file(s) to be extracted to the current output path ($OUTDIR).
\c File /r /x CVS myproject\*.*
\c File /r /x *.res /x *.obj /x *.pch source\*.*
\\<b\\>Note:\\</b\\> when using the \e{/r} switch, both matching directories and files will be searched. This is always done with or without the use of wildcards, even if the given path perfectly matches one directory. That means, the following directory structure:
\s{Note:} When using the \e{/r} switch, both matching directories and files will be searched. This is always done with or without the use of wildcards, even if the given path perfectly matches one directory. That means, the following directory structure:
\c <DIR> something
\c file.dat
@ -120,11 +120,11 @@ If no absolute path is specified the current folder will be used. The current fo
\c Rename $INSTDIR\file.ext $INSTDIR\file.dat
\NsisWarnBlockContainerBegin
\\<b\\>Warning:\\</b\\> The /REBOOTOK switch requires administrator rights on Windows NT and later.
\NsisBlockHeaderWarning The /REBOOTOK switch requires administrator rights on Windows NT and later.
\NsisWarnBlockContainerEnd
\NsisWarnBlockContainerBegin
\\<b\\>Warning:\\</b\\> Files cannot be moved from one drive to another if a reboot is required.
\NsisBlockHeaderWarning Files cannot be moved from one drive to another if a reboot is required.
\NsisWarnBlockContainerEnd
\S2{reservefile} ReserveFile
@ -160,11 +160,11 @@ The next example will succeed in deleting the directory.
\c RMDir $TEMP\dir
\NsisWarnBlockContainerBegin
\\<b\\>Warning:\\</b\\> Using \e{RMDir /r $INSTDIR} in the uninstaller is not safe. Though it is unlikely, the user might select to install to the root of the Program Files folder and this command would wipe out the entire Program Files folder, including all other installed programs! The user can also put other files in the installation folder and wouldn't expect them to get deleted along with the program. Solutions are \W{https://nsis.sourceforge.io/Uninstall_only_installed_files}{available} for easily uninstalling only files which were installed by the installer.
\NsisBlockHeaderWarning Using \e{RMDir /r $INSTDIR} in the uninstaller is not safe. Though it is unlikely, the user might select to install to the root of the Program Files folder and this command would wipe out the entire Program Files folder, including all other installed programs! The user can also put other files in the installation folder and wouldn't expect them to get deleted along with the program. Solutions are \W{https://nsis.sourceforge.io/Uninstall_only_installed_files}{available} for easily uninstalling only files which were installed by the installer.
\NsisWarnBlockContainerEnd
\NsisWarnBlockContainerBegin
\\<b\\>Warning:\\</b\\> The /REBOOTOK switch requires administrator rights on Windows NT and later.
\NsisBlockHeaderWarning The /REBOOTOK switch requires administrator rights on Windows NT and later.
\NsisWarnBlockContainerEnd
\S2{setoutpath} SetOutPath

View file

@ -349,6 +349,9 @@ static xhtmlconfig xhtml_configure(paragraph * source)
return ret;
}
#define element_close(rs__, tagname__) rdaddsc((rs__), "</" tagname__ ">")
#define element_open(rs__, tagname__) rdaddsc((rs__), "<" tagname__ ">")
static xhtmlsection *xhtml_new_section(xhtmlsection * last)
{
xhtmlsection *ret = mknew(xhtmlsection);
@ -1737,7 +1740,7 @@ static void xhtml_rdaddwc(rdstringc * rs, word * text, word * end)
keyword *kwl;
xhtmlsection *sect;
indextag *itag;
int ti;
int ti, style, type;
wchar_t *s;
for (; text && text != end; text = text->next)
@ -1887,29 +1890,43 @@ static void xhtml_rdaddwc(rdstringc * rs, word * text, word * end)
rdaddsc(rs, "</a>");
break;
case word_Html:
xhtml_utostr(text->text, &c);
rdaddsc(rs, c);
sfree(c);
break;
case word_Normal:
case word_Emph:
case word_Strong:
case word_Bold:
case word_Code:
case word_WeakCode:
case word_WhiteSpace:
case word_EmphSpace:
case word_StrongSpace:
case word_BoldSpace:
case word_CodeSpace:
case word_WkCodeSpace:
case word_Quote:
case word_EmphQuote:
case word_StrongQuote:
case word_BoldQuote:
case word_CodeQuote:
case word_WkCodeQuote:
assert(text->type != word_CodeQuote &&
text->type != word_WkCodeQuote);
if (towordstyle(text->type) == word_Emph &&
(attraux(text->aux) == attr_First ||
attraux(text->aux) == attr_Only))
rdaddsc(rs, "<em>");
else if ((towordstyle(text->type) == word_Code
|| towordstyle(text->type) == word_WeakCode)
&& (attraux(text->aux) == attr_First
|| attraux(text->aux) == attr_Only))
rdaddsc(rs, "<code>");
style = towordstyle(text->type);
type = removeattr(text->type);
switch((attraux(text->aux) == attr_First || attraux(text->aux) == attr_Only) ? style : word_NotWordType)
{
case word_Emph: element_open(rs, "em"); break;
case word_Strong: element_open(rs, "strong"); break;
case word_Bold: element_open(rs, "b"); break;
case word_Code: element_open(rs, "code"); break;
case word_WeakCode: element_open(rs, "code"); break;
}
if (removeattr(text->type) == word_Normal)
{
@ -1951,15 +1968,14 @@ static void xhtml_rdaddwc(rdstringc * rs, word * text, word * end)
rdaddsc(rs, "&quot;");
}
if (towordstyle(text->type) == word_Emph &&
(attraux(text->aux) == attr_Last ||
attraux(text->aux) == attr_Only))
rdaddsc(rs, "</em>");
else if ((towordstyle(text->type) == word_Code
|| towordstyle(text->type) == word_WeakCode)
&& (attraux(text->aux) == attr_Last
|| attraux(text->aux) == attr_Only))
rdaddsc(rs, "</code>");
switch((attraux(text->aux) == attr_Last || attraux(text->aux) == attr_Only) ? style : word_NotWordType)
{
case word_Emph: element_close(rs, "em"); break;
case word_Strong: element_close(rs, "strong"); break;
case word_Bold: element_close(rs, "b"); break;
case word_Code: element_close(rs, "code"); break;
case word_WeakCode: element_close(rs, "code"); break;
}
break;
}
}

View file

@ -1,7 +1,7 @@
#ifndef HALIBUT_HALIBUT_H
#define HALIBUT_HALIBUT_H
#ifdef _WIN32
#if defined(_WIN32) && !defined(_CRT_SECURE_NO_DEPRECATE)
#define _CRT_SECURE_NO_DEPRECATE 1
#endif
@ -136,16 +136,22 @@ enum {
/* ORDERING CONSTRAINT: these normal-word types ... */
word_Normal,
word_Emph,
word_Strong,
word_Bold,
word_Code, /* monospaced; `quoted' in text */
word_WeakCode, /* monospaced, normal in text */
/* ... must be in the same order as these space types ... */
word_WhiteSpace, /* text is NULL or ignorable */
word_EmphSpace, /* WhiteSpace when emphasised */
word_StrongSpace, /* WhiteSpace when strong */
word_BoldSpace,
word_CodeSpace, /* WhiteSpace when code */
word_WkCodeSpace, /* WhiteSpace when weak code */
/* ... and must be in the same order as these quote types ... */
word_Quote, /* text is NULL or ignorable */
word_EmphQuote, /* Quote when emphasised */
word_StrongQuote, /* Quote when strong */
word_BoldQuote,
word_CodeQuote, /* (can't happen) */
word_WkCodeQuote, /* (can't happen) */
/* END ORDERING CONSTRAINT */
@ -157,7 +163,9 @@ enum {
word_HyperLink, /* (invisible) */
word_HyperEnd, /* (also invisible; no text) */
word_LocalHyperLink, /* (invisible) */
word_FreeTextXref /* \R */
word_FreeTextXref, /* \R */
word_Html,
word_NotWordType /* placeholder value */
};
/* aux values for attributed words */
enum {
@ -175,11 +183,12 @@ enum {
};
#define isattr(x) ( ( (x) > word_Normal && (x) < word_WhiteSpace ) || \
( (x) > word_WhiteSpace && (x) < word_internal_endattrs ) )
#define sameattr(x,y) ( (((x)-(y)) & 3) == 0 )
#define towordstyle(x) ( word_Normal + ((x) & 3) )
#define tospacestyle(x) ( word_WhiteSpace + ((x) & 3) )
#define toquotestyle(x) ( word_Quote + ((x) & 3) )
#define removeattr(x) ( word_Normal + ((x) &~ 3) )
#define NATTRS (word_WhiteSpace - word_Normal)
#define sameattr(x,y) ( (((x)-(y)) % NATTRS) == 0 )
#define towordstyle(x) ( word_Normal + ((x) % NATTRS) )
#define tospacestyle(x) ( word_WhiteSpace + ((x) % NATTRS) )
#define toquotestyle(x) ( word_Quote + ((x) % NATTRS) )
#define removeattr(x) ( word_Normal + ((x)/NATTRS * NATTRS) )
#define attraux(x) ( (x) & attr_mask )
#define quoteaux(x) ( (x) & quote_mask )

View file

@ -5,14 +5,14 @@
#include <stdio.h>
#include "halibut.h"
static char *usagetext[] = {
"halibut.exe file1 [file2 ...]",
static const char *const usagetext[] = {
"halibut [options] file.but [file.but...]",
NULL
};
void usage(void)
{
char **p;
const char *const *p;
for (p = usagetext; *p; p++)
puts(*p);
}

View file

@ -198,6 +198,7 @@ enum {
c_W, /* Web hyperlink */
c_L, /* Relative/local hyperlink */
c_b, /* bulletted list */
c_bold,
c_c, /* code */
c_cfg, /* configuration directive */
c_copyright, /* copyright statement */
@ -205,6 +206,7 @@ enum {
c_date, /* document processing date */
c_define, /* macro definition */
c_e, /* emphasis */
c_html, /* html code */
c_i, /* visible index mark */
c_ii, /* uncapitalised visible index mark */
c_k, /* uncapitalised cross-reference */
@ -214,6 +216,7 @@ enum {
c_preamble, /* document preamble text */
c_q, /* quote marks */
c_rule, /* horizontal rule */
c_s, /* strong */
c_title, /* document title */
c_u, /* aux field is char code */
c_versionid /* document RCS id */
@ -223,6 +226,9 @@ enum {
(c) == c_c ? word_Code : \
(c) == c_cw ? word_WeakCode : \
(c) == c_e ? word_Emph : \
(c) == c_s ? word_Strong : \
(c) == c_bold ? word_Bold : \
(c) == c_html ? word_Html /* does c_html belong here? */ : \
word_Normal
@ -265,116 +271,47 @@ static void match_kw(token * tok)
char const *name;
int id;
} keywords[] = {
{
"#", c__comment}
, /* comment command (\#) */
{
"-", c__escaped}
, /* nonbreaking hyphen */
{ "#", c__comment }, /* comment command (\#) */
{ "-", c__escaped }, /* nonbreaking hyphen */
{ ".", c__nop },
{
"A", c_A}
, /* appendix heading */
{
"B", c_B}
, /* bibliography entry */
{
"BR", c_BR}
, /* bibliography rewrite */
{
"C", c_C}
, /* chapter heading */
{
"H", c_H}
, /* heading */
{
"I", c_I}
, /* invisible index mark */
{
"IM", c_IM}
, /* index merge/rewrite */
{
"K", c_K}
, /* capitalised cross-reference */
{
"L", c_L}
, /* Relative/local hyperlink */
{
"R", c_R}
, /* free text cross-reference */
{
"U", c_U}
, /* unnumbered-chapter heading */
{
"W", c_W}
, /* Web hyperlink */
{
"\\", c__escaped}
, /* escaped backslash (\\) */
{
"_", c__nbsp}
, /* nonbreaking space (\_) */
{
"b", c_b}
, /* bulletted list */
{
"c", c_c}
, /* code */
{
"cfg", c_cfg}
, /* configuration directive */
{
"copyright", c_copyright}
, /* copyright statement */
{
"cw", c_cw}
, /* weak code */
{
"date", c_date}
, /* document processing date */
{
"define", c_define}
, /* macro definition */
{
"e", c_e}
, /* emphasis */
{ "A", c_A }, /* appendix heading */
{ "B", c_B }, /* bibliography entry */
{ "BR", c_BR }, /* bibliography rewrite */
{ "C", c_C }, /* chapter heading */
{ "H", c_H }, /* heading */
{ "I", c_I }, /* invisible index mark */
{ "IM", c_IM }, /* index merge/rewrite */
{ "K", c_K }, /* capitalised cross-reference */
{ "L", c_L }, /* Relative/local hyperlink */
{ "R", c_R }, /* free text cross-reference */
{ "U", c_U }, /* unnumbered-chapter heading */
{ "W", c_W }, /* Web hyperlink */
{ "\\", c__escaped }, /* escaped backslash (\\) */
{ "_", c__nbsp }, /* nonbreaking space (\_) */
{ "b", c_b }, /* bulletted list */
{ "bold", c_bold },
{ "c", c_c }, /* code */
{ "cfg", c_cfg }, /* configuration directive */
{ "copyright", c_copyright }, /* copyright statement */
{ "cw", c_cw } , /* weak code */
{ "date", c_date }, /* document processing date */
{ "define", c_define }, /* macro definition */
{ "e", c_e }, /* emphasis */
{ "hackunixnow", c__midparacmd_unixnow },
{
"i", c_i}
, /* visible index mark */
{
"ii", c_ii}
, /* uncapitalised visible index mark */
{
"k", c_k}
, /* uncapitalised cross-reference */
{
"n", c_n}
, /* numbered list */
{
"nocite", c_nocite}
, /* bibliography trickery */
{
"preamble", c_preamble}
, /* document preamble text */
{
"q", c_q}
, /* quote marks */
{
"rule", c_rule}
, /* horizontal rule */
{
"title", c_title}
, /* document title */
{
"versionid", c_versionid}
, /* document RCS id */
{
"{", c__escaped}
, /* escaped lbrace (\{) */
{
"}", c__escaped}
, /* escaped rbrace (\}) */
{ "html", c_html },
{ "i", c_i }, /* visible index mark */
{ "ii", c_ii }, /* uncapitalised visible index mark */
{ "k", c_k }, /* uncapitalised cross-reference */
{ "n", c_n }, /* numbered list */
{ "nocite", c_nocite }, /* bibliography trickery */
{ "preamble", c_preamble }, /* document preamble text */
{ "q", c_q }, /* quote marks */
{ "rule", c_rule }, /* horizontal rule */
{ "s", c_s }, /* strong */
{ "title", c_title }, /* document title */
{ "versionid", c_versionid }, /* document RCS id */
{ "{", c__escaped }, /* escaped lbrace (\{) */
{ "}", c__escaped }, /* escaped rbrace (\}) */
};
int i, j, k, c;
@ -1328,7 +1265,7 @@ static void read_file(paragraph *** ret, input * in, indexdata * idx, tree234 *m
*/
dtor(t), t = get_token(in);
/*
* Special cases: \W{}\c, \W{}\e, \W{}\cw
* Special cases: \W{}\c, \W{}\e, \W{}\s, \W{}\bold \W{}\cw
*/
sitem = mknew(struct stack_item);
sitem->type = stack_hyper;
@ -1354,18 +1291,27 @@ static void read_file(paragraph *** ret, input * in, indexdata * idx, tree234 *m
}
}
break;
case c_html:
if (style != word_Normal) fatal(err_nestedstyles, &t.pos);
type = t.cmd, dtor(t), t = get_token(in);
if (t.type == tok_lbrace || (error(err_explbr, &t.pos), FALSE))
{
style = word_Html, spcstyle = tospacestyle(style);
stack_item_push(parsestk, stack_style);
}
break;
case c_c:
case c_cw:
case c_e:
case c_s:
case c_bold:
type = t.cmd;
if (style != word_Normal)
{
error(err_nestedstyles, &t.pos);
/* Error recovery: eat lbrace, push nop. */
dtor(t), t = get_token(in);
sitem = mknew(struct stack_item);
sitem->type = stack_nop;
stk_push(parsestk, sitem);
stack_item_push(parsestk, stack_nop);
}
dtor(t), t = get_token(in);
if (t.type != tok_lbrace)
@ -1373,11 +1319,8 @@ static void read_file(paragraph *** ret, input * in, indexdata * idx, tree234 *m
error(err_explbr, &t.pos);
} else
{
style = getcmdstyle(type);
spcstyle = tospacestyle(style);
sitem = mknew(struct stack_item);
sitem->type = stack_style;
stk_push(parsestk, sitem);
style = getcmdstyle(type), spcstyle = tospacestyle(style);
stack_item_push(parsestk, stack_style);
}
break;
case c_i:
@ -1389,15 +1332,13 @@ static void read_file(paragraph *** ret, input * in, indexdata * idx, tree234 *m
error(err_nestedindex, &t.pos);
/* Error recovery: eat lbrace, push nop. */
dtor(t), t = get_token(in);
sitem = mknew(struct stack_item);
sitem->type = stack_nop;
stk_push(parsestk, sitem);
stack_item_push(parsestk, stack_nop);
}
sitem = mknew(struct stack_item);
sitem->type = stack_idx;
dtor(t), t = get_token(in);
/*
* Special cases: \i\c, \i\e, \i\cw
* Special cases: \i\c, \i\e, \i\s, \i\bold, \i\cw
*/
wd.fpos = t.pos;
if (t.type == tok_cmd && (tmpstyle = getcmdstyle(t.cmd)))

View file

@ -315,6 +315,8 @@ static void dbg_prtwordlist(int level, word * w)
printf("\"");
} else
printf("(no text)");
if (w->breaks)
printf(" [breaks]");
if (w->alt)
{
printf(" alt = {\n");

View file

@ -30,5 +30,8 @@
\define{NsisWarnBlockContainerEnd} \\</div\\>
\define{NsisBlockHeaderExeheadU} \\<b\\>Unicode: \\</b\\>
\define{NsisBlockHeaderWarning} \s{Warning:}
\define{NsisBlockHeaderNote} \s{Note:}
\define{NsisBlockHeaderExeheadU} \s{Unicode:}

View file

@ -174,7 +174,7 @@ Checks if \R{setshellvarcontext}{SetShellVarContext} is set to \e{all}.
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.
\NsisBlockHeaderWarning Do not call this in [un].onInit because the language file has not been fully initialized.
\NsisWarnBlockContainerEnd
\S2{intcmp} IntCmp

View file

@ -109,7 +109,7 @@ The Windows temp directory could be located on any volume, so you cannot use thi
\b Installs a DLL built for Windows x64.
\b \\<b\\>Warning:\\</b\\> This resets \R{setregview}{SetRegView} and file system redirection.
\b \s{Warning:} This resets \R{setregview}{SetRegView} and file system redirection.
\S2{} LIBRARY_SHELL_EXTENSION
@ -139,7 +139,7 @@ The Windows temp directory could be located on any volume, so you cannot use thi
\b If you need to support Windows 9x/ME, you can only use short filenames (8.3).
\b \\<b\\>Warning:\\</b\\> Always use redistributable files when deploying DLLs, never copy files from your system directory!
\b \s{Warning:} Always use redistributable files when deploying DLLs, never copy files from your system directory!
\S1{library_install_examples} Example
@ -233,7 +233,7 @@ Location of the library
\b Uninstalls a DLL built for Windows x64.
\b \\<b\\>Warning:\\</b\\> This resets \R{setregview}{SetRegView} and file system redirection.
\b \s{Warning:} This resets \R{setregview}{SetRegView} and file system redirection.
\S2{} LIBRARY_SHELL_EXTENSION

View file

@ -66,7 +66,7 @@ Sets the error level of the installer or uninstaller to \e{error_level}. See \R{
\c SetErrorLevel 4
\NsisWarnBlockContainerBegin
\\<b\\>Warning:\\</b\\> -1 is reserved for internal use. Negative numbers should be avoided for compatibility with batch scripts.
\NsisBlockHeaderWarning -1 is reserved for internal use. Negative numbers should be avoided for compatibility with batch scripts.
\NsisWarnBlockContainerEnd
\S2{setshellvarcontext} SetShellVarContext

View file

@ -143,7 +143,7 @@ Gets the size of the section specified by section_index and stores the value in
\c inst_type_idx
Sets the current \R{ainsttype}{InstType}. inst_type_idx should be between 0 and 31. The error flag is \\<b\\>not\\</b\\> set if an out of range \R{ainsttype}{InstType} was used.
Sets the current \R{ainsttype}{InstType}. inst_type_idx should be between 0 and 31. The error flag is \s{not} set if an out of range \R{ainsttype}{InstType} was used.
\S2{sgetcurinsttype} GetCurInstType

View file

@ -145,7 +145,7 @@ Sets the text and background color of a static control, edit control, button or
\c FunctionEnd
\NsisWarnBlockContainerBegin
\\<b\\>Warning:\\</b\\> Setting the background color of check boxes to \c{transparent} may not function properly when using \c{\R{axpstyle}{XPStyle} on}. The background may be completely black instead of transparent when using certain Windows themes. The text color might also be ignored when Visual Styles are enabled.
\NsisBlockHeaderWarning Setting the background color of check boxes to \c{transparent} may not function properly when using \c{\R{axpstyle}{XPStyle} on}. The background may be completely black instead of transparent when using certain Windows themes. The text color might also be ignored when Visual Styles are enabled.
\NsisWarnBlockContainerEnd
\S2{setsilent} SetSilent

View file

@ -11,4 +11,4 @@ A special \R{ssection}{Section} named 'Uninstall' must be created in order to ge
The first \R{delete}{Delete} instruction works (deleting the uninstaller), because the uninstaller is transparently copied to the system temporary directory for the uninstall.
Note that in uninstaller code, $INSTDIR contains the directory where the uninstaller lies. It does \\<b\\>not\\</b\\> necessarily contain the same value it contained in the installer.
Note that in uninstaller code, $INSTDIR contains the directory where the uninstaller lies. It does \s{not} necessarily contain the same value it contained in the installer.

View file

@ -33,12 +33,12 @@ Example:
\c WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MyProduct" "DisplayName" "Application Name"
\c WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MyProduct" "UninstallString" '"$INSTDIR\uninst.exe"'
\\<b\\>Required values\\</b\\>
\s{Required values:}
\e{DisplayName} (string) - Name of the application \\<br\\>
\e{UninstallString} (string) - Path and filename of the uninstaller. You should \\<b\\>always\\</b\\> quote the path.
\e{UninstallString} (string) - Path and filename of the uninstaller. You should \s{always} quote the path.
\\<b\\>Optional values\\</b\\>
\s{Optional values:}
Some of the following values will not be used by older Windows versions.

View file

@ -33,7 +33,7 @@ Registers. These variables can be used just like user variables, but are usually
The installation directory ($INSTDIR is modifiable using \R{StrCpy}{StrCpy}, \R{readregstr}{ReadRegStr}, \R{readinistr}{ReadINIStr}, etc. - This could be used, for example, in the \R{oninit}{.onInit} function to do a more advanced detection of install location).
Note that in uninstaller code, $INSTDIR contains the directory where the uninstaller lies. It does \\<b\\>not\\</b\\> necessarily contain the same value it contained in the installer. For example, if you write the uninstaller to $WINDIR and the user doesn't move it, $INSTDIR will be $WINDIR in the uninstaller. If you write the uninstaller to another location, you should keep the installer's $INSTDIR in the registry or an alternative storing facility and read it in the uninstaller.
Note that in uninstaller code, $INSTDIR contains the directory where the uninstaller lies. It does \s{not} necessarily contain the same value it contained in the installer. For example, if you write the uninstaller to $WINDIR and the user doesn't move it, $INSTDIR will be $WINDIR in the uninstaller. If you write the uninstaller to another location, you should keep the installer's $INSTDIR in the registry or an alternative storing facility and read it in the uninstaller.
\e{$OUTDIR}