DotNetNuke 5 module development tutorial - part 7: Creating the installation package

9. March 2010 21:48

To Visual Basic version

If you have followed the previous parts of this tutorial, you should now have your module and its controls installed on your local DotNetNuke site. This is a great starting point for creating an install package. When DotNetNuke installs an extension package (which is really just the extension’s files zipped together) it uses the installation manifest. The installation manifest is an XML document with a .dnn file extension in the installation package. Basically it tells DotNetNuke which files to put where and which database scripts to run on install/uninstall.
Lucky for us we have access to a great extension installation manifest generator; namely DotNetNuke itself.

Before we start creating the installation package we should finish an important part of it; the database uninstall script.
Back in part 3 we created the database install script where the table and stored procedures are created. In the uninstall script we should remove these.
Open up the file Uninstall.SqlDataProvider and replace its content with the following:

/** Drop Table **/

ALTER TABLE {databaseOwner}[{objectQualifier}SipidCode_Products] DROP CONSTRAINT [FK_{objectQualifier}SipidCode_Products_Modules]
GO

DROP TABLE {databaseOwner}[{objectQualifier}SipidCode_Products]
GO

/** Drop Stored Procedures **/

DROP PROCEDURE {databaseOwner}[{objectQualifier}SipidCode_GetProducts]
GO

DROP PROCEDURE {databaseOwner}[{objectQualifier}SipidCode_GetProduct]
GO

DROP PROCEDURE {databaseOwner}[{objectQualifier}SipidCode_AddProduct]
GO

DROP PROCEDURE databaseOwner}[{objectQualifier}SipidCode_UpdateProduct]
GO

DROP PROCEDURE databaseOwner}[{objectQualifier}SipidCode_DeleteProduct]
GO

Don’t forget to save the file.
The batch script you just created will be run when the module is uninstalled and drops the Products table and its foreign key constraint. It also drops the stored procedures we created.

At last we are ready to create the actual installation package! Log in as Host on your local DotNetNuke website and go to Host > Module Definitions. Scroll down to the Products item and click the edit icon.
Scroll down to the section Package Settings. Here you can fill in the fields if you like. Only the Friendly Name field is mandatory.
When you are done, click the Create Package link at the bottom.

Create Package link

The Create Package screen is displayed. Just click the Next link.

The Choose Files to include screen is displayed.

Choose files to include

Only the files shown in the picture above should be included in the package:

  • Database install/uninstall scripts
  • Resource files
  • Control markup files

If there are any others, delete those lines from the text box. Click Next when you are done.

The Choose Assemblies to include screen is displayed. Just click Next.

Assemblies to include

The Create Manifest screen is displayed.

Create Manifest

The text box contains the extension installation manifest for the package.
Great to have it generated for you, isn’t it? When you are done admiring the manifest, click next.

The Create Package screen (not the same one as before) is displayed.

Create Package

Remove the leading underscore character from the Manifest Field Name. A copy of the manifest file will be written into the project directory, overwriting the old and useless file we got from the template.
Finish by clicking Next.
The installation package is now created and written into the /Install/Module folder of your DotNetNuke installation.
You can now go ahead and install the package where you want. I would recommend you to set up another DotNetNuke site for testing your installations on. If you install it on your development site it will collide with your project files and possibly result in trouble.

Tags: , ,

DotNetNuke | Modules | Tutorials

Comments

3/13/2010 7:36:27 PM #

Rob

Johan - just wanted to say thanks for doing the work to put these tutorials together. It's fantastic, really, thank you for this. It's a great resource for someone just getting started with module development - the existing documentation for DNN 5.x leaves a little something to be desired, and you've filled in the blanks perfectly. You clearly went to a lot of work to do this. Thanks again.

Rob United States |

3/14/2010 5:15:07 PM #

Johan

Rob, it's really great to hear that you find it useful! It clearly makes it worth putting it together. Thanks for letting me know.

Johan Sweden |

8/26/2011 7:07:10 PM #

Olivier

This is not working for me anymore with DNN 6.0...
When I compile the custom module in the web bin directory I get the following error:

Method 'GetFileContent' in type 'DotNetNuke.Data.SqlDataProvider' from assembly 'DotNetNuke.SqlDataProvider, Version=6.0.1.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.

Olivier United States |

