2002-11-15 18:45:47 +00:00
\S1{miscinst} Miscellaneous Instructions
2002-09-18 16:34:39 +00:00
2004-09-25 10:49:08 +00:00
\S2{geterrorlevel} GetErrorLevel
\c user_var(error level output)
2016-03-27 23:24:43 +00:00
Returns the last error level set by \R{seterrorlevel}{SetErrorLevel} or -1 if it has never been set.
2004-09-25 10:49:08 +00:00
2004-10-10 18:41:43 +00:00
\c GetErrorLevel $0
\c IntOp $0 $0 + 1
\c SetErrorLevel $0
2003-12-14 17:59:00 +00:00
\S2{getinstdirerror} GetInstDirError
\c user_var(error output)
Use in the leave function of a directory page. Reads the flag set if '\R{adirverify}{DirVerify leave}' is used. Possible values:
0: No error
1: Invalid installation directory
2: Not enough space on installation drive
2004-10-10 18:41:43 +00:00
\c !include LogicLib.nsh
\c PageEx directory
\c DirVerify leave
\c PageCallbacks "" "" dirLeave
\c PageExEnd
\c
\c Function dirLeave
\c GetInstDirError $0
\c ${Switch} $0
\c ${Case} 0
\c MessageBox MB_OK "valid installation directory"
\c ${Break}
\c ${Case} 1
\c MessageBox MB_OK "invalid installation directory!"
\c Abort
\c ${Break}
\c ${Case} 2
\c MessageBox MB_OK "not enough free space!"
\c Abort
\c ${Break}
\c ${EndSwitch}
\c FunctionEnd
2002-11-15 20:21:58 +00:00
\S2{initpluginsdir} InitPluginsDir
2005-07-29 15:08:32 +00:00
Initializes the plug-ins dir (\R{varconstant}{$PLUGINSDIR}) if not already initialized.
2002-11-15 20:21:58 +00:00
2004-10-10 18:41:43 +00:00
\c InitPluginsDir
\c File /oname=$PLUGINSDIR\image.bmp image.bmp
2006-02-11 18:54:04 +00:00
\S2{nop} Nop
Does nothing.
2004-09-25 10:49:08 +00:00
\S2{seterrorlevel} SetErrorLevel
\c error_level
Sets the error level of the installer or uninstaller to \e{error_level}. See \R{errorlevels}{Error Levels} for more information.
2004-10-10 18:41:43 +00:00
\c IfRebootFlag 0 +2
\c SetErrorLevel 4
2021-01-15 16:27:50 +00:00
\NsisWarnBlockContainerBegin
\\<b\\>Warning:\\</b\\> -1 is reserved for internal use. Negative numbers should be avoided for compatibility with batch scripts.
\NsisWarnBlockContainerEnd
2002-11-15 18:45:47 +00:00
\S2{setshellvarcontext} SetShellVarContext
2002-09-18 16:34:39 +00:00
2021-08-26 12:57:34 +00:00
\c \\<b\\>current\\</b\\>|all|lastused
2002-09-18 16:34:39 +00:00
2017-06-23 01:11:30 +00:00
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.
2002-09-18 16:34:39 +00:00
2005-11-24 12:18:23 +00:00
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.
2004-10-10 18:41:43 +00:00
\c SetShellVarContext current
\c StrCpy $0 $DESKTOP
\c SetShellVarContext all
\c StrCpy $1 $DESKTOP
\c MessageBox MB_OK $0$\n$1
2002-11-15 18:45:47 +00:00
\S2{sleep} Sleep
2002-10-01 13:53:23 +00:00
2002-10-26 19:23:10 +00:00
\c sleeptime_in_ms
2002-10-01 13:53:23 +00:00
2019-02-11 17:45:47 +00:00
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".
2004-10-10 18:41:43 +00:00
\c DetailPrint "sleeping..."
\c Sleep 3000
\c DetailPrint "back to work"