Welcome to the NAR Loader Project   

Last Updated:

Maybe some of you know the concept of JAR archives from Java. A lot of things from Java have found their way to the Dot Net world. Having the same functionality for Dot Net would be a nice feature. Since Dot Net 2, Microsoft has included some very interesting features in the CLR and the framework. These features makes it possible to create the functionality needed to handle archives for Dot Net - called NAR archives. The loader works only with .Net 2.x. .Net 1.x is not supported. Mono will be tested when the windows version is stable.

Additional infos about the NAR loader can be found in this Article.

 


XCOPY deployment was yesterday,
today we have single file deployment!


 

Table of contents

 

Download

The latest stable version is 1.2 as of October 2006.

Current Versions

1.22006.10.26binariessourcepassword & AES encryption support, archive comments

Older Versions

1.12006.08.17binariessourceself running archive support
1.0a2006.08.03binariessource
1.02005.03.03binariessourceFirst public release - no longer available

 

Un- / Installation

To install the loader, copy the executable NARLoader.exe to a place of your choice on your harddisk and start it with:

NARLoader.exe -i

Optionally you can type:

NARLoader.exe -d -i

to install the loader. This enables debug mode. In debug mode you can watch debug messages of the loader in a separate console window while the loader runs an application. To disable debug mode just install the loader again without the -d parameter.

To uninstall the loader just start it with the -u parameter. This removes the .nar file extension mapping and the NARLoader CAS CodeGroup from your system.

 

Usage

After installation you can start your .nar archives by entering their names on the command line like:

NARLoader.exe MyApp.nar param1 param2 ...

(Everything after the archivename is used as command line arguments for the application inside the archive). It's not necessarry to specify NARLoader.exe so:

MyApp.nar param1 param2 ...

would be enough.

Another way to start your archives is just double clicking them.

The loader uses the following command line parameters.

Some examples:

NARLoader.exe Test.nar

Starts the application inside the archive Test.nar

NARLoader.exe -d Test.nar

Same as above but with debugging enabled

NARLoader.exe -di
NARLoader.exe -d -i

Installs the loader to handle .nar files automatically

NARLoader.exe -u

The opposite from the above

NARLoader.exe -d -I World.ico -O World.exe -c NARTest.nar

Creates a self running archive World.exe with Icon World.ico from the archive NARTest.nar. The Icon parameter from the archives manifest is ignored.

 

How to create an archive

This is really simple! Just take your favourite ZIP utility (like WinZip) and pack your applications base directory. Name the archive like your EXE's name and replace .exe with .nar. That's it. You can do more with a so called manifest file. It must be named like your archive with extension .manifest. It's basically a simple XML file where you can specify which assembly should be the start assembly and which app.config file should be used.

Here is the testproject included in the loader distribution shown with WinZip. It consists of the main .exe assembly NARTest, an assembly NARTestDLL1 in the application directory and NARTestDLL2 in the testdir subdirectory as well as some sattelite assemblies with localized strings and a multifile assembly with three modules.

Included in this archive is the manifest NARTest.nar.manifest:

<?xml version="1.0" encoding="utf-8"?>
<NARLoader>
   <Start Assembly="NARTest"
          Type="NARTest.Program"
	  AppConfig="NARTest.exe.config"
	  ShowComment="1"
          Icon="Clown.ico"/>
</NARLoader>

You can have many different manifest files within an archive. They are used depending on the name of the archive. If there is no manifest file in the archive or if there is a manifest file but some parameters like Assembly or AppConfig are missing (or empty) in the manifest then the name of the archive is taken instead. So for example if there is no manifest and the archive is named Test.nar then the startassembly is Test, the type is Test.Program and the configfile is Test.exe.config. Id does not matter if the assemblyname is fully qualified or not.

Probing is the same as on the local filesystem. See here for more information's about probing.

If an archive contains a comment (zip file comment) it is displayed a applicationstartup if the ShowComment manifest parameter is set. This feature can be used to display license agreements.

 

Encryption

The loader supports encrypted archives based on standard, weak ZIP encryption but also based on strong 128, 192 and 255 bit AES encryption. As the weak ZIP encryption is standardized every ZIP utility supporting it can be used when creating archives. AES support was tested with WinZip Version 10 in 128 and 255 bit mode and not every zip utility supporting AES might work. Every file in an archive can (theoretically) be encrypted using a different password (if the used zip utility supports this). Every time the loader accesses a encrypted file inside the archive it looks if a password was entered (either using the -p command line parameter or the password dialog). If no password is available the user is prompted with the password dialog until the correct password was entered or the dialog was aborted. In case of an abort the loader cancels any further activities and the application is terminated. If the correct password was entered it will be used for any further archive access as long as it is correct for the current access. If the password is wrong the password dialog is displayed again.

 

How it works

The loader uses the new version 2.x hosting interfaces to provide an assembly store which is the .nar archive. The loader tries to mimic the same behaviour when resolving assemblies as the default loader does. So your application should normally see no difference running under the .nar loader compared to running under the standard loader. During installation the loader creates a file association for the .nar file extension and creates a CAS CodeGroup called NARLoader.

 

What it [ is | can | does ]

 

What it [ is | can | does ] NOT

 

Nobody is perfect

The loader is primary a design study about CLR hosting. Nevertheless I've done my best to track and kill most bugs and problems. In case you find one of the remaining bugs or want to tell me what you think about the loader just drop me a line at Richard.Prinz@MIN.at

 

Running the NAR Loader under Windows Vista

The NAR Loader and NAR Loader self executable archives work under Windows Vista. But for the installation one point should be noted: ensure that the loader executable has the "Require Administrator Privileges" set and click Allow when you are asked if you would like to continue. The loader contains a manifest resource which ensures this but in case something goes wrong check this. This procedure is also true for self executable archives if no loader is installed. If the loader is already installed this flag is not needed for self running executables.

 

Known issues, FAQ, Help

The following issues are known and maybe (or not) changed in one of the next versions, the following questions where asked by others:

 

What's next

This are ideas which might be usefull and possibly integrated in one of the next versions of the loader.

 

Links

The following links maybe usefull to learn more about CLR hosting, assembly packing, deployment and other projects or products

 

Disclaimer

 

DISCLAIMER

THIS SITE  INCLUDING ALL  ITS CONTENT  (TEXT, PICTURES,  BINARIES ETC.)  IS NOT 
ALLOWED TO BE  USED IN CRIMINAL,  ILLEGAL ACTIVITIES!  THE PURPOSE OF THIS SITE
IS  TO DESCRIBE  THE SOFTWARE   "NAR Loader"  WHICH STARTS  APPLICATIONS OUT OF
ARCHIVE FILES. I  AM IN NO WAY RESPONSIBLE FOR  ANY EXTERNAL CONTENT POINTED TO 
FROM THIS SITE.  USE  THIS  SITE  AND  ALL  OF ITS  CONTENT AT YOUR  OWN  RISK!
BY  USING  THIS  SITE  AND  ITS  CONTENT  YOU HAVE  ACCEPTED  THIS  DISCLAIMER.

 

 


Last Updated:

  
The content of this Page is under License
home