XhmikosR / notepad2-mod

LOOKING FOR DEVELOPERS - Notepad2-mod, a Notepad2 fork, a fast and light-weight Notepad-like text editor with syntax highlighting

Home Page:https://xhmikosr.github.io/notepad2-mod/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:
  1. !addplugindir
    Now supports /x86-ansi|/x86-unicode switches.
  2. !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.
  3. !if
    Now supports /fileexists switch.
  4. !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:
  1. !finalize
  2. !getdllversion
  3. !makensis
  4. !macroundef
  • predefined macro added:
  1. ${NSIS_PACKEDVERSION}
    ${NSIS_CHAR_SIZE}
    ${NSIS_PTR_SIZE}
    ...and more
    Notepad2-mod already supports any macro name (a word within "${" & "}") being high-lighted.
  2. ${U+1}...${U+10FFFF}
    This syntax represents an Unicode (UCS-4) character, should be highlighted.
    Notepad2-mod doesn't support.
  • Installer properties instructions added:
  1. VIFileVersion
  2. Unicode true|false
  3. ManifestSupportedOS none|all|WinVista|Win7|Win8|Win8.1|Win10
  4. ReserveFile
    Now supports /plugin switch.
  • Run-time instructions with new switches added:
  1. CreateShortcut
    Now supports /NoWorkingDir switch.

Try this build.

For ${U+1}...${U+10FFFF} check if Scite works; if not report the issue to Scintilla.

Notepad2-mod.zip

  • !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.