Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

NSIS Installer for Netduino Go Module Drivers


  • Please log in to reply
2 replies to this topic

#1 Matt Isenhower

Matt Isenhower

    Advanced Member

  • Members
  • PipPipPip
  • 74 posts
  • LocationSan Diego, CA

Posted 14 May 2012 - 10:51 PM

Hi everyone,

If you're making a module for the Netduino Go, you'll probably need to distribute some driver libraries to go along with it. Providing a module driver installer is a great way to make it extremely easy for your users to get started with your module.

NSIS is a popular free and open source Windows installation system. NSIS is script-based, and allows you to use relatively simple scripts to define the behavior of your installer. I have created an NSIS script that can be used as a starting point for Netduino Go module driver installers.

This script copies all the necessary files for your module to a directory within the Program Files directory. It also creates the registry keys necessary for your assemblies to appear within Visual Studio's "Add Reference" window for .NET Micro Framework projects.

Additionally, an uninstaller is created and users will be able to uninstall your drivers through the "Add/Remove Programs" control panel.

This script generates a single installer executable that works on both 32 and 64-bit systems. It has been tested on Windows XP, Vista, and 7.

This script is distributed under the Apache License 2.0.

To use this script:

  • Install the latest version of NSIS.
  • Download the script (attached to this post, see below for link).
  • Copy the script to your library's solution folder. I recommend creating an "Installer" directory within your solution folder and copying the script files there. This keeps all the files related to the installer (including any custom icons or other plugins, etc.) contained and separate from the rest of your code.
  • Update the settings in the first part of Installer.nsi (see below for more details). The .nsi and .nsh files are just plain text files that can be edited with Notepad or any other text editor, but several NSIS development environments are available. I like HM NIS Edit.

There are a few important settings you should update in Installer.nsi:
  • Your company name, product name, website, etc.
  • The installer version number. You can use any version number you'd like, but it must be in X.X.X.X format.
  • If you would like to include a EULA page in the installer, uncomment the EULA Filename line and specify a file that contains your EULA text. This can be either a plain or rich text file.
  • The .NET Micro Framework version you are targeting (e.g., v4.2). This is used for the installation path (to keep different .NETMF versions separate) and for the registry keys that make your assembly appear in the "Add Reference" dialog.
  • A list of all assemblies you'd like to include in the installer. For each assembly, specify the target name (i.e., the assembly filename without the .dll extension) and the build output directory. You can include multiple assemblies if necessary, and instructions for doing so are provided within the configuration section of Installer.nsi.

There are a few other settings as well:
  • The installer output filename. By default this will include the full product name and version.
  • Custom installer/uninstaller icons.
  • A link to be shown on the installer's Finish page, typically used as a link for "Getting Started" documentation.
  • Default installation directory, defaults to "Company Name\Product Name" (within the Program Files directory).

After updating the script with your settings, you should be able to compile the script to generate your installer. If you are using one of the NSIS IDEs, there should be a menu item or button within the program to compile the script. Otherwise, you can compile it from the command line:

"%PROGRAMFILES(X86)%\NSIS\MakeNSIS.exe" Installer.nsi

I have included a batch file called "CompileInstaller.bat" to make this a little easier.

Please let me know if you find this useful or if you have any questions :)

Matt

Attached Files


Komodex Labs
Follow me on Twitter: @mattisenhower

#2 Arron Chapman

Arron Chapman

    Advanced Member

  • Members
  • PipPipPip
  • 289 posts
  • LocationOregon, USA

Posted 14 May 2012 - 10:53 PM

Awesome Matt, just in time for me to work up an installer for the shipping firmware on the protomodule

When you talk EE use small words, I'm just a Software Developer :)
My Blog/Site and Everything Else

If my post helped you please consider pressing the "Like This" button in the bottom right-hand corner.

 

Oh my. So many things, so little money!!

 


#3 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 14 May 2012 - 10:53 PM

Oh awesome, Matt! This will be extremely useful for module builders and users alike. Thanks for the great contribution! Chris




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.