Skip to content

Commit

Permalink
Initial upload of plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffory committed Oct 7, 2011
0 parents commit 194be44
Show file tree
Hide file tree
Showing 5 changed files with 156 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.cache
*.sublime-project
11 changes: 11 additions & 0 deletions NSIS.sublime-build
Original file line number Diff line number Diff line change
@@ -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"]
}
}
119 changes: 119 additions & 0 deletions NSIS.tmLanguage
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>comment</key>
<string>
todo:
- get a proper keyword.command list
- highlight functions
</string>
<key>fileTypes</key>
<array>
<string>nsi</string>
<string>nsh</string>
</array>
<key>name</key>
<string>NSIS Installer</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>(\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</string>
<key>name</key>
<string>keyword.compiler.nsis</string>
</dict>
<dict>
<key>match</key>
<string>(\b|^\s*)(?i)(Page|UninstPage|SetCompress|SetCompressor|SetCompressorDictSize|SetCompressorDictSize|SetDatablockOptimize|InstallDir|InstallDirRegKey|SetOutPath|WriteRegStr|WriteRegDWORD|DeleteRegKey|File|RequestExecutionLevel|OutFile|Name)\b</string>
<key>name</key>
<string>keyword.command.nsis</string>
</dict>
<dict>
<key>name</key>
<string>keyword.control.ahk</string>
<key>match</key>
<string>(\b|^\s*)(?i)(\!ifdef|\!ifndef|\!if|\!ifmacrodef|\!ifmacrondef|\!else|\!endif)\b</string>
</dict>
<dict>
<key>begin</key>
<string>"</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.nsis</string>
</dict>
</dict>
<key>end</key>
<string>"</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.nsis</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.double.nsis</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\$\\.</string>
<key>name</key>
<string>constant.character.escape.nsis</string>
</dict>
</array>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.nsis</string>
</dict>
</dict>
<key>match</key>
<string>(;|#).*$\n?</string>
<key>name</key>
<string>comment.line.nsis</string>
</dict>
<dict>
<key>begin</key>
<string>/\*</string>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.nsis</string>
</dict>
</dict>
<key>end</key>
<string>\*/</string>
<key>name</key>
<string>comment.block.nsis</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>match</key>
<dict>
<key>name</key>
<string>keyword.control.import.nsis</string>
</dict>
</dict>
<key>match</key>
<string>(\!include|\!insertmacro)\b</string>
</dict>
</array>
<key>scopeName</key>
<string>source.nsis</string>
<key>uuid</key>
<string>B6872F8A-D31D-11E0-9572-0800200C9A66</string>
</dict>
</plist>
19 changes: 19 additions & 0 deletions nsis_build.bat
Original file line number Diff line number Diff line change
@@ -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."
)
5 changes: 5 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 194be44

Please sign in to comment.