NSIS Text Editor Mode

History Key

  • New content
  • Removed content

Recent Versions

Choose two versions to compare, or click the link to view it.

  1. 35. almost 4 years by arst
  2. 34. almost 4 years by arst
  3. 33. almost 4 years by arst
  4. 32. almost 4 years by arst
  5. 31. almost 4 years by arst
  6. 30. almost 4 years by arst
  7. 29. almost 4 years by arst
  8. 28. almost 4 years by arst
  9. 27. almost 4 years by arst
  10. 26. almost 4 years by arst
  11. 25. almost 4 years by arst
  12. 24. almost 4 years by arst
  13. 23. almost 4 years by arst
  14. 22. almost 4 years by arst
  15. 21. almost 4 years by arst
  16. 20. almost 4 years by arst
  17. 19. almost 4 years by arst
  18. 18. almost 4 years by arst
  19. 17. almost 4 years by arst
  20. 16. almost 4 years by arst
  21. 15. almost 4 years by arst
  22. 14. almost 4 years by arst
  23. 13. almost 4 years by arst
  24. 12. almost 4 years by arst
  25. 11. almost 4 years by arst
  26. 10. almost 4 years by arst
  27. 9. almost 4 years by arst
  28. 8. almost 4 years by arst
  29. 7. almost 4 years by arst
  30. 6. almost 4 years by arst
  31. 5. almost 4 years by arst
  32. 4. almost 4 years by arst
  33. 3. almost 4 years by arst
  34. 2. almost 4 years by arst
  35. 1. almost 4 years by arst
 

This example creates an FWB extension that lets us work with Nullsoft Installer Scripts (NSIS) from inside FWB. The sample uses quite a bit of the FWB scripting API, so it’s a useful introduction to FWB scripting in general as well.

The extension is developed as a text editor addon, a MiniAppMode that is merged to a text editor MiniApp when a NSIS script is opened:

This extension comes alive whenever we open a file with NSIS content, it shows its toolbar and binds some keys. We can run the NSIS compiler from a button in the editor and click hi-lighted errors in the compiler output to jump directly to them. We can run the installer and open the NSIS help file.

When done and we close the file, the NSIS mode is disconnected and its toolbar removed.

In around 300 lines of Squirrel script, we manage to create a ‘micro IDE’ for NSIS scripts that integrates well into FWB.

Note: This extension works best under Windows. Under Linux, it still can be activated, but it will fail to locate the NSIS compiler and to build the scripts. Of course, to be useful, one has to install the NSIS compiler.

Two !MiniAppMode Extension Classes

To implement this extension, two new Squirrel classes are created. Both implement the MiniAppMode interface:

  • The NsisMode MiniAppMode – This class is the core part of the extension, defining the commands it implements (build NSIS script, run installer, …), the user interface and the command implementations.
  • The NSIS Output Parser – This class is used to parse the output from the NSIS compiler. It looks for an error messagemessages and colorizes it.then. When clicked, it points a text editor at the location of the error.

The file <FWB>/scripts/squirrel/NsisMode.nut contains the source code for these two modes. By default, this file is not included from FWB Squirrel startup scripts.