NSIS syntax needs update
KohChia opened this issue · comments
NSIS 3.0 has been released recently, some new command added:
Pre-processor commands:
- !getdllversion
Some new commands and options:
- VIFileVersion
- Unicode true|false
- ManifestSupportedOS none|all|WinVista|Win7|Win8|Win8.1|Win10
I only found these, maybe more.
If you go through all of them and list them I could add them. Alternatively, you could make a PR.
I found almost all the them through changelog, NSIS manual & source code.
- Pre-processor instructions with new switches added:
- !addplugindir
Now supports /x86-ansi|/x86-unicode switches. - !include
Now supports /NONFATAL & /CHARSET=ACP|OEM|CP#|UTF8|UTF16LE|UTF16BE switches.
The switch "/NONFATAL" has been included already, for some other instructions also supports.
Where "#" represents a decimal number, e.g.: CP936. - !if
Now supports /fileexists switch. - !appendfile
Now supports /RawNL & /CHARSET=ACP|OEM|CP#|UTF8[SIG]|UTF16<LE|BE>[BOM] switches.
By viewing NSIS 3.0 source code, I found it supports these words after "/CHARSET":
ACP, OEM, CP#, UTF8, UTF8SIG, UTF8BOM, UTF16LE, UTF16LEBOM, UTF16BE, UTF16BEBOM.
The meaning of "CP#" is the same as above.
All instructions & switches are case insensitive in NSIS script all along.
- Pre-processor instructions added:
- !finalize
- !getdllversion
- !makensis
- !macroundef
- predefined macro added:
- ${NSIS_PACKEDVERSION}
${NSIS_CHAR_SIZE}
${NSIS_PTR_SIZE}
...and more
Notepad2-mod already supports any macro name (a word within "${" & "}") being high-lighted. - ${U+1}...${U+10FFFF}
This syntax represents an Unicode (UCS-4) character, should be highlighted.
Notepad2-mod doesn't support.
- Installer properties instructions added:
- VIFileVersion
- Unicode true|false
- ManifestSupportedOS none|all|WinVista|Win7|Win8|Win8.1|Win10
- ReserveFile
Now supports /plugin switch.
- Run-time instructions with new switches added:
- CreateShortcut
Now supports /NoWorkingDir switch.
Try this build.
For ${U+1}...${U+10FFFF}
check if Scite works; if not report the issue to Scintilla.
- !addplugindir [/x86-ansi | /x86-unicode]
"x86-ansi" & "x86-unicode" are not highlighted. - !if [!] /FileExists "X:\path\file.ext"
"fileexists" is not highlighted. - !appendfile [/CHARSET=ACP|OEM|CP#|UTF8[SIG]|UTF16<LE|BE>[BOM]] [/RawNL] file text
"RawNL" is not highlighted. - Unicode true|false
"Unicode" is not highlighted. - CreateShortcut [/NoWorkingDir] link.lnk target.ext [args [icon [index [show [hotkey [desc]]]]]]
"NoWorkingDir" is not highlighted. - ${U+1} ... ${U+10FFFF}
Highlighted in quotation marks, for example: `${U+1}`, '${U+10FF}', "${U+10FFFF}".
Not highlighted without any quotation marks.
Please paste a test script I can use for testing.
On Sep 7, 2016 12:46, "550771955" notifications@github.com wrote:
!addplugindir [/x86-ansi | /x86-unicode]
"x86-ansi" & "x86-unicode" are not highlighted.!if [!] /FileExists "X:\path\file.ext"
"fileexists" is not highlighted.!appendfile [/CHARSET=ACP|OEM|CP#|UTF8[SIG]|UTF16[BOM]] [/RawNL] file
text
"RawNL" is not highlighted.Unicode true|false
"Unicode" is not highlighted.CreateShortcut [/NoWorkingDir] link.lnk target.ext [args [icon [index
[show [hotkey [desc]]]]]]
"NoWorkingDir" is not highlighted.${U+1} ... ${U+10FFFF}
Highlighted in quotations marks, for example: '${U+1}', '${U+10FF}',
"${U+10FFFF}".
Not highlighted without any quotations marks.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#165 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAVVtczxQY1mzQIGwtuf9zJX5kHprD5_ks5qnogDgaJpZM4Jiuz9
.
!addplugindir /x86-ansi ".\plugin_x86"
!addplugindir /x86-unicode ".\plugin_x64"
!include /NONFATAL /CHARSET=OEM ".\example.nsh"
!if /fileexists ".\dummy.txt"
!echo "dummy.txt exists!"
!endif
!appendfile /RawNL /CHARSET=ACP "${__FILE__}" "XPStyle on$\n"
!finalize "echo done!"
!getdllversion "$%windir%\notepad.exe" VERSION
!makensis "/DMACRO=1 ${__FILE__}"
!macroundef SampleMacroName
Unicode true|false
VIFileVersion 1.0.0.0
ManifestSupportedOS none|all|WinVista|Win7|Win8|Win8.1|Win10
ReserveFile /plugin "System.dll"
Section "-Install"
DetailPrint `${NSIS_VERSION}`
DetailPrint '${NSIS_PTR_SIZE}'
DetailPrint "${NSIS_CHAR_SIZE}"
DetailPrint `${U+1}`
DetailPrint '${U+10FF}'
DetailPrint "${U+10FFFF}"
DetailPrint ${NSIS_VERSION}
DetailPrint ${NSIS_PTR_SIZE}
DetailPrint ${NSIS_CHAR_SIZE}
DetailPrint ${U+1}
DetailPrint ${U+10FF}
DetailPrint ${U+10FFFF}
CreateShortcut /NoWorkingDir "$DESKTOP\Notepad.lnk" "$WINDIR\notepad.exe"
SectionEnd
The script is just for testing, it may not be compiled successfully.
For the remaining issues, report them to Scintilla with samples.