Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesScript Component to Run AFTER Module InstallScript Component to Run AFTER Module Install
Previous
 
Next
New Post
3/22/2011 6:46 PM
 
Hi there, We are using DNN for an Intranet setting. We have a shop with 12 developers. I have a module that I would like to install during the installation process, which is no problem; but I would like to create a tab and place the module on that page. I have all the code created, packaged up the module but during installation I received sql exeptions. My script is dependent on knowing the DesktopModuleID to get the process started. Of course I realize now that the install script is running prior to the module actually being installed. Duh! Anyhow, what are my options to get a post-installation script to run. As far as I can tell, I only have two options for the manifest script component...Install/Uninstall.

I would love to know if there are any other built in core functionality I can tap into or suggestions from other developers on how to handle this.

Thanks!
Briana
PS... I know I can include this on the Portal Installation Template, but this is actually a host module and I want it on a Host Menu tab.

Thanks again!

Check out the open source DNN Testimonials project on CodePlex and help build it!
 
New Post
3/22/2011 7:13 PM
 
Maybe you could have two "modules" in the install package. The first as usual and the other on just running the script.

 
New Post
3/22/2011 10:02 PM
 
You should be able to do this in an implementation of the IUpgradable interface in your module's business controller class. I thought that IUpgradable had been explained in the DotNetNuke Wiki but find that the page was never created so here are the basics for you:

The implementation of the IUpgradable interface requires the addition to your module's business controller class:

Public Class MyBusinessController
     Implements DotNetNuke.Entities.Modules.IUpgradeable


one method:

Public Function UpgradeModule(ByVal Version As String) As String _
    Implements DotNetNuke.Entities.Modules.IUpgradeable.UpgradeModule

Following the successful installation of the module and a restart of the application, your code's UpgradeModule method will be called either (when using a version 3 .dnn manifest file) once for each xx.xx.xx.SqlDataProvider script file having a version number xx.xx.xx greater than the module version before the upgrade or (when using a version 5 .dnn manifest file) once for each version listed in the manifest's <eventMessage> . . . <upgradeVersionsList> node that is greater than the module version before the upgrade. In each case, the version number will pe passed in the Version parameter of UpgradeModule. The string returned by the UpgradeModule function should report that the version upgrade was successfully processed or an error occurred.

Since the module install will have been completed by the time your UpgradeModule code is called, you can easily obtain the module's DesktopModuleID (usually by the module's FriendlyName) and perform pretty much any other work as desired.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
3/23/2011 12:11 PM
 
Alright! Those are both great ideas. I will check into the IUpgradeable interface right now. The only questions I have are that we have placed our web.config's autoUpgrade attribute to Off....so, I'm thinking an explicit request to "mode=installresources" will be required, correct?

I have created a framework that needs files to be placed within the new installation directory and also requires several modifications to the web.config and other items.  I don't want o worry about files being overwritten during an upgrade of the core, so we have created our own additional "Framework" that will be available (overriden module base classes, skin classes, jQuery UI framework classes, css files, etc). It's not hard to do per se, but if any of our developers misses a step somewhere along the line, it just adds to problems that we can have down the line.

I have taken an installation package, dropped our files in it, and modified the Default install file and portal install files. I have also created a .config file to modify the package web.config.  I have it placed in the /Install/config folder, but nothing gets executed when the installation happens. Is there a manifest file or something I need to add in that folder in order to have the config merge happen automatically during the installation process? Right now, I'm using the XMLMerge module, but again, would love to make it happen in as close to one-click as possible.

Any information you can provide would be most beneficial. Thanks again for those responses; I won't ever complain about having too many tools in my toolbox!

Briana :-)

Check out the open source DNN Testimonials project on CodePlex and help build it!
 
New Post
3/23/2011 4:51 PM
 
Aahhh!! There is an special function for what I was looking for!  According to this post,

The Script component supports two special names for scripts that will be considered in a different way than usual scripts:
  • install.SqlDataProvider: if the package is being installed for the first time, this script will be executed before all other scripts
  • upgrade.SqlDataProvider: after all regular scripts have been executed, DNN will process this script if present. If there is an "upgrade" script on the package it will be executed ALWAYS as the final script

In my dnn file, I changed my script component section to read:
<component type="Script">
            <scripts>
                <basePath>DesktopModules\Healthcomp\Framework</basePath>
                <script type="Install">
                    <name>install.SqlDataProvider</name>
                </script>
                <script type="Install">
                    <name>upgrade.SqlDataProvider</name>
                </script>
                <script type="UnInstall">
                    <name>uninstall.SqlDataProvider</name>
                    <version>01.00.02</version>
                </script>
            </scripts>
        </component>

and it works PERFECT! Thanks DNN!

Briana  
 

Check out the open source DNN Testimonials project on CodePlex and help build it!
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesScript Component to Run AFTER Module InstallScript Component to Run AFTER Module Install


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out