Atom: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
Line 55: Line 55:
=== Building ===
=== Building ===


There are several ways to build NSIS scripts within Atom, each of them depending on a separate build package.
There are many ways to compile NSIS scripts in Atom. But before we go into detail, make sure makensis is in your PATH [http://superuser.com/a/284351/195953 PATH environmental variable].


'''Note:''' You might have to add makensis to your [http://superuser.com/a/284351/195953 PATH environmental variable] in order to use any of the mentioned building tools.
As of v4.0.0 of this package, you can compile scripts without relying on third-party packages. To do so, select “NSIS: Save & Compile” from the command-palette or use the shortcut <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>M</kbd> (that's <kbd>Shift</kbd>+<kbd>Alt</kbd>+<kbd>M</kbd> on Windows.)


==== build ====
=== Third-party packages ===


With the [https://atom.io/packages/build build] package and a [https://atombuild.github.io/#language-nsis build provider] installed (e.g. [https://atom.io/packages/build-makensis build-makensis]), you can compile scripts using the default <kbd>Cmd</kbd>+<kbd>Alt</kbd>+<kbd>b</kbd> shortcut (or <kbd>F9</kbd>).
In addition to that, you can choose from the following build packages to compile NSIS:


==== script ====
* [https://atom.io/packages/build build] with build provider (e.g. [https://atom.io/packages/build-makensis build-makensis])
 
* [https://atom.io/packages/script script]
With the [https://atom.io/packages/script script] package installed, you can compile scripts using the default <kbd>Super</kbd>+<kbd>I</kbd> shortcut.
* [https://atom.io/packages/atom-runner atom-runner]
 
* [https://github.com/mirhec/atom-build atom-build]
==== atom-runner ====
 
With the [https://atom.io/packages/atom-runner atom-runner] package installed, you need to create a runner task to compile scripts. From the [https://atom.io/packages/command-palette command-palette] run “NSIS: Set build command for atom–runner” and <code>makensis</code> will added as runner for NSIS files. Use the default shortcut <kbd>Ctrl</kbd>+<kbd>R</kbd> to compile your scripts.
 
==== atom-build ====
 
You can also create <code>.atom-build.json</code> to use with [https://github.com/mirhec/atom-build atom-build]. From the [https://atom.io/packages/command-palette command-palette] run “NSIS: Create .atom–build file” to add it to your current project folder. Use the default shortcut <kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>B</kbd> to compile your scripts.


== Links ==
== Links ==

Revision as of 19:48, 23 April 2016

Description

An all around NSIS language package for GitHub's new Atom editor

Grammar

Syntax highlighting of all commands in NSIS versions 2.46 & 3.0b1 and their included plug-ins

Completions

Tab-completions for syntax, useful snippets for quick scaffolding

screenshot.gif

Extension Packages

You can further extend #nsis support in Atom.

Installation

Atom Package Manager (apm)

Install package from apm install language-nsis (or use the GUI)

Git

Change to the Atom package directory and clone the repository:

git clone https://github.com/idleberg/atom-language-nsis.git language-nsis

Usage

Completion

With most commands, you can specify available options before completion. For instance, rather than completing RequestExecutionLevel and then specifying an option, you can directly choose RequestExecutionLevel user from the completion menu.

To complete compile time commands, variables or predefines, *leave out* special characters:

  • include completes to !include
  • INSTDIR completes to $INSTDIR
  • NSIS_VERSION completes to ${NSIS_VERSION}`

However, you have to type __LINE___ to complete to ${__LINE__}.

There are several special cases for your convenience:

  • MB_OK completes to MessageBox MB_OK
  • onInit completes to a Function .onInit block
  • LogicLib completes to !include "LogicLib.nsh"`

Building

There are many ways to compile NSIS scripts in Atom. But before we go into detail, make sure makensis is in your PATH PATH environmental variable.

As of v4.0.0 of this package, you can compile scripts without relying on third-party packages. To do so, select “NSIS: Save & Compile” from the command-palette or use the shortcut Ctrl+Alt+M (that's Shift+Alt+M on Windows.)

Third-party packages

In addition to that, you can choose from the following build packages to compile NSIS:

Links