Tuesday, April 29, 2008
Posted on Tuesday, April 29, 2008 7:00:56 PM (Mountain Daylight Time, UTC-06:00)  Comments [3] | 
Categories: DNN

Just wrapping up a project that's built on DotNetNuke, and was using the built in module packager to create a nice zip installation. Great. Only problem is that it packs up all my Subversion "_svn" folders as well as the actual files I want. Doh! Initially I just exported from my Subversion working copy to a new location, added that as a virtual directory in IIS, and used that instance to create the package. But this is a real pain when you need to release small patches and bug fixes, so this being open source and all, I dove into the code.

And there is a simple fix... assuming you have the entire source tree laying around ( you can download it from www.dotnetnuke.com if you don't have it)

The module packager is the PaWriter class, which is in the DotNetNuke.Library project, under the Components/Modules path.

All you need to do is add two snippets of code to the two ParseFolder private methods:

Change:

Dim subFolders As DirectoryInfo() = folder.GetDirectories()

For Each subFolder As DirectoryInfo In subFolders

   If Not subFolder.Name.ToLower().Contains("_sgbak") Then

      ParseFolder(subFolder.FullName, rootPath)

   End If

Next

to:

'Recursively parse the subFolders

Dim subFolders As DirectoryInfo() = folder.GetDirectories()

For Each subFolder As DirectoryInfo In subFolders

   If Not subFolder.Name.ToLower().Contains("_sgbak") And Not subFolder.Name.ToLower().Contains("_svn") Then

      ParseFolder(subFolder.FullName, rootPath)

   End If

Next

Once you've made this change, re-build the DotNetNuke.Library, and copy the DLL into the bin folder of your DNN instance (if you are working directly in the full source tree, just build the website).

Given that Subversion is so very widely used, it would be nice if the DNN team would add this (and .svn) to the "core" code for the packager.

Tuesday, April 29, 2008 9:06:51 PM (Mountain Daylight Time, UTC-06:00)
why did you choose to use vb?
steve
Tuesday, April 29, 2008 10:47:01 PM (Mountain Daylight Time, UTC-06:00)
Shouldn't you just "export" from subversion before doing your deployment build. This gets the source from the subversion repository without all the subversion cruft - just a clean set of source.
Wednesday, April 30, 2008 8:27:33 PM (Mountain Daylight Time, UTC-06:00)
Dave excellent post, after years of visual studio source control i am also glad to be using subversion.

Dave did VB because he is working on the DNN core which sadly is 100% VB... it's very possible that his modules he is developing is in C#.

As for the Steves post, I hear what you are saying. Normally you would want to be able to deploy from your source control system... but with DNN you can build these ZIP installers, and give the ZIP to anyone running DNN and they can then upload it into their DotNetNuke and it then unzips it and puts all the files where they need to be and runs your database scripts. (Really you only need to do this if you are making modules for mass appeal, we usually just copy them out as you mentioned)

Ryan - DotNetNuke Consultant
Comments are closed.