DNN Blog

Jul 13

Posted by: Peter Donker
7/13/2010  RssIcon

Ah, now that was a non-trivial task. I think I requested about half a year ago that we should be able to leverage the DNN 5 manifest enhancements without sacrificing the ability to target DNN 4. The first step was for DNN to allow multiple manifests to exist in a PA (= Private Assembly = the zip file that you distribute as your module). In DNN 4 if you have multiple .dnn files the installer immediately throws you out. So the solution was to be able to have a new extension for the DNN 5 manifest: .dnn5. I was really pleased that was picked up and implemented. So far so good. Now we can add a .dnn5 which DNN 5 will pick up and the .dnn which DNN 4 (and early versions of DNN 5 until this was supported).

Cool. 2 manifests. Now packing and getting the manifests right. If you’re like me you adore the resources.zip concept. My approach is this: the PA is built up out of a bunch of files. One resources zip which is unpacked in the module directory and all other files play some essential part in the installing of the module. I.e. ascxs, images and so forth go in the resources zip. But dlls (that go to the bin folder), scripts, cleanup files, etc, all go to the root of the PA. This works like a charm in DNN 4. You have minimal worries about file management in your manifest as you minimize the files you need to list under the “files” element. This is a hobby horse of mine: keep this to a minimum: number of files times the management detail of them. Since files that do something for the installer are more essential they require more careful management. Other files (like images in your module folder) are just less critical. This is why I feel strongly about the resources file. It allows me to package all the files that need no specific manifest management overhead.

Now that I’ve laid out how I like to package you can see how the DNN 5 model diverges from this. In the new installer the idea was that you create a complete file hierarchy in your PA and that the manifest names all files to copy. One relief is that the resources file was preserved in the installer so you can actually follow the model I laid out above. Where I had a hard time was getting the installer to accept that I had all important files in the root of the PA (which DNN 4 requires) and not in a pre-structured way the DNN 5 design would rather have. Specifically: DNN 5 expects that your dlls are in a bin folder in the PA. DNN 4 will break if they are in a subfolder, however. I had gone through Charles’ posts on the new manifest multiple times but I could not get it to work on DNN 4 and 5. However I tried either the installer would complain it could not find the file in tempfolder/bin/mydll.dll or it would copy the dll to the root of the DNN installation. Aargh. I did finally crack it after consultation with Charles. The file installer happens to support an element called sourceFileName which allows you to specify where the installer should get the file from.

Now to wrap it all up this is what you do.

1. Zip whatever you want to distribute in your module folder to a file called resources.zip for instance.

2. Copy this zip, plus scripts, dlls, cleanup files, etc to a folder for your final package

3. Create the DNN 4 manifest with the extension .dnn. The manifest will resemble this:

image

4. Create your DNN 5 manifest with the extension .dnn5. This starts as follows:

image

Scripts are included as follows:

image

Assemblies as follows:

image

And resource file as follows:

image

5. Zip it all up and you should have a PA that installs on DNN 4 and 5.

You can now use all the advanced features of the DNN 5 manifest for DNN 5 users. This includes owner info, license, release notes, config install/uninstall, etc.

Tags:
Categories:
Location: Blogs Parent Separator Peter Donker

4 comment(s) so far...


Gravatar

Re: Creating a PA with a DNN 5 manifest but that installs on DNN 4 as well

Good job Peter - There are a few hidden gems in the DNN 5 manifest that have not been fully documented - or were added after the initial design/release.

By Charles Nurse on   7/15/2010
Gravatar

Re: Creating a PA with a DNN 5 manifest but that installs on DNN 4 as well

Great!!... Thanks Peter, I hear someone talk about this in Paris last month (maybe you?), I had a quick go but couldn't get it to work. I was missing the sourceFileName element. Thanks for pointing it out.

Dave.

By David Lee on   7/23/2010
Gravatar

Re: Creating a PA with a DNN 5 manifest but that installs on DNN 4 as well

Peter, quick question... can the sourceFileName element be used in a DNN 3.0 manifest file?

By David Poindexter on   12/14/2011
Gravatar

Re: Creating a PA with a DNN 5 manifest but that installs on DNN 4 as well

Hi David. No you can't as far as I know. Note the DNN 3 manifest is very sensitive to any wrong elements and in fact I've been told this is still the case for the DNN 5 manifest.

By Peter Donker on   12/14/2011
Attend A Webinar
Free Demo Site
Download DotNetNuke Professional Edition Trial
Have Someone Contact Me
Have Someone Contact Me
Charlotte DoDNN

Like Us on Facebook Join our Network on LinkedIn Follow DNN Corporate on Twitter Follow DNN on Twitter

Advertisers

Telerik JustCode Free
Exact Target Exec Alert
PowerDNN

Sponsors

DotNetNuke Corporation

DotNetNuke Corp. is the steward of the DotNetNuke open source project, the most widely adopted Web Content Management Platform for building web sites and web applications on Microsoft. Organizations use DotNetNuke to quickly develop and deploy interactive and dynamic web sites, intranets, extranets and web applications. The DotNetNuke platform is available in a free Community and subscription-based Professional and Enterprise Editions with an Elite Support option. DotNetNuke Corp. also operates the DotNetNuke Store where users purchase third party apps for the platform.