Search code examples
c#.netdotnetnuke

Automatically Install Module/Extension in DNN (DotNetNuke)


Does anyone know if there is a way of automatically installing an extension on DNN using .net ?

It used to be possible using the infamous Install.aspx page, which has been removed for security reasons.

I've tried refactoring the code within Install.aspx so as to automate this, or even run it for a single module, but no luck. I've just got to the point where the zip has gets unpackaged, but what I really want is to know which and how the tables in the Sql Server database get modified.

I would appreciate any pointers on this.


Solution

  • It is quite hard to find all the tables that get updated, as well as the data that gets put into them.

    My solution was is to simply call a copy of the installation page, which can be done from, say, a desktop app. For some reason the original Install.aspx won't run if you add it to the DNN installation. Step by step:

    1. Find the Install.aspx and Install.aspx.cs files. They are deleted after the first installation, but you can get them from the original download.

    2. Make a copy of these two files and rename them, e.g. MyInstall.aspx and MyInstall.aspx.cs

    3. In Visual Studio run the DNN installation as a web site, not as a web project.

    4. Now the page MyInstall will work just as the Install did. You can pass the parameters in the url.

    5. Before you call the page, you need to put your module packages into the corresponding folder e.g. for modules install/module of the DNN Installation. To create the module package use Christoc's VS templates.