Skip to content

Formatting

The command-line usage page covers what you can configure: quotes, indentation, comment style and print width. This page covers the rest — the opinionated part, the rules Ardent always applies.

NSIS is case-insensitive, so OutFile, outfile and OUTFILE all work. Ardent settles on one spelling for you — the canonical one — for instructions, parameters, built-in variables and built-in defines. Names you define yourself keep the casing you gave them.

outFile "demo.exe"
NAME "My Installer"
OutFile "demo.exe"
Name "My Installer"
Section
detailprint "NSIS is installed at ${nsisdir}"
DetailPrint "NSIS is installed at ${NSISDIR}"
SectionEnd

Ardent indents the body of every block and removes indentation that doesn’t belong to one. Blocks nest, so a conditional inside a section is indented twice.

OutFile "demo.exe"
Name "My Installer"
Unicode true
Name "My Installer"
Unicode true
Section
!ifdef CONDITION
DetailPrint "Are we indented?"
!endif
!ifdef CONDITION
DetailPrint "Are we indented?"
!endif
SectionEnd

Ardent separates blocks with a blank line and collapses longer runs of blank lines into one.

OutFile "demo.exe"
# one lonely section
Section
SectionEnd
Function .onInit
FunctionEnd
# one lonely section
Section
SectionEnd
Function .onInit
FunctionEnd
# trim all that whitespace
Function .onAbort
FunctionEnd