py2nsis Tutorial

Here’s a Tutorial of Installer’s Generation with py2nsis!


Dependencies

Before start, ensure you have Nsis and py2exe Installed in you Windows OS.


Configuration

You must specify your Nsis installation path. In order to do that, go to “Paths” in the “Configuration” menu item and select the path to your “makensisw.exe” file. The default location of this file is “C:\Program Files\NSIS\makensisw.exe”


How To Use

Let’s begin explaining the Graphic Interface of py2nsis

The “General” Panel contains Options that describes basic information about your project , such as name, version, copyright, Company. It also have the name of the Dist Folder wich is where the output files of py2exe are allocated. The bundle level combo box have 3 values:

  • 1 is to generate a singleFile .exe that contains all the application, including the Python interpreter.
  • 2 is to generate a singleFile .exe that contains all the application except the Python interpreter which is isolated in the dist dir.
  • 3 is to generate a .exe and all the dlls and .pyd files around the executable.

The checkBox in the bottom of the panel indicates if the Nsis installer is generated or Not. When is checked, only the setup.py (for py2exe) is generated. This implies that just the .exe of your application is builded, not the installer.

The “Main Script” File Selector is where you must tell to py2nsis where is the root file of you application. This field is the most important and is obligatory to complete!

The Logo IconFile Selector is where you can select a .ico image for the .exe and is the icon that will appear in the desktop and in the programs bar when you install your application.

In the Additional Python Modules list you can type the python modules of wich your application depends and there is not an explicit import in your code.

Finally the Static files are the files like images, icons, config files, text files, templates and more wich are referenced by the uri in your application.

You can also add raw python code that you need (in some cases this is necessary) going to “code” in the menu bar and selecting the “add custom code” option.

 

Now You can download py2nsis from https://code.google.com/p/py2nsis/downloads/list


I hope that will be useful for you!

Regards, Juan Manuel

Advertisements

New year’s Post

A new year come with new ideas, projects and desires of research in many fields of science. I decide to start a new blog to share with the community some of my small contributions in the field of computer science and programming.

Let’s start with my new application that helps Python’s Developer to create windows installers for theirs Python’s projects. It’s called py2nsis.

py2nNsis is a Simple to Use, Nsis installers generator for python projects. It also make the setup.py for py2exe.

  • Nsis is a professional open source system to create Windows installers.
  • py2exe is a Python Distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python installation.

py2nsis combines the capabilities of these ones and generates directly a Windows installer with just a few information about your python code!

In my next post I will show how you can easily generate an Installer with py2nsis.