3/24/2010 5:57:46 PM #

Jason

Johan, I just wanted to say great job on the module tutorials for DNN 5.  They worked great and I learned a lot.  It's a great starting point for beginning module development.

Jason United States |

4/1/2010 1:08:10 AM #

csmac

Thanks for the great tutorial series, after scouring away on the web for two days straight just trying to get my head around dotnetnuke, and the lack of any decent dnn 5 tutorials, your posts were a shining light. Thanks to you, I can be productive again!

http://www.csmac.co.nz/blog

csmac New Zealand |

4/1/2010 8:56:48 AM #

Johan

I couldn't be happier hearing from you guys! This kind of feedback is really encouraging. If you come up with ideas on tutorial subjects, don't hesitate to drop me a line.
Good luck with your future projects!

Johan Sweden |

4/7/2010 8:52:04 AM #

Marie Augenarzt

Thank you, you have gained a new fan, resources like the one you mentioned here are very useful to me. I will post a link to this page on my blog. I am sure my visitors will find this very useful, please check out my site sometime and leave me a comment to let me know what you think. Regards, Marie

Marie Augenarzt United States |

4/7/2010 5:17:36 PM #

submit site

Keep up the good work

submit site United States |

6/18/2010 11:59:38 AM #

elon

Thank you very much! It's useful

elon People's Republic of China |

11/13/2010 4:25:10 PM #

Barry Sweeney

Wow, this set of tutorials has really helped me start to understand a little of what goes on behind the scenes in DNN

Thank you very much Johan.

Barry Sweeney United Kingdom |

2/21/2011 10:08:36 AM #

Thanh Tran

Hi, thanks for your great tutorial. Sorry to comment on an 1 year old article, but for me it still very helpful. I follow your article and successfully created my very first Module. But, I'm new to DNN, and I would like you to add some more part to this tutorial series, show us how to implement the detail product control, i.e when user click on the product title, it will show the product detail page.

Regards,

Thanh Tran Vietnam |

2/24/2011 9:00:13 PM #

Johan

You are most welcome to comment on my old posts. I am sorry I have not had the time to make some newer ones you can comment on Smile
For the same reason I can not promise you a tutorial for a product detail view. However, I will certainly try to find the time to do it. I have quite a few ideas on new posts/tutorials, but all too little time to do them... Frown

Johan Sweden |

3/28/2011 4:18:29 PM #

trackback

Versioning your DotNetNuke modules - a quick guide

Versioning your DotNetNuke modules - a quick guide

Sipid Code |

8/25/2011 6:11:39 AM #

Khizar

Simply greate tutorial, thanks John. Its a remedy for beginners.

Khizar India |

10/27/2011 11:36:08 PM #

Thao

Yes, great tutorial, I refer to it often even though things are slightly different now with DNN 6 and the C# template.  This is still a helpful guide.

Thao United States |

11/27/2011 11:26:21 PM #

gerry

Thanks Johan

It was a great refresher Tutorial for me ... The last time I used DNN was version 2 and 3.  And your tutorial is still quite applicable to version 6.01.

cheers

Gerry

gerry Canada |

2/29/2012 5:23:44 PM #

Pham Duy Anh

Thank you so much

Pham Duy Anh Vietnam |

5/11/2012 5:02:30 AM #

pingback

Pingback from duyanhpham.wordpress.com

HÆ°á»›ng dẫn viết module DNN 5 – DotNetNuke 5 module development tutorial  « Phạm Duy Anh

duyanhpham.wordpress.com |

7/16/2012 12:06:49 AM #

SassyCode

it couldn't be any better
thanks for this great job
keep it on

SassyCode Iran |

3/28/2013 9:31:48 AM #

plting

Great series of tutorials here.thumbs up.Looking forward your newer tutorials.Its get me started on developing modules in dnn.

plting Malaysia |

3/7/2014 6:38:47 PM #

pingback

Pingback from search-r.biz

How to add database script in DNN custom module development package? | Search RounD

search-r.biz |

Comments are closed

About the addict

Johan Seppäläinen lives in Uppsala, Sweden. He spends most of his days working as a systems architect/developer, specialized in solutions built on Microsoft platforms.
Occasionally there is time for some recreational coding, when he pursues optimal solutions and code zen, mainly in C#. When he is not writing in this blog, that is.