Overview

The iNSISt framework works by transforming XML documents into NSIS script files (using XSLT as the transformation mechanism). That's essentially it. For that reason, we say that the framework provides the mechanism but not the method for generating NSIS script files. In other words, you can use any method you want for invoking the transform on the input document as long as the schema and transform provided by the framework are used.

For the sake of convenience, however, a simple command-line C# application is distributed with the framework and can be used to invoke it on an XML document. In most cases, this will probably be sufficient, but the option is always available to create your own program or use another one that already exists.

Installation

To install the framework, just download the latest release and extract the ZIP file into a folder. When the framework is installed, you should see the following in the folder where it was unzipped:
  • Mvp.Xml (folder)
  • insist.exe
  • insist.exe.config
  • insist.xsd
  • insist.xslt
  • sample.xml

Mvp.Xml is a another project on CodePlex and is used by the C# app (insist.exe) to provide .NET implementations for the EXSLT extensions in the transform document.

insist.xsd is the schema document that defines how XML input files to the framework must be structured, and insist.xslt is the transform document that transforms the XML into an NSIS script.

sample.xml is a sample XML file to be transformed into an NSIS script. In addition to acting as a sample input file for the framework, this file also has a comment at the top with some rudimentary documentation about the structure of the file. This can prove useful for quickly seeing how to structure your input files since the schema isn't yet documented.

Usage

Probably the most important aspect of using the framework is making sure your XML input documents are structured properly (i.e. validate against the insist.xsd schema). Since the schema isn't yet documented, you'll need to look at the included "sample.xml" file or the contents of the schema file to see how your XML files should be structured. The structure is pretty straight-forward, and the names of most of the tags and attributes very closely match their respective counterparts in the NSIS help documentation.

If you're using the provided "insist.exe" application to invoke the framework, then usage is as follows:
  • insist.exe input-file-uri output-file-uri

Where input-file-uri is a path or URL to the input file, and output-file-uri is a path or URL to the output file.

Be careful that the XML input file meets the schema definition since "insist.exe" does validate the input document against the schema.

Of course, if you're using another program to invoke the framework rather than "insist.exe," then consult that program's documentation for usage instructions.

Customization

The most typical way to customize the framework for your individual needs is to modify the XSLT document to produce NSIS script code that's structured the way you desire. The goal of the framework is to minimize the need for that by having the XSD and XSLT be as flexible as possible, but since they're both in the early stages of development, there will undoubtedly be scenarios they don't cover. Therefore, if you need things like custom functions, custom initialization logic, etc., in your script, it's best to just modify the XSLT and insert what you need in there so it gets included in the generated code.

The parts of an NSIS script that tend to change the most, though, like version number, included files, etc., are already covered by the framework, so hopefully little or no customization will be required in those areas.

Requirements & Dependencies

To use the included "insist.exe" application, you must have the .NET 2.0 framework installed. Also, the application requires that the schema and transform documents reside in the same folder as the application (while is how the files are packaged by default).

Last edited Jul 24, 2008 at 3:30 PM by OlympicCoder, version 18

Comments

No comments yet.