iFinity Blogs 

Top 5 DotNetNuke Manifest file Module Packaging Tips

May 25

Written by:
Tuesday, May 25, 2010 5:00 PM  RssIcon

1. Use Html in the File for better layout in the install pages

This one comes from the blog of Erik VB : use html in the manifest file by including <![CDATA[ sections. 

A CDATA section is a way of including xml/html within an xml file.  As a manifest file is just a big xml file, you can use this to your advantage and include cdata sections for various pieces of information.  For example, instead of providing an email address, here’s what’s in my manifiest file:

<email><![CDATA[Contact iFinity via the <a href="http://www.ifinity.com.au/Talk_to_us" target="_new">Contact Page</a>]]></email>

When the module installs, instead of getting a plain listing of an email address, this gives a link to the page on the iFinity website for contact.    You can also see in the below screenshot that the Url is an actual link to the site.

dnn_manifest_licence_details

This also comes in handy with the ‘Release Notes’ section, and allows html elements like headers, lists and hyperlinks.

2. Use a resources.zip file for all your files

I actually stumbled across this one accidentally while reading something else on Scott McCulloch’s website.  If you’ve been including each and every static file in your package by listing each one individually, then you’ve been both wasting your time and opening yourself up to packaging mistakes.  Just include a resource <component> section, and list your resources.zip file:

  <component type="ResourceFile">
    <resourceFiles>
      <basePath>DesktopModules\iFinity.UrlMaster</basePath>
      <resourceFile>
        <name>iFinity.UrlMaster_Resources.zip</name>
      </resourceFile>
    </resourceFiles>
  </component>
</components>

You should have some sort of automated packaging process : I use a command line script with a built-in PKZIP command.  This dumps all the files from the development directory into a directory, and then zips them up as the resources file.

3. Use a html file for your Licence Agreement

My EULA came at great cost to me via a lawyer.  I say great cost because I actually had to pay for it, being unable to barter services (they still have fax machines everywhere?!) or get them to participate in the beer economy.  Because a lawyer had anything to do with it, it’s a mile and a half long, and full of paragraphs and headings.   I’ve wanted to include in the DNN 5 ‘Accept Licence’ page, but there’s been two problems – the first being that including a .txt file in the ‘<license>’ element of the manifest file just dumps a pile of text in one big blob, and the second being that it pushes the bottom of the page, with the ‘accept’ and ‘next’ controls on it, to far away, leaving the prospective installer what to do next.

After a bit of experimentation, I figured out that you could include a html file using <license src=”eula.htm”> and this would blend the licence html in with the overall DNN module installer page.  I then took this further and added a bit of CSS to restrict the size of the container, and add a scroll bar (overflow:scroll).  The result is a very Microsoft looking EULA box with the ‘Accept Licence’ just underneath.

dnn_manifest_licence_page

This is done by using the correct format in the manifest file, namely:

<license src="EULA.html" />

The EULA.html file is included in the zip file of the package, and the important part at the top looks like this:

dnn_manifest_licence_html

Note the use of two div elements : one to contain the licence, and the other to provide a restricting top layer that creates a scrollbar.

Of course you could do this just by entering all the license information into the manifest file, but that would make it large and unwieldy.  Having the EULA in a separate file makes it easy to track it in source control and to share between different projects, and makes it easy for people to read if they are poking around in your install file.

4. Make your module DNN 4.x and DNN5.x compatible by using two separate manifest files.

I’ve actually been banging on about this ever since the new manifest file design was announced for DNN 5.  The first problem I could see was having to have two separate install packages, and people getting confused which one they needed.  It’s OK to use install_dnn5.zip and install_dnn4.zip but you’d be surprised the number of people with DNN installs who have no idea what version they are running.  I always advocated the use of a .dnn5 extension for DNN 5 manifest files – the perfect solution because DNN 4 installs would just ignore the file, and DNN5 installs would pick it up and use it.

Well, knock me down with a feather, but I found out by accident that DNN (well, 5.4 at least) works exactly like that.  I found out accidentally because I renamed a file .dnn5 in my package while messing about with it, and found that DNN 5 picked up and read that file.

So, you can include two different manifest files in the one package, and DotNetNuke will work out which one is the right one to use.  The files should be like this:

module name.dnn

module name.dnn5

That’s all you need to do!  I’m sure this was announced somewhere, but I didn’t find out until I did it by accident.  That’s the sort of surprise that makes your day.

5. Use the ‘sourceFileName’ attribute for your assembly files.

I’ve seen quite a few forum posts from people wondering how to get their assemblies loading right.  The confusion usually comes about because they locate the assembly files in the ‘root’ of the zip folder, but then they don’t get copied to the /bin folder correctly.

Here’s how to do it:

<component type="Assembly">
  <assemblies>
    <assembly>
      <path>bin</path>
      <name>iFinity.UrlMaster.dll</name>
      <sourceFileName>iFinity.UrlMaster.dll</sourceFileName>
    </assembly>

Note the sourceFileName element : this tells the package installer where in the zip file the file can be found, while the <path><name> elements tell it where to put the file for the install.

That’s it – my top 5 tips for working with DNN 5 Packaging.  Do you have more?  Let me know via the comments.

Tags:
Categories:
Location: Blogs Parent Separator Crafty Code

30 comment(s) so far...


Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

Great tips, especially the one on putting multiple manifest files in the same package for 4 an 5. Thanks for posting.

By Adam Paxton on   Tuesday, May 25, 2010 9:14 PM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

These are some great tips for any DNN developer. I didn't until recently realize how much you can include into the resources zip file. I was simply copying the way a core module was packaged. Now, I package everything except for the database scripts, versioned text files, DLLs, and the manifest. Most people don't know that. :)

Thanks for breaking this down for everyone!

By Will Strohl on   Tuesday, May 25, 2010 10:11 PM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

Great tips, thanks. WRT Skinning: the resource file solution can be used if you want to install the skin globally, that is, in the _default/skins folder. Unfortunately, the host user needs to change the .dnn file if he want the skins to be installed in the portal folder.

By Peter Schotman on   Tuesday, May 25, 2010 10:39 PM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

Thanks for the article, some great tips here I'll be sure to use in the near future.

By Rick Beddie on   Wednesday, May 26, 2010 2:47 AM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

Great article.
Btw, .dnn5 was introduced in DNN5.2.0, however this is the first public hint. It was even missed in what's new or on gemini. Congratulations for covering it up!

By Stefan Cullmann on   Wednesday, May 26, 2010 5:29 AM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

@stefan no wonder I didn't hear anything about it. Oh well, it's public knowledge now!

By Bruce Chapman on   Wednesday, May 26, 2010 7:55 AM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

Actually we had applied those rule into our module Manifest file but we just make the license with .txt format which is not well-formated. Later we will replace it with html file as you mendtioned above. Thanks for your sharing. :)

