Reference/!include: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
(Created page with "=!include= [/NONFATAL] file This command will include 'file' as if it was part of the original script. Note that if a file is included in another directory, the current dir...")
 
m (wiki link, html <code> format)
 
(One intermediate revision by one other user not shown)
Line 3: Line 3:
  [/NONFATAL] file
  [/NONFATAL] file


This command will include 'file' as if it was part of the original script. Note that if a file is included in another directory, the current directory is still where the script was compiled from (not where the included file resides). If the compiler can't find the file it will look for it in every include directory. See [http://nsis.sourceforge.net/Reference/!addincludedir !addincludedir] for more information. If the /nonfatal switch is used and no files are found, a warning will be issued instead of an error.
This command will include 'file' as if it was part of the original script. Note that if a file is included in another directory, the current directory is still where the script was compiled from (not where the included file resides). If the compiler can't find the file it will look for it in every include directory. See [[Reference/!addincludedir|!addincludedir]] for more information. If the <code>/NONFATAL</code> switch is used and no files are found, a warning will be issued instead of an error.


<highlight-nsis>!include WinMessages.nsh
<highlight-nsis>!include WinMessages.nsh
Line 10: Line 10:
!include ..\MyConfig.nsh
!include ..\MyConfig.nsh
!include /NONFATAL file_that_may_exist_or_not.nsh</highlight-nsis>
!include /NONFATAL file_that_may_exist_or_not.nsh</highlight-nsis>
''Command introduced with NSIS v1.1d''

Latest revision as of 11:14, 22 November 2017

!include

[/NONFATAL] file

This command will include 'file' as if it was part of the original script. Note that if a file is included in another directory, the current directory is still where the script was compiled from (not where the included file resides). If the compiler can't find the file it will look for it in every include directory. See !addincludedir for more information. If the /NONFATAL switch is used and no files are found, a warning will be issued instead of an error.

!include WinMessages.nsh
!include Library.nsh
!include C:\MyConfig.nsi
!include ..\MyConfig.nsh
!include /NONFATAL file_that_may_exist_or_not.nsh

Command introduced with NSIS v1.1d