2
0
mirror of https://github.com/sharkdp/bat synced 2024-11-16 21:25:56 +00:00

add test files for NSIS syntax

This commit is contained in:
Jan T. Sott 2023-05-29 13:28:30 +02:00 committed by Martin Nordholts
parent 628ba5d31f
commit f1d6cc7a64
2 changed files with 122 additions and 0 deletions

View File

@ -0,0 +1,61 @@
/*
 * Multi-line
 * Comment
 */
# Single-line comment
; Another-single line comment
; Includes
!include "LogicLib.nsh"
; Defines
!define ARCHITECTURE "x64"
; Compile time command
!echo "Building ${ARCHITECTURE} script"
; Macro definition
!macro SayHello name
 !ifdef name
 !echo "Hello, ${name}"
 !else
 !echo "Hello, world"
 !endif
!macroend
; Macro usage
!insertmacro SayHello "John Doe"
; Settings
Name "installer_name"
OutFile "installer_name.exe"
RequestExecutionLevel user
CRCCheck on
Unicode true
!ifdef ${ARCHITECTURE}
 InstallDir "$PROGRAMFILES64\installer_name"
!else
 InstallDir "$PROGRAMFILES\installer_name"
!endif
; Pages
Page components
Page instfiles
; Functions
Function PrintTestStrings
 DetailPrint "The install button reads $(^InstallBtn)"
 DetailPrint 'Here comes a$\n$\rline-break!'
 DetailPrint `Escape the dollar-sign: $$`
FunctionEnd
; Sections
Section "section_name" section_index
 Call PrintTestStrings 
 ; NSIS plugin call
 nsExec::ExecToLog "calc.exe"
SectionEnd

61
tests/syntax-tests/source/NSIS/test.nsi vendored Normal file
View File

@ -0,0 +1,61 @@
/*
* Multi-line
* Comment
*/
# Single-line comment
; Another-single line comment
; Includes
!include "LogicLib.nsh"
; Defines
!define ARCHITECTURE "x64"
; Compile time command
!echo "Building ${ARCHITECTURE} script"
; Macro definition
!macro SayHello name
!ifdef name
!echo "Hello, ${name}"
!else
!echo "Hello, world"
!endif
!macroend
; Macro usage
!insertmacro SayHello "John Doe"
; Settings
Name "installer_name"
OutFile "installer_name.exe"
RequestExecutionLevel user
CRCCheck on
Unicode true
!ifdef ${ARCHITECTURE}
InstallDir "$PROGRAMFILES64\installer_name"
!else
InstallDir "$PROGRAMFILES\installer_name"
!endif
; Pages
Page components
Page instfiles
; Functions
Function PrintTestStrings
DetailPrint "The install button reads $(^InstallBtn)"
DetailPrint 'Here comes a$\n$\rline-break!'
DetailPrint `Escape the dollar-sign: $$`
FunctionEnd
; Sections
Section "section_name" section_index
Call PrintTestStrings
; NSIS plugin call
nsExec::ExecToLog "calc.exe"
SectionEnd