By Baldwin on   Wednesday, May 26, 2010 12:01 PM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

Anyone figured if the release notes can come from an external file too? That would come in handy... Anyway, thanks for sharing, great post!

By Philipp on   Wednesday, June 02, 2010 4:38 PM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

Just for the records...it works the very same way with the releasenotes.

By Philipp on   Wednesday, June 02, 2010 6:08 PM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

@philipp : thanks for checking that out, you beat me to it. That makes 6 packaging tips now. That's actually very good because I've always included a release notes html page in my zip file, so I can just hook that up to the release notes xml element in the manifest file and save myself double entry.

By Bruce Chapman on   Wednesday, June 02, 2010 7:16 PM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

Thanks for sharing the article, very useful tips are mentioned in this post.

By DotNetNuke developer on   Saturday, June 05, 2010 8:44 PM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

Hi,Thanks for this article. You have cleared my old doubts. Now I will use it in my projects.Thanks againRegards Jesica

By Jesica on   Friday, June 18, 2010 4:02 PM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

The only way it worked for Assembly was to include a folder 'bin' and put .dll file there within the installer package, otherwise an error was thrown upon installation that ...\bin\name.dll was not found. I guess sourceFileName is the key that I couldn't find anywhere...

Thanks,

Val

By Val on   Saturday, June 19, 2010 9:08 AM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

Hi Bruce,

With Resource zips- do you know if it is one per destination folder - ie, can I have a file that goes into the root and the localization file (that needs to be copied to App_Resources) in the same .zip, or do I have to have 2 zip files for this with different basepaths.

By Rodney on   Wednesday, June 30, 2010 8:29 PM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

Hi Bruce,

With Resource zips- do you know if it is one per destination folder - ie, can I have a file that goes into the root and the localization file (that needs to be copied to App_Resources) in the same .zip, or do I have to have 2 zip files for this with different basepaths.

By Rodney on   Wednesday, June 30, 2010 8:29 PM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

@rodney AFAIK the resources zip file is copied to the desktopModules/moduleName folder. If you want to copy files into the other locations you can try messing about with the basepath value. You could have one resources file if you managed to get it started from the root path, you'd just have to make sure all the files are in the correct relative path within the zip file. With 5.x manifest files you can have more than one resource file though.

