├── .gitattributes ├── .gitignore ├── .no-sublime-package ├── LICENSE ├── Miscellaneous.tmPreferences ├── NSIS.sublime-build ├── NSIS.sublime-syntax ├── README.md └── scripts ├── build.cmd └── build.sh /.gitattributes: -------------------------------------------------------------------------------- 1 | screenshots/ export-ignore -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.cache 2 | *.sublime-project -------------------------------------------------------------------------------- /.no-sublime-package: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SublimeText/NSIS/ecc831414f48e9b8ef6ce0f6a7e4b1ad00d2c3bc/.no-sublime-package -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2014 Sublime HQ Pty Ltd 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Miscellaneous.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Miscellaneous 7 | scope 8 | source.nsis 9 | settings 10 | 11 | shellVariables 12 | 13 | 14 | name 15 | TM_COMMENT_START 16 | value 17 | ; 18 | 19 | 20 | name 21 | TM_COMMENT_START_2 22 | value 23 | /* 24 | 25 | 26 | name 27 | TM_COMMENT_END_2 28 | value 29 | */ 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /NSIS.sublime-build: -------------------------------------------------------------------------------- 1 | { 2 | "cmd": ["sh", "$packages/NSIS/scripts/build.sh", "$file"], 3 | "working_dir": "${project_path:${folder}}", 4 | "file_regex": ".*rror in script:? \"(^\"]+)\" on line ([0-9]+)", 5 | "selector": "source.nsis", 6 | 7 | "windows": { 8 | "cmd": ["$packages\\NSIS\\scripts\\build.cmd", "$file"] 9 | }, 10 | 11 | "variants": [ 12 | { 13 | "name": "strict", 14 | "cmd": ["sh", "$packages/NSIS/scripts/build.sh", "-WX", "$file"], 15 | "file_regex": ".*arning: .* \\((...*?):(\\d+)\\)", 16 | "windows": { 17 | "cmd": ["$packages\\NSIS\\scripts\\build.cmd", "/WX", "$file"] 18 | } 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /NSIS.sublime-syntax: -------------------------------------------------------------------------------- 1 | %YAML 1.2 2 | --- 3 | # http://www.sublimetext.com/docs/3/syntax.html 4 | name: NSIS 5 | file_extensions: 6 | - nsi 7 | - nsh 8 | - bnsi 9 | - bnsh 10 | - nsdinc 11 | scope: source.nsis 12 | variables: 13 | dollar: '\${2}\w*' 14 | escaped: '\$\\.' 15 | uservar: '\$\w[\w\.]*' 16 | variable: '(?i)\$(\{__DATE__\}|\{__FILE__\}|\{__FILEDIR__\}|\{__LINE__\}|\{__TIME__\}|\{__TIMESTAMP__\}|ADMINTOOLS|APPDATA|CDBURN_AREA|CMDLINE|COMMONFILES|COOKIES|DESKTOP|DOCUMENTS|EXEDIR|EXEFILE|EXEPATH|FAVORITES|FONTS|HISTORY|HWNDPARENT|INSTDIR|INTERNET_CACHE|LANGUAGE|LOCALAPPDATA|MUSIC|NETHOOD|NSIS_MAX_STRLEN|NSIS_VERSION|NSISDIR|OUTDIR|PICTURES|PLUGINSDIR|PRINTHOOD|PROFILE|PROGRAMFILES(32|64)?|QUICKLAUNCH|RECENT|RESOURCES_LOCALIZED|RESOURCES|SENDTO|SMPROGRAMS|SMSTARTUP|STARTMENU|SYSDIR|TEMP|TEMPLATES|VIDEOS|WINDIR)' 17 | language: '\$\([\!\w\.:\^-]+\)' 18 | definitions: '\$\{[\!\w\.:\^-]+\}' 19 | contexts: 20 | main: 21 | - match: ^\s*(?i)(Abort|AddBrandingImage|AddSize|AllowRootDirInstall|AllowSkipFiles|AutoCloseWindow|BGFont|BGGradient|BrandingText|BringToFront|Call|CallInstDLL|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|CreateDirectory|CreateFont|CreateShortCut|Delete|DeleteINISec|DeleteINIStr|DeleteRegKey|DeleteRegValue|DetailPrint|DetailsButtonText|DirText|DirVar|DirVerify|EnableWindow|EnumRegKey|EnumRegValue|Exch|Exec|ExecShell|ExecShellWait|ExecWait|ExpandEnvStrings|File|FileBufSize|FileClose|FileErrorText|FileOpen|FileRead|FileReadByte|FileReadUTF16LE|FileReadWord|FileWriteUTF16LE|FileSeek|FileWrite|FileWriteByte|FileWriteWord|FindClose|FindFirst|FindNext|FindWindow|FlushINI|GetCurInstType|GetCurrentAddress|GetDlgItem|GetDLLVersion|GetDLLVersionLocal|GetErrorLevel|GetFileTime|GetFileTimeLocal|GetFullPathName|GetFunctionAddress|GetInstDirError|GetKnownFolderPath|GetLabelAddress|GetTempFileName|GetWinVer|Goto|HideWindow|Icon|IfAbort|IfErrors|IfFileExists|IfRebootFlag|IfRtlLanguage|IfShellVarContextAll|IfSilent|InitPluginsDir|InstallButtonText|InstallColors|InstallDir|InstallDirRegKey|InstProgressFlags|InstType|InstTypeGetText|InstTypeSetText|Int64Cmp|Int64CmpU|Int64Fmt|IntCmp|IntCmpU|IntFmt|IntOp|IntPtrCmp|IntPtrCmpU|IntPtrOp|IsWindow|LangString|LicenseBkColor|LicenseData|LicenseForceSelection|LicenseLangString|LicenseText|LoadAndSetImage|LoadLanguageFile|LockWindow|LogSet|LogText|ManifestDPIAware|ManifestLongPathAware|ManifestMaxVersionTested|ManifestSupportedOS|MessageBox|MiscButtonText|Name|Nop|OutFile|Page|PageCallbacks|PEAddResource|PEDllCharacteristics|PERemoveResource|PESubsysVer|Pop|Push|Quit|ReadEnvStr|ReadINIStr|ReadRegDWORD|ReadRegStr|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|SectionGetFlags|SectionGetInstTypes|SectionGetSize|SectionGetText|SectionIn|SectionSetFlags|SectionSetInstTypes|SectionSetSize|SectionSetText|SendMessage|SetAutoClose|SetBrandingImage|SetCompress|SetCompressor|SetCompressorDictSize|SetCtlColors|SetCurInstType|SetDatablockOptimize|SetDateSave|SetDetailsPrint|SetDetailsView|SetErrorLevel|SetErrors|SetFileAttributes|SetFont|SetOutPath|SetOverwrite|SetRebootFlag|SetRegView|SetShellVarContext|SetSilent|ShowInstDetails|ShowUninstDetails|ShowWindow|SilentInstall|SilentUnInstall|Sleep|SpaceTexts|StrCmp|StrCmpS|StrCpy|StrLen|SubCaption|Target|Unicode|UninstallButtonText|UninstallCaption|UninstallIcon|UninstallSubCaption|UninstallText|UninstPage|UnRegDLL|Var|VIAddVersionKey|VIFileVersion|VIProductVersion|WindowIcon|WriteINIStr|WriteRegBin|WriteRegDWORD|WriteRegExpandStr|WriteRegMultiStr|WriteRegNone|WriteRegStr|WriteUninstaller|XPStyle)\b 22 | scope: keyword.nsis 23 | - match: ^\s*(?i)(Function(End)?|Section(End)?|SectionGroup|SectionGroup(End)?|PageEx(End)?)\b 24 | scope: entity.name.section.nsis 25 | - match: ^\s*(?i)(CompareDLLVersions|CompareFileTimes|DirShow|DisabledBitmap|EnabledBitmap|GetFullDLLPath|GetParent|PackEXEHeader|SectionDivider|SetPluginUnload|SubSection(End)?|UninstallExeName)\b 26 | scope: invalid.deprecated.nsis 27 | - match: ^\s*(?i)\!(addincludedir|addplugindir|appendfile|assert|cd|define|delfile|echo|error|execute|finalize|getdllversion|gettlbversion|include|insertmacro|macro|macroend|makensis|packhdr|pragma|searchparse|searchreplace|system|tempfile|undef|verbose|uninstfinalize|warning)\b 28 | scope: keyword.other.nsis 29 | - match: ^\s*(?i)\!(ifdef|ifndef|if|ifmacrodef|ifmacrondef|else|endif)\b 30 | scope: keyword.control.nsis 31 | - match: ^\s*(?i)\w+\:\:\w+ 32 | scope: support.class.nsis 33 | - match: "[!<>]?=|<>|<|>" 34 | scope: keyword.operator.comparison.nsis 35 | - match: \b(?i)(true|on)\b 36 | scope: constant.language.boolean.true.nsis 37 | - match: \b(?i)(false|off)\b 38 | scope: constant.language.boolean.false.nsis 39 | - match: \b(?i)((un\.)?components|(un\.)?custom|(un\.)?directory|(un\.)?instfiles|(un\.)?license|uninstConfirm|admin|all|amd64-unicode|auto|both|bottom|bzip2|current|force|hide|highest|ifdiff|ifnewer|lastused|leave|left|listonly|lzma|nevershow|none|normal|notset|right|show|silent|silentlog|textonly|top|try|user|Win10|Win7|Win8|WinVista|x86-(ansi|unicode)|zlib)\b 40 | scope: entity.other.attribute-name.nsis 41 | - match: \b(?i)(ARCHIVE|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY|HIDDEN|HKCC|HKCR(32|64)?|HKCU(32|64)?|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM(32|64)?|HKPD|HKU|IDABORT|IDCANCEL|IDD_DIR|IDD_INST|IDD_INSTFILES|IDD_LICENSE|IDD_SELCOM|IDD_UNINST|IDD_VERIFY|IDIGNORE|IDNO|IDOK|IDRETRY|IDYES|MB_ABORTRETRYIGNORE|MB_DEFBUTTON1|MB_DEFBUTTON2|MB_DEFBUTTON3|MB_DEFBUTTON4|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_RIGHT|MB_RTLREADING|MB_SETFOREGROUND|MB_TOPMOST|MB_USERICON|MB_YESNO|MB_YESNOCANCEL|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SW_HIDE|SW_SHOWDEFAULT|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_SHOWNORMAL|SYSTEM|TEMPORARY)\b 42 | scope: entity.other.attribute-name.nsis 43 | - match: \s+\/(?i)(BRANDING|CENTER|COMPONENTSONLYONCUSTOM|CUSTOMSTRING\=|ENABLECANCEL|EXERESOURCE|FILESONLY|FINAL|GLOBAL|IMGID\=|ITALIC|LANG\=|NOCUSTOM|NONFATAL|OVERWRITE|REBOOTOK|REPLACE|RESIZETOFIT|RESIZETOFIT|SHORT|SILENT|SOLID|STRIKE|STRINGID|TRIM|UNDERLINE|a|date|e|file|gray|ifempty|ifndef|ignorecase|noerrors|nonfatal|o|oname\=|r|redef|utcdate|windows|x)\b 44 | scope: constant.language.slash-option.nsis 45 | - match: '\b((0(x|X)[0-9a-fA-F]+)|([0-9]+(\.[0-9]+)?))\b' 46 | scope: constant.numeric.nsis 47 | # FileFunc.nsh 48 | - match: '(?:^\s*)(?i)\${(BannerTrimPath|DirState|DriveSpace|Get(BaseName|Drives|ExeName|ExePath|FileAttributes|FileExt|FileName|FileVersion|Options|OptionsS|Parameters|Parent|Root|Size|Time)|Locate|RefreshShellIcons)}(?:\s+)' 49 | scope: constant.language.nsis 50 | # LogicLib.nsh 51 | - match: '(?:^\s*)(?i)\${(And(If(Not)?|Unless)|Break|Case(2|3|4|5|Else)?|Continue|Default|Do(Until|While)?|Else(If(Not)?|Unless)?|End(If|Select|Switch)|Exit(Do|For|While)|For(Each)?|If(Cmd|Not(Then)?|Then)?|Loop(Until|While)?|Or(If(Not)?|Unless)|Select|Switch|Unless|While)}(?:\s+)' 52 | scope: constant.language.nsis 53 | # Memento.nsh 54 | - match: '(?:^\s*)(?i)\${(Memento(Section(Done|End|Restore|Save)?|UnselectedSection))}(?:\s+)' 55 | scope: constant.language.nsis 56 | # TextFunc.nsh 57 | - match: '(?:^\s*)(?i)\${(Config(Read|ReadS|Write|WriteS)|File(Join|ReadFromEnd|Recode)|Line(Find|Read|Sum)|Text(Compare|CompareS)|TrimNewLines)}(?:\s+)' 58 | scope: constant.language.nsis 59 | # WinVer.nsh 60 | - match: '(?:^\s*)(?i)\${((At(Least|Most)|Is)(ServicePack|Win(7|8|10|95|98|200(0|3|8(R2)?)|2012|ME|NT4|Vista|XP))|Is(NT|Server))}(?:\s+)' 61 | scope: constant.language.nsis 62 | # WordFunc.nsh 63 | - match: '(?:^\s*)(?i)\${(StrFilterS?|Version(Compare|Convert)|Word(AddS?|Find((2|3)X)?S?|InsertS?|ReplaceS?))}(?:\s+)' 64 | scope: constant.language.nsis 65 | # x64.nsh 66 | - match: '(?:^\s*)(?i)\${((Disable|Enable)X64FSRedirection|RunningX64)}(?:\s+)' 67 | scope: constant.language.nsis 68 | - match: '{{language}}' 69 | scope: constant.other.nsis 70 | - match: '{{definitions}}' 71 | scope: constant.other.nsis 72 | - match: '{{uservar}}' 73 | scope: variable.other.nsis 74 | - match: '{{variable}}' 75 | scope: variable.language.nsis 76 | - match: '"' 77 | captures: 78 | 0: punctuation.definition.string.begin.nsis 79 | push: 80 | - meta_scope: string.quoted.double.nsis 81 | - match: '"' 82 | captures: 83 | 0: punctuation.definition.string.end.nsis 84 | pop: true 85 | - match: '{{dollar}}' 86 | scope: constant.character.escape.nsis 87 | - match: '{{escaped}}' 88 | scope: constant.character.escape.nsis 89 | - match: '{{uservar}}' 90 | scope: variable.other.nsis 91 | - match: '{{variable}}' 92 | scope: variable.language.nsis 93 | - match: '{{language}}' 94 | scope: variable.other.nsis 95 | - match: '{{definitions}}' 96 | scope: constant.other.nsis 97 | - match: "'" 98 | captures: 99 | 0: punctuation.definition.string.begin.nsis 100 | push: 101 | - meta_scope: string.quoted.single.nsis 102 | - match: "'" 103 | captures: 104 | 0: punctuation.definition.string.end.nsis 105 | pop: true 106 | - match: '{{dollar}}' 107 | scope: constant.character.escape.nsis 108 | - match: '{{escaped}}' 109 | scope: constant.character.escape.nsis 110 | - match: '{{uservar}}' 111 | scope: variable.other.nsis 112 | - match: '{{variable}}' 113 | scope: variable.language.nsis 114 | - match: '{{language}}' 115 | scope: constant.other.nsis 116 | - match: '{{definitions}}' 117 | scope: constant.other.nsis 118 | - match: "`" 119 | captures: 120 | 0: punctuation.definition.string.begin.nsis 121 | push: 122 | - meta_scope: string.quoted.back.nsis 123 | - match: "`" 124 | captures: 125 | 0: punctuation.definition.string.end.nsis 126 | pop: true 127 | - match: '{{dollar}}' 128 | scope: constant.character.escape.nsis 129 | - match: '{{escaped}}' 130 | scope: constant.character.escape.nsis 131 | - match: '{{uservar}}' 132 | scope: variable.other.nsis 133 | - match: '{{variable}}' 134 | scope: variable.language.nsis 135 | - match: '{{language}}' 136 | scope: constant.other.nsis 137 | - match: '{{definitions}}' 138 | scope: constant.other.nsis 139 | - match: (;|#).*$\n? 140 | scope: comment.line.nsis 141 | captures: 142 | 1: punctuation.definition.comment.nsis 143 | - match: /\* 144 | captures: 145 | 0: punctuation.definition.comment.nsis 146 | push: 147 | - meta_scope: comment.block.nsis 148 | - match: \*/ 149 | captures: 150 | 0: punctuation.definition.comment.nsis 151 | pop: true 152 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NSIS Bundle for Sublime Text 3 2 | 3 | NSIS (Nullsoft Scriptable Install System) is an open source program and scripting language to create Windows installers. This package provides syntax highlighting and build tools. 4 | 5 | **Note**: This package is compatible with Sublime Text 3 ([Build 3103](http://www.sublimetext.com/blog/articles/sublime-text-3-build-3103) or higher). Click [here](https://github.com/SublimeText/NSIS/tree/st2-master) for a Sublime Text 2 version of this package. 6 | 7 | ## Screenshots 8 | 9 | ![Light Theme](https://raw.githubusercontent.com/SublimeText/NSIS/master/screenshots/light-theme.png) 10 | ![Dark Theme](https://raw.githubusercontent.com/SublimeText/NSIS/master/screenshots/dark-theme.png) 11 | 12 | ## Installation 13 | 14 | Easiest way to install the plugin is to use [Package Control](https://packagecontrol.io). 15 | 16 | Alternatively you can git clone directly into `Packages` directory in the Sublime Text 3 application settings area. 17 | 18 | ### Using Git 19 | 20 | Go to your Sublime Text 3 `Packages` directory and clone the repository using the command below: 21 | 22 | git clone https://github.com/SublimeText/NSIS 23 | 24 | ### Download Manually 25 | 26 | * Download the files using the GitHub .zip download option 27 | * Unzip the files and rename the folder to `NSIS` 28 | * Copy the folder to your Sublime Text 3 `Packages` directory 29 | 30 | ## Portable NSIS support 31 | 32 | Support for portable NSIS can be achieved by putting the main NSIS program directory path in your `PATH` [environment variable](http://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them/284351#284351). 33 | -------------------------------------------------------------------------------- /scripts/build.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | set nsis_compiler= 3 | 4 | if %PROCESSOR_ARCHITECTURE%==x86 ( 5 | set RegQry=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NSIS 6 | ) else ( 7 | set RegQry=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\NSIS 8 | ) 9 | 10 | for /F "tokens=2*" %%a in ('reg query "%RegQry%" /v InstallLocation ^|findstr InstallLocation') do set nsis_compiler=%%b 11 | 12 | if not defined nsis_compiler ( 13 | for %%X in (makensis.exe) do (set nsis_compiler=%%~dp$PATH:X) 14 | ) 15 | 16 | set args= 17 | :loop 18 | set args=%args% %1 19 | shift 20 | if not "%~1"=="" goto loop 21 | 22 | if defined nsis_compiler ( 23 | "%nsis_compiler%\makensis.exe" %args% 24 | ) else ( 25 | echo "Error, build system cannot find NSIS! Make sure it's installed and makensis.exe is in your PATH environment variable." 26 | ) 27 | -------------------------------------------------------------------------------- /scripts/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # sublime-makensis 4 | # 5 | # The MIT License (MIT) 6 | # Copyright (c) 2015-2017 Jan T. Sott, Derek Willian Stavis 7 | # 8 | # This script builds NSIS scripts on non-Windows platforms (Mac OS X, Linux) 9 | # using native makensis or through Wine 10 | # 11 | # Installing makensis on your distribution is easy, and works -in most cases- 12 | # through the default package manager (e.g. apt-get, brew, yum). If you want 13 | # to use the Windows build to compile scripts, install Wine and a NSIS version 14 | # of your choice. 15 | # 16 | # https://github.com/idleberg/sublime-makensis 17 | 18 | # Set path 19 | PATH=/usr/bin:/usr/local/bin:/opt/local/bin:/bin:$PATH 20 | 21 | # Native makensis 22 | if makensis -VERSION >/dev/null 23 | then 24 | 25 | # Check for arguments 26 | if [[ $@ == '' ]] 27 | then 28 | echo "Error: No arguments passed" 29 | exit 1 30 | fi 31 | 32 | makensis "$@" 33 | 34 | if [ $? -eq 0 ] 35 | then 36 | exit 0 37 | fi 38 | 39 | # Wine fallback (via https://gist.github.com/derekstavis/8288379) 40 | else 41 | echo 42 | echo "Trying to use Wine fallback" 43 | 44 | # Let' try Wine then 45 | command -v wine >/dev/null 2>&1 || { 46 | echo >&2 "Error: Wine not found" 47 | exit 127 48 | } 49 | 50 | # Get Program Files path via Wine command prompt 51 | PROGRAMS_WIN=$(wine cmd /c 'echo %PROGRAMFILES%' 2>/dev/null) 52 | 53 | # Translate windows path to absolute unix path 54 | PROGRAMS_UNIX=$(winepath -u "${PROGRAMS_WIN}" 2>/dev/null) 55 | 56 | # Get makensis path 57 | MAKENSIS=$(printf %q "${PROGRAMS_UNIX%?}/NSIS/makensis.exe") 58 | 59 | # Set arguments 60 | if [[ $1 != '-WX' ]] 61 | then 62 | ARGUMENTS="--" 63 | SCRIPT=\"$@\" 64 | else 65 | ARGUMENTS="$1 --" 66 | SCRIPT=\"${@:2}\" 67 | fi 68 | 69 | eval wine $MAKENSIS $ARGUMENTS $SCRIPT 70 | fi 71 | --------------------------------------------------------------------------------