From 194be447c7b2c9f69a25d886452a8afe50c65433 Mon Sep 17 00:00:00 2001 From: Jeffory Date: Fri, 7 Oct 2011 12:13:15 +1000 Subject: [PATCH] Initial upload of plugin --- .gitignore | 2 + NSIS.sublime-build | 11 +++++ NSIS.tmLanguage | 119 +++++++++++++++++++++++++++++++++++++++++++++ nsis_build.bat | 19 ++++++++ readme.md | 5 ++ 5 files changed, 156 insertions(+) create mode 100644 .gitignore create mode 100644 NSIS.sublime-build create mode 100644 NSIS.tmLanguage create mode 100644 nsis_build.bat create mode 100644 readme.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..215c6f6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.cache +*.sublime-project \ No newline at end of file diff --git a/NSIS.sublime-build b/NSIS.sublime-build new file mode 100644 index 0000000..662cb84 --- /dev/null +++ b/NSIS.sublime-build @@ -0,0 +1,11 @@ +{ + "cmd": ["makensis", "$file"], + "working_dir": "${project_path:${folder}}", + "file_regex": "Error in script \"(...*?)\" on line ([0-9]*)", + "selector" : "source.nsis", + + "windows": + { + "cmd": ["$packages/NSIS/nsis_build.bat", "$file"] + } +} \ No newline at end of file diff --git a/NSIS.tmLanguage b/NSIS.tmLanguage new file mode 100644 index 0000000..f6c2121 --- /dev/null +++ b/NSIS.tmLanguage @@ -0,0 +1,119 @@ + + + + + comment + + todo: + - get a proper keyword.command list + - highlight functions + + fileTypes + + nsi + nsh + + name + NSIS Installer + patterns + + + match + (\b|^\s*)(?i)(\!include|\!addincludedir|\!addplugindir|\!appendfile|\!cd|\!delfile|\!echo|\!error|\!execute|\!packhdr|\!finalize|\!system|\!tempfile|\!warning|\!verbose|\!define|\!undef|\!insertmacro|\!macro|\!macroend|\!searchparse|\!searchreplace)\b + name + keyword.compiler.nsis + + + match + (\b|^\s*)(?i)(Page|UninstPage|SetCompress|SetCompressor|SetCompressorDictSize|SetCompressorDictSize|SetDatablockOptimize|InstallDir|InstallDirRegKey|SetOutPath|WriteRegStr|WriteRegDWORD|DeleteRegKey|File|RequestExecutionLevel|OutFile|Name)\b + name + keyword.command.nsis + + + name + keyword.control.ahk + match + (\b|^\s*)(?i)(\!ifdef|\!ifndef|\!if|\!ifmacrodef|\!ifmacrondef|\!else|\!endif)\b + + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.nsis + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.nsis + + + name + string.quoted.double.nsis + patterns + + + match + \$\\. + name + constant.character.escape.nsis + + + + + captures + + 1 + + name + punctuation.definition.comment.nsis + + + match + (;|#).*$\n? + name + comment.line.nsis + + + begin + /\* + captures + + 0 + + name + punctuation.definition.comment.nsis + + + end + \*/ + name + comment.block.nsis + + + captures + + match + + name + keyword.control.import.nsis + + + match + (\!include|\!insertmacro)\b + + + scopeName + source.nsis + uuid + B6872F8A-D31D-11E0-9572-0800200C9A66 + + diff --git a/nsis_build.bat b/nsis_build.bat new file mode 100644 index 0000000..5fdf0df --- /dev/null +++ b/nsis_build.bat @@ -0,0 +1,19 @@ +@echo off + +set nsis_compiler= + +if %PROCESSOR_ARCHITECTURE%==x86 ( + Set RegQry=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NSIS +) else ( + Set RegQry=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\NSIS +) + +if not defined nsis_compiler ( + for /F "tokens=2*" %%a in ('reg query %RegQry% /v InstallLocation ^|findstr InstallLocation') do set nsis_compiler=%%b +) + +if defined nsis_compiler ( + "%nsis_compiler%\makensis.exe" %1 +) else ( + echo "Error, build system cannot find NSIS! Please reinstall or add it to the batch file variable nsis_compiler." +) \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..ca65d2a --- /dev/null +++ b/readme.md @@ -0,0 +1,5 @@ +# NSIS Bundle for Sublime Text 2 + +## Description + +NSIS (Nullsoft Scriptable Install System) is an open source program/language to create installers. This plugin aids in the creation of such scripts/installers. \ No newline at end of file