By Bruce Chapman on   Wednesday, June 30, 2010 11:31 PM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

Nice article but I think the only way to make the install work with the Module dll is by having a bin folder and packaging it up and i don't think sourceFileName attribute with the path helps any in the installation, i tried using it but no help

By chalama on   Friday, December 31, 2010 1:22 AM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

@chalama - the sourcefileattribute is how I package all of my modules, so it does work. I would check for things like case sensitivity if it's not working for you.

By Bruce Chapman on   Saturday, January 01, 2011 7:48 PM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

Tip 5 really helped me. Thanks!

By Nicholas Lu on   Saturday, June 04, 2011 8:51 PM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

Great tips!
I'm still quite unsure about placing the whole directory into Resource.zip. it works?!

By Leonard Lee on   Tuesday, September 20, 2011 4:04 PM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

@Leonard, yes, the resource zip is extracted in-place. It has been like this for a long time, and is a major time-saver when it comes to packaging modules.

By Bruce Chapman on   Tuesday, September 20, 2011 4:50 PM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

Bruce, just out of curiosity...I'd love your take on the following scenario. We have a 3rd party component that is redistributed within one of our modules. The component requires a .lic file to be placed in the /bin folder along with the component DLL. For some reason our .lic file is not being installed and I believe the culprit is the manifest schema we are using:

[code]


bin

MyComponent.dll
1.0.0.0


MyComponent.lic
1.0.0.0



[/code]

Is this incorrect?

By David Poindexter on   Wednesday, November 30, 2011 1:31 PM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

Sorry, it keeps striping out my XML "Assembly" component type. basePath value is "bin". name value is name of file. version value is the version of the file. We are not using "path" and "sourceFileName".

By David Poindexter on   Wednesday, November 30, 2011 1:35 PM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

@david - you could just try using a plain [component type="File"], separate from your assembly section. The format is like this:
[component type="File"]
[files]
[basePath]bin[/basePath]
[file]
[name]myComponent.lic[/name]
[/file]
[/files]
[/component]

Worth a try at least, I think that would work.

By Bruce Chapman on   Wednesday, November 30, 2011 1:41 PM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

Thanks for the quick response Bruce. The "File" component type section already has a different basePath so I wasn't sure if you could have multiple component sections of the same type. Thoughts?

By David Poindexter on   Wednesday, November 30, 2011 1:47 PM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

@david pretty sure you can have more than one file component section. Each section just gets sequentially read and processed by the installer. I would just give it a go and see what happens, I haven't tried in the past.

By Bruce Chapman on   Wednesday, November 30, 2011 1:49 PM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

I tried it, but still getting the same error - stating it can't find the .lic file in the temp install dir. ;-(

By David Poindexter on   Wednesday, November 30, 2011 2:11 PM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

Okay, finally figured it out. I had to use the following:

[component type="File"]
[files]
[basePath]bin[/basePath]
[file]
[name]MyComponent.lic[/name]
[sourceFileName]bin\MyComponent.lic[/sourceFileName]
[/file]
[/files]
[/component]

My build event was placing the .lic file in the bin directory, so that was causing an issue with the installer finding the file in the ZIP.

Thanks for your help. Turns out your [sourceFileName] suggestion did the trick. ;-)

By David Poindexter on   Wednesday, November 30, 2011 2:29 PM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

Can sourceFileName be used in a DNN 4 manifest file as well?

By David Poindexter on   Wednesday, December 14, 2011 1:47 PM
Gravatar

Re: Top 5 DotNetNuke Manifest file Module Packaging Tips

@david - I don't think so. The dnn4 manifest was quite restricted in comparison to Dnn 5. However you might be able to use some of the basic commands for copying a file across just using the [file][path]..\..\bin[/path][name]mycomponent.lic[/name][/file] format, which is used to copy any file to the specific location but I think the relative directory thing works OK

By Bruce Chapman on   Wednesday, December 14, 2011 8:27 PM

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel 
Bruce Chapman
Hi, I'm Bruce Chapman, and this is my blog. You'll find lots of information here - my thoughts about business and the internet, technical information, things I'm working on and the odd strange post or two.

 

Share this
Get more!
Subscribe to the Mailing List
Email Address:
First Name:
Last Name:
You will be sent a confirmation upon subscription

 

Follow me on Twitter
Stack Exchange
profile for Bruce Chapman at Stack Overflow, Q&A for professional and enthusiast programmers
Klout Profile