Tuesday, March 20, 2012

Write your first NSIS script

- Mohankumar Deivasigamani
Introduction
NSIS (Nullsoft Scriptable Install System) is a professional open source system to create Windows installers. It has a flexible design and is therefore very suitable for internet distribution. You can Google NSIS.


This article introduce how to write and compile your first NSIS script . I strongly recommend you to correctly install the NSIS on your computer.
As its been tradition to start of with the “Hello World” as first program , which does nothing more but show a simple "Hello World" message box . To create a program you'll need a text editor (like Notepad) or you install HM NIS EDIT it’s a free NSIS Editor. Ref: http://hmne.sourceforge.net/

Let’s Start 
Open notepad or NSIS editor, you can either type the program shown below into notepad or just copy-paste it from this article

/*
HelloWorld.nsi - First NSIS Script
Written by - Mohankumar Deivasigamani
*/
# Name of the installer
Name "CSS Corp Labs"
OutFile "CSSCorp.exe"
XPStyle on
  Function .onInit
      MessageBox MB_OK "Hello World …"
      Quit
  FunctionEnd
Section
SectionEnd

Once you finish typing your script you should Save the NSIS script file as HelloWorld.nsi. In fact after making any changes to your source code, you should always save the file. Once save script done close the notepad. Right click on the file, you will see two context menus (Compile NSIS Script & Compile NSIS Script [Choose Compressor]) to compile the NSIS script

  1. Compile NSIS Script will use default compressor that you defined in script.
  2. Compile NSIS Script [Choose Compressor] will allow you to choose compress type. (ZLIB, ZLIB (solid), BZIP2, BZIP2 (solid), LZMA, & LZMA (solid)).

Once you choose compressor type and say ok, the script is compiled and generate exe file in name that you specified in OutFile property.


After you compile, Make NSIS window will help you test your installer by clicking the “Test Installer” button. This creates Installer where your script is saved.

Double click to test the installer.



6 comments:

Richard Majece said...

What about writing high quality capstone project, try to find online advices. I am sure that only advices from https://nerdymates.com/blog/capstone-project-ideas will help you to write about something interesting.

augustwalker said...

HP DeskJet 2622 associating Wi-Fi naturally · Check whether your PC and organization are viable. · Find out your HP DESKJET WIRELESS PRINTER SETUP.

teju said...

Thanks for the best share and i loved it.
Download cinema hd

mikejasonuk said...

Eliminate any tapes or materials for bundling consequently. Open the section plate and open the tapes on paper width and longitudinal markers. Stretch out the piece of paper to the most extreme limit. Take the new plain white paper pack and burden it into the info tray. Drag the markers with the goal that the sheets are tight, however not very close. 123.com.setup Whenever you're done, close the paper tray. To try not to print wrong records, adjust ink cartridges. Setup on the scanner is finished. Take the defensive plate on the glass of the scanner. Clean the glass and keep up with the forward looking setup plate. Ensure that the archive is set on the essences of the scanner glass as indicated by the setup markings. Pick OK and delay until the printer is in setup.

Jammy said...

Thanks for sharing that with us. Really appreicated.https://cinemahdapk.co/

Anveshj said...

Thanks for the best share and i loved it,
192.168.o.1