Debian Codegraph @

Docs/src/misc.but

raw
1 \S1{miscinst} Miscellaneous Instructions
2
3 \S2{geterrorlevel} GetErrorLevel
4
5 \c user_var(error level output)
6
7 Returns the last error level set by \R{seterrorlevel}{SetErrorLevel} or -1 if it has never been set.
8
9 \c GetErrorLevel $0
10 \c IntOp $0 $0 + 1
11 \c SetErrorLevel $0
12
13 \S2{getinstdirerror} GetInstDirError
14
15 \c user_var(error output)
16
17 Use in the leave function of a directory page. Reads the flag set if '\R{adirverify}{DirVerify leave}' is used. Possible values:
18
19 0: No error
20
21 1: Invalid installation directory
22
23 2: Not enough space on installation drive
24
25 \c !include LogicLib.nsh
26 \c PageEx directory
27 \c DirVerify leave
28 \c PageCallbacks "" "" dirLeave
29 \c PageExEnd
30 \c
31 \c Function dirLeave
32 \c GetInstDirError $0
33 \c ${Switch} $0
34 \c ${Case} 0
35 \c MessageBox MB_OK "valid installation directory"
36 \c ${Break}
37 \c ${Case} 1
38 \c MessageBox MB_OK "invalid installation directory!"
39 \c Abort
40 \c ${Break}
41 \c ${Case} 2
42 \c MessageBox MB_OK "not enough free space!"
43 \c Abort
44 \c ${Break}
45 \c ${EndSwitch}
46 \c FunctionEnd
47
48 \S2{initpluginsdir} InitPluginsDir
49
50 Initializes the plug-ins dir (\R{varconstant}{$PLUGINSDIR}) if not already initialized.
51
52 \c InitPluginsDir
53 \c File /oname=$PLUGINSDIR\image.bmp image.bmp
54
55 \S2{nop} Nop
56
57 Does nothing.
58
59 \S2{seterrorlevel} SetErrorLevel
60
61 \c error_level
62
63 Sets the error level of the installer or uninstaller to \e{error_level}. See \R{errorlevels}{Error Levels} for more information.
64
65 \c IfRebootFlag 0 +2
66 \c SetErrorLevel 4
67
68 \NsisWarnBlockContainerBegin
69 \NsisBlockHeaderWarning -1 is reserved for internal use. Negative numbers should be avoided for compatibility with batch scripts.
70 \NsisWarnBlockContainerEnd
71
72 \S2{setshellvarcontext} SetShellVarContext
73
74 \c \\<b\\>current\\</b\\>|all|lastused
75
76 Sets the context of $SMPROGRAMS and other \R{varconstant}{shell folders}. If set to 'current' (the default), the current user's shell folders are used. If set to 'all', the 'all users' shell folder is used. The all users folder may not be supported on all OSes. If the all users folder is not found, the current user folder will be used. Please take into consideration that a "normal user" has no rights to write in the all users area. Only admins have full access rights to the all users area. You can check this by using the UserInfo plug-in. See Contrib\\UserInfo\\UserInfo.nsi for an example.
77
78 Note that, if used in installer code, this will only affect the installer, and if used in uninstaller code, this will only affect the uninstaller. To affect both, it needs to be used in both.
79
80 \c SetShellVarContext current
81 \c StrCpy $0 $DESKTOP
82 \c SetShellVarContext all
83 \c StrCpy $1 $DESKTOP
84 \c MessageBox MB_OK $0$\n$1
85
86 \S2{sleep} Sleep
87
88 \c sleeptime_in_ms
89
90 Pauses execution in the installer for sleeptime_in_ms milliseconds. sleeptime_in_ms can be a variable, e.g. "$0" or a number, i.e. "4321".
91
92 \c DetailPrint "sleeping..."
93 \c Sleep 3000
94 \c DetailPrint "back